diff --git a/README.md b/README.md index b7795de..ac36868 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,6 @@ Trakt Scrobbler for iTunes/AppleTV. Download a binary version [here](http://w3f. Any feedback or bug reports are welcome. Please use the [`issues`](https://github.com/yo-han/Traktable/issues) page or the feedback option in the app to report your feedback. -## Install - -Rename config-example.plist to config.plist and enter a tvdb and trakt api key. - ## Changelog See what's new in the [changelog](https://github.com/yo-han/Traktable/wiki/Changelog) diff --git a/Traktable.xcodeproj/project.xcworkspace/xcuserdata/johan.xcuserdatad/UserInterfaceState.xcuserstate b/Traktable.xcodeproj/project.xcworkspace/xcuserdata/johan.xcuserdatad/UserInterfaceState.xcuserstate index 20c79d1..6438e18 100644 Binary files a/Traktable.xcodeproj/project.xcworkspace/xcuserdata/johan.xcuserdatad/UserInterfaceState.xcuserstate and b/Traktable.xcodeproj/project.xcworkspace/xcuserdata/johan.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Traktable/AppDelegate.m b/Traktable/AppDelegate.m index 20afaaa..d47a89c 100644 --- a/Traktable/AppDelegate.m +++ b/Traktable/AppDelegate.m @@ -110,6 +110,8 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(VLCPlayerStateDidChange) name:@"VLCPlayerStateDidChange" object:nil suspensionBehavior:NSNotificationSuspensionBehaviorCoalesce]; [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(iTunesSourceSaved:) name:@"com.apple.iTunes.sourceSaved" object:@"com.apple.iTunes.sources" suspensionBehavior:NSNotificationSuspensionBehaviorCoalesce]; + + [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(iTunesSourceSaved:) name:@"com.apple.iTunes.sourceInfo" object:@"com.apple.iTunes.sources" suspensionBehavior:NSNotificationSuspensionBehaviorCoalesce]; } - (IBAction)showLog:(id)sender { diff --git a/Traktable/ITLibrary.m b/Traktable/ITLibrary.m index 4777c20..e163c17 100644 --- a/Traktable/ITLibrary.m +++ b/Traktable/ITLibrary.m @@ -19,6 +19,10 @@ @interface ITLibrary() - (id)init; - (void)checkTracks:(NSArray *)tracks; +<<<<<<< HEAD +======= +- (void)createDir:(NSString *)dir; +>>>>>>> 36d3320923f18ac9a8d3e894293a6ad9602a8cdb @property dispatch_queue_t queue; @property dispatch_group_t dispatchGroup; @@ -28,6 +32,10 @@ - (void)checkTracks:(NSArray *)tracks; @implementation ITLibrary @synthesize iTunesBridge; +<<<<<<< HEAD +======= +@synthesize dbQueue=_dbQueue; +>>>>>>> 36d3320923f18ac9a8d3e894293a6ad9602a8cdb @synthesize dbFilePath; @synthesize firstImport; @@ -36,7 +44,19 @@ - (id)init { self = [super init]; if (self) { +<<<<<<< HEAD iTunesBridge = [SBApplication applicationWithBundleIdentifier:@"com.apple.iTunes"]; +======= + [self resetDb]; + } + + _dbQueue = [FMDatabaseQueue databaseQueueWithPath:dbFilePath]; + _queue = dispatch_queue_create("traktable.sync.queue", NULL); + _dispatchGroup = dispatch_group_create(); + + [self.dbQueue inDatabase:^(FMDatabase *db) { + FMResultSet *s = [db executeQuery:@"SELECT playedCount FROM library"]; +>>>>>>> 36d3320923f18ac9a8d3e894293a6ad9602a8cdb NSString *appSupportPath = [ITConstants applicationSupportFolder]; [ITUtil createDir:appSupportPath]; @@ -151,6 +171,7 @@ - (void)syncLibrary { NSArray *shows = [self getVideos:iTunesESpKTVShows noCheck:NO]; firstImport = NO; + [self checkTracks:movies]; [self checkTracks:shows]; @@ -160,6 +181,7 @@ - (void)syncLibrary { - (void)checkTracks:(NSArray *)tracks { __block NSMutableArray *seenVideos = [NSMutableArray array]; + ITVideo *video = [ITVideo new]; ITApi *api = [ITApi new]; @@ -246,9 +268,8 @@ - (void)checkTracks:(NSArray *)tracks { } - dispatch_group_notify(self.dispatchGroup, self.queue, ^{ - + if([seenVideos count] > 0) [api seen:seenVideos type:iTunesEVdKMovie video:nil]; });