neumannjmt / openmeta

Automatically exported from code.google.com/p/openmeta
0 stars 0 forks source link

Migrating tags to kMDItemOMUserTags does not work for files tagged using only Apple's namespace (i.e. with older OpenMeta versions) #19

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago

What steps will reproduce the problem?
1. Add a tag to a file using a version of OpenMeta prior to r24 (i.e. a version 
that only saves 'last 
tagged' timestamps using Apple's namespace)
2. Read this file's tags using the latest version of OpenMeta (r50)

What is the expected output? What do you see instead?
Expected to get the added tag, instead don't get it.

Please provide any additional information below.

The problem seems to be that OpenMetaBackup's 
-copyTagsFromOldKeyTokMDItemOMIfNeeded: only 
reads `org.openmetainfo.time:kOMUserTags` and 
`org.openmetainfo.time:kMDItemOMUserTags` but 
not `com.apple.metadata:kOMUserTagTime`, and older versions of the library 
don't use the 
org.openmetainfo namespace at all, so only the last attribute of these will be 
set. This will result in it 
not even attempting to copy the tags over to the new namespace and then in the 
end not finding any 
tags on the file.

Original issue reported on code.google.com by ali.rantakari@gmail.com on 28 Nov 2009 at 9:39

GoogleCodeExporter commented 9 years ago
It seems this can be fixed by adding on line 633 of OpenMetaBackup.m (r50) the 
following:

if (thekOMDate == nil)
    thekOMDate = [OpenMeta getXAttr:@"com.apple.metadata:kOMUserTagTime" path:inPath error:&error];

Original comment by ali.rantakari@gmail.com on 28 Nov 2009 at 9:49