diff --git a/epub.xcodeproj/project.pbxproj b/epub.xcodeproj/project.pbxproj index 43c6d82..ca0a3d4 100644 --- a/epub.xcodeproj/project.pbxproj +++ b/epub.xcodeproj/project.pbxproj @@ -51,6 +51,7 @@ 675FAB5C14D9BF780065603A /* zip.c in Sources */ = {isa = PBXBuildFile; fileRef = D78388991354AA7600E7937B /* zip.c */; }; 6783BD9F14FA8C1C00696991 /* NSString+HTML.m in Sources */ = {isa = PBXBuildFile; fileRef = 674D09CF14CF2C6800127A36 /* NSString+HTML.m */; }; 67909CE914F37D9E009819B2 /* NSDate+OPF.m in Sources */ = {isa = PBXBuildFile; fileRef = 67E3077214E9A24A0004C1D8 /* NSDate+OPF.m */; }; + 67932B221503FEA600D61278 /* schema.xml in Resources */ = {isa = PBXBuildFile; fileRef = 67932B211503FEA600D61278 /* schema.xml */; }; 67BE43EE14DEC886003C7DFC /* fake-adept.epub in Resources */ = {isa = PBXBuildFile; fileRef = 67BE43EB14DEC886003C7DFC /* fake-adept.epub */; }; 67BE43EF14DEC886003C7DFC /* fake-fairplay.epub in Resources */ = {isa = PBXBuildFile; fileRef = 67BE43EC14DEC886003C7DFC /* fake-fairplay.epub */; }; 67BE43F014DEC886003C7DFC /* fake-kobo.epub in Resources */ = {isa = PBXBuildFile; fileRef = 67BE43ED14DEC886003C7DFC /* fake-kobo.epub */; }; @@ -121,6 +122,7 @@ 675FAB4A14D9B8760065603A /* EpubTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EpubTests.h; sourceTree = ""; }; 675FAB4B14D9B8760065603A /* EpubTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EpubTests.m; sourceTree = ""; }; 675FAB4D14D9B8760065603A /* EpubTests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "EpubTests-Prefix.pch"; sourceTree = ""; }; + 67932B211503FEA600D61278 /* schema.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = schema.xml; sourceTree = ""; }; 67BE43EB14DEC886003C7DFC /* fake-adept.epub */ = {isa = PBXFileReference; lastKnownFileType = file; path = "fake-adept.epub"; sourceTree = ""; }; 67BE43EC14DEC886003C7DFC /* fake-fairplay.epub */ = {isa = PBXFileReference; lastKnownFileType = file; path = "fake-fairplay.epub"; sourceTree = ""; }; 67BE43ED14DEC886003C7DFC /* fake-kobo.epub */ = {isa = PBXFileReference; lastKnownFileType = file; path = "fake-kobo.epub"; sourceTree = ""; }; @@ -224,6 +226,7 @@ 235DC65414EFB3C800D28657 /* InfoPlist.strings */, 235DC65714EFB3C800D28657 /* main.c */, 235DC65F14EFB3C800D28657 /* epubMDI-Prefix.pch */, + 67932B211503FEA600D61278 /* schema.xml */, ); name = "Supporting Files"; sourceTree = ""; @@ -507,6 +510,7 @@ files = ( 235DC65614EFB3C800D28657 /* InfoPlist.strings in Resources */, 674566961502B4810012224C /* entities.plist in Resources */, + 67932B221503FEA600D61278 /* schema.xml in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/epubMDI/MySpotlightImporter.m b/epubMDI/MySpotlightImporter.m index d901469..e9b96e3 100644 --- a/epubMDI/MySpotlightImporter.m +++ b/epubMDI/MySpotlightImporter.m @@ -39,7 +39,14 @@ - (BOOL)importFileAtPath:(NSString *)filePath attributes:(NSMutableDictionary *) [spotlightData setObject:editors forKey:(NSString *)kMDItemEditors]; // illustrators + NSArray *illustrators = [epub illustrators]; + if ([illustrators count] > 0) + [spotlightData setObject:illustrators forKey:@"org_idpf_epub_container_metadata_illustrators"]; + // translators + NSArray *translators = [epub translators]; + if ([translators count] > 0) + [spotlightData setObject:translators forKey:@"org_idpf_epub_container_metadata_translators"]; // synopsis kMDItemHeadline ? NSString *synopsis = [[epub synopsis] stringByStrippingHTML]; @@ -74,12 +81,12 @@ - (BOOL)importFileAtPath:(NSString *)filePath attributes:(NSMutableDictionary *) if (text) [content appendString:text]; } while (text); - NSString *tmp = [NSString stringWithFormat:@"Indexed %lu", [content length]]; - [spotlightData setObject:tmp forKey:(NSString *)kMDItemComment]; + //NSString *tmp = [NSString stringWithFormat:@"Indexed %lu", [content length]]; + //[spotlightData setObject:tmp forKey:(NSString *)kMDItemComment]; [spotlightData setObject:content forKey:(NSString *)kMDItemTextContent]; [content release]; } else { - [spotlightData setObject:@"No indexed content" forKey:(NSString *)kMDItemComment]; + //[spotlightData setObject:@"No indexed content" forKey:(NSString *)kMDItemComment]; } [epub release]; diff --git a/epubMDI/schema.xml b/epubMDI/schema.xml new file mode 100644 index 0000000..fadfcf9 --- /dev/null +++ b/epubMDI/schema.xml @@ -0,0 +1,39 @@ + + + + Custom attributes indexed by this EPUB metadata importer. + + + + + + + + + kMDItemDisplayName + kMDItemAuthors + kMDItemPublishers + kMDItemContributors + kMDItemEditors + org_idpf_epub_container_metadata_illustrators + org_idpf_epub_container_metadata_translators + kMDItemHeadline + kMDItemIdentifier + kMDItemDueDate + kMDItemSecurityMethod + kMDItemComment + kMDItemTextContent + + + kMDItemDisplayName + kMDItemAuthors + kMDItemPublishers + kMDItemDueDate + kMDItemSecurityMethod + + + +