Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added the option for Custom Artwork Thumbnail

  • Loading branch information...
commit fc74d693ecb05ca06fb3db280df9c8f40d6da10f 1 parent 73b7e15
@Itaybre Itaybre authored
Showing with 15 additions and 1 deletion.
  1. +1 −0  ipodimport.h
  2. +14 −1 server.m
View
1  ipodimport.h
@@ -23,6 +23,7 @@
#define kIPIKeyDuration @"duration" // NSNumber with `int`, duration in milliseconds
#define kIPIKeyYear @"year" // NSNumber with `int`
#define kIPIKeyMediaType @"type" // One of the kIPIMedia constants, media type, defaults to kIPIMediaSong if unspecified
+#define kIPIKeyArtworkURL @"artworkURL" // NSString with the path to the Artwork Image
// Media type keys
#define kIPIMediaSong @"song" // Song, music
View
15 server.m
@@ -51,13 +51,26 @@ void ipodimport_messageHandler(id self, SEL _cmd, NSString *name, NSDictionary *
[metad setGenre:[userInfo objectForKey:kIPIKeyGenre]]; // NSString
[metad setDurationInMilliseconds:[userInfo objectForKey:kIPIKeyDuration]]; // NSNumber, int
[metad setReleaseYear:[userInfo objectForKey:kIPIKeyYear]]; // NSNumber, int
+
+ //Artwork
+ if([userInfo objectForKey:kIPIKeyArtworkURL] != NULL) {
+ [metad setThumbnailImageURL:[NSURL fileURLWithPath:[userInfo objectForKey:kIPIKeyImageURL]]];
+ [metad setArtworkIsPrerendered:NO];
+ }
SSDownloadQueue *dlQueue = [[SSDownloadQueue alloc] initWithDownloadKinds:[SSDownloadQueue mediaDownloadKinds]];
SSDownload *downl = [[SSDownload alloc] initWithDownloadMetadata:metad];
+
+ if([userInfo objectForKey:kIPIKeyImageURL] != NULL) {
+ [downl loadThumbnailImageDataWithCompletionBlock:^{
+ NSLog(@"Thumbnail Image Added Succesfully");
+ }];
+ }
+
[downl setDownloadHandler:nil completionBlock:^{
[dlQueue release];
}];
- [dlQueue addDownload:downl];
+ [dlQueue addDownload:downl];
[downl release];
}
Please sign in to comment.
Something went wrong with that request. Please try again.