From 607e26c31c0225f987659906a1e458c1e658546c Mon Sep 17 00:00:00 2001 From: Pietro Caselani Date: Wed, 1 Jan 2020 04:04:24 +0100 Subject: [PATCH] Small progress on syncing shows --- CouchTrackerSync/CouchTrackerSync.swift | 59 +- CouchTrackerSync/ShowWatchedProgress.swift | 7 - CouchTrackerSync/SyncEnvironment.swift | 44 +- CouchTrackerSync/SyncWatchedShows.swift | 7 - ...ests.swift => CouchTrackerSyncTests.swift} | 24 +- .../Resources/baseShow-Success.json | 551 ++++ .../Resources/syncWatchedShows-Success.json | 2232 ----------------- .../Resources/watchedProgress-Success.json | 537 ++++ TraktSwift/Models/Base/BaseShow.swift | 27 + 9 files changed, 1201 insertions(+), 2287 deletions(-) delete mode 100644 CouchTrackerSync/ShowWatchedProgress.swift delete mode 100644 CouchTrackerSync/SyncWatchedShows.swift rename CouchTrackerSyncTests/{SyncWatchedShows/SyncWatchedShowsTests.swift => CouchTrackerSyncTests.swift} (53%) create mode 100644 CouchTrackerSyncTests/Resources/baseShow-Success.json create mode 100644 CouchTrackerSyncTests/Resources/watchedProgress-Success.json diff --git a/CouchTrackerSync/CouchTrackerSync.swift b/CouchTrackerSync/CouchTrackerSync.swift index 5f0318bb..ae553489 100644 --- a/CouchTrackerSync/CouchTrackerSync.swift +++ b/CouchTrackerSync/CouchTrackerSync.swift @@ -1,23 +1,56 @@ +import TraktSwift import RxSwift +import Moya -enum SyncState { - case notSyncing - case started +enum SyncError: Error { + case showIsNil } -struct SyncData { - var state: SyncState -} +struct WatchedProgressOptions { + let hidden: Bool + let specials: Bool + let countSpecials: Bool -enum SyncAction { - case start + init(hidden: Bool = false, specials: Bool = false, countSpecials: Bool = false) { + self.hidden = hidden + self.specials = specials + self.countSpecials = countSpecials + } } -func syncReducer(syncData: inout SyncData, action: SyncAction) -> [Observable] { - switch action { - case .start: - syncData.state = .started +struct SyncOptions { + let watchedProgress: WatchedProgressOptions + + init(watchedProgress: WatchedProgressOptions = WatchedProgressOptions()) { + self.watchedProgress = watchedProgress } +} + +func startSync(options: SyncOptions) -> Observable { + return syncMain(options) +} + +private func syncMain(_ options: SyncOptions) -> Observable { + return Current.syncWatchedShows(.noSeasons) + .flatMap { Observable.from($0) } + .flatMap { watchedProgress(options: options.watchedProgress, baseShow: $0) } +} + +private func watchedProgress(options: WatchedProgressOptions, baseShow: BaseShow) -> Observable { + guard let show = baseShow.show else { return Observable.error(SyncError.showIsNil) } + return Current.watchedProgress(options, show.ids).map { merge(syncBaseShow: baseShow, progressBaseShow: $0) } +} - return [] +private func merge(syncBaseShow: BaseShow, progressBaseShow: BaseShow) -> BaseShow { + BaseShow(show: syncBaseShow.show, + seasons: progressBaseShow.seasons, + lastCollectedAt: nil, + listedAt: nil, + plays: syncBaseShow.plays, + lastWatchedAt: progressBaseShow.lastWatchedAt, + aired: progressBaseShow.aired, + completed: progressBaseShow.completed, + hiddenSeasons: progressBaseShow.hiddenSeasons, + nextEpisode: progressBaseShow.nextEpisode, + lastEpisode: progressBaseShow.lastEpisode) } diff --git a/CouchTrackerSync/ShowWatchedProgress.swift b/CouchTrackerSync/ShowWatchedProgress.swift deleted file mode 100644 index 8a628875..00000000 --- a/CouchTrackerSync/ShowWatchedProgress.swift +++ /dev/null @@ -1,7 +0,0 @@ -import TraktSwift -import RxSwift -import Moya - -func watchedProgressForShows(_ shows: Single<[BaseShow]>) { - -} diff --git a/CouchTrackerSync/SyncEnvironment.swift b/CouchTrackerSync/SyncEnvironment.swift index 9808de80..5dd30ba9 100644 --- a/CouchTrackerSync/SyncEnvironment.swift +++ b/CouchTrackerSync/SyncEnvironment.swift @@ -1,27 +1,22 @@ import TraktSwift import RxSwift -struct SyncEnvironment { - var networkScheduler: SchedulerType - var trakt: TraktProvider +let traktBuilder = TraktBuilder { + $0.clientId = Secrets.Trakt.clientId + $0.clientSecret = Secrets.Trakt.clientSecret + $0.redirectURL = Secrets.Trakt.redirectURL + $0.callbackQueue = DispatchQueue(label: "NetworkQueue", qos: .default) } -extension SyncEnvironment { - static let live: SyncEnvironment = { - let networkQueue = DispatchQueue(label: "NetworkQueue", qos: .default) +private let trakt = Trakt(builder: traktBuilder) - let traktBuilder = TraktBuilder { - $0.clientId = Secrets.Trakt.clientId - $0.clientSecret = Secrets.Trakt.clientSecret - $0.redirectURL = Secrets.Trakt.redirectURL - $0.callbackQueue = networkQueue - } +struct SyncEnvironment { + var syncWatchedShows: (Extended) -> Observable<[BaseShow]> + var watchedProgress: (WatchedProgressOptions, ShowIds) -> Observable +} - return SyncEnvironment( - networkScheduler: ConcurrentDispatchQueueScheduler(queue: networkQueue), - trakt: Trakt(builder: traktBuilder) - ) - }() +extension SyncEnvironment { + static let live = SyncEnvironment(syncWatchedShows: syncWatchedShows(extended:), watchedProgress: watchedProgress(options:showIds:)) } #if DEBUG @@ -29,3 +24,18 @@ var Current = SyncEnvironment.live #else let Current = SyncEnvironment.live #endif + +private func syncWatchedShows(extended: Extended) -> Observable<[BaseShow]> { + return trakt.sync.rx.request(.watched(type: .shows, extended: extended)).map([BaseShow].self).asObservable() +} + +private func watchedProgress(options: WatchedProgressOptions, showIds: ShowIds) -> Observable { + return trakt.shows.rx.request( + .watchedProgress( + showId: showIds.realId, + hidden: options.countSpecials, + specials: options.countSpecials, + countSpecials: options.countSpecials + ) + ).map(BaseShow.self).asObservable() +} diff --git a/CouchTrackerSync/SyncWatchedShows.swift b/CouchTrackerSync/SyncWatchedShows.swift deleted file mode 100644 index 5c3735a9..00000000 --- a/CouchTrackerSync/SyncWatchedShows.swift +++ /dev/null @@ -1,7 +0,0 @@ -import TraktSwift -import RxSwift -import Moya - -func syncWatchedShows() -> Single<[BaseShow]> { - return Current.trakt.sync.rx.request(.watched(type: .shows, extended: .noSeasons)).map([BaseShow].self) -} diff --git a/CouchTrackerSyncTests/SyncWatchedShows/SyncWatchedShowsTests.swift b/CouchTrackerSyncTests/CouchTrackerSyncTests.swift similarity index 53% rename from CouchTrackerSyncTests/SyncWatchedShows/SyncWatchedShowsTests.swift rename to CouchTrackerSyncTests/CouchTrackerSyncTests.swift index 422eaf28..4fb4fbb2 100644 --- a/CouchTrackerSyncTests/SyncWatchedShows/SyncWatchedShowsTests.swift +++ b/CouchTrackerSyncTests/CouchTrackerSyncTests.swift @@ -9,8 +9,7 @@ import RxNimble @testable import CouchTrackerSync -final class SyncWatchedShowsTests: XCTestCase { - private var originalTrakt: TraktProvider! +final class CouchTrackerSyncTests: XCTestCase { private var scheduler: TestScheduler! private var disposeBag: DisposeBag! @@ -18,26 +17,29 @@ final class SyncWatchedShowsTests: XCTestCase { super.setUp() disposeBag = DisposeBag() - originalTrakt = Current.trakt scheduler = TestScheduler(initialClock: 0) } override func tearDown() { - Current.trakt = originalTrakt scheduler = nil disposeBag = nil super.tearDown() } - func testSyncWatchedShows() throws { - let data = contentsOf(file: "SyncWatchedShowsSuccess") - let responseStubbed = EndpointSampleResponse.networkResponse(200, data) - let trakt: SyncTestableTrakt = makeTestableTrakt(responseStubbed) - Current.trakt = trakt + func testSync() { + Current.syncWatchedShows = { _ in + Observable.just(decode(file: "syncWatchedShows-Success", as: [BaseShow].self)) + } - let expectedShows = try JSONDecoder().decode([BaseShow].self, from: data) + Current.watchedProgress = { _, _ in + Observable.just(decode(file: "watchedProgress-Success", as: BaseShow.self)) + } - expect(syncWatchedShows()) + let expectedShows = decode(file: "baseShow-Success", as: BaseShow.self) + + let observable = startSync(options: SyncOptions()) + + expect(observable) .events(scheduler: scheduler, disposeBag: disposeBag) .to(equal([ Recorded.next(0, expectedShows), diff --git a/CouchTrackerSyncTests/Resources/baseShow-Success.json b/CouchTrackerSyncTests/Resources/baseShow-Success.json new file mode 100644 index 00000000..5d5a8710 --- /dev/null +++ b/CouchTrackerSyncTests/Resources/baseShow-Success.json @@ -0,0 +1,551 @@ +{ + "plays": 82, + "last_watched_at": "2019-07-28T05:38:12.000Z", + "last_updated_at": "2019-07-28T05:38:12.000Z", + "reset_at": null, + "aired": 91, + "completed": 78, + "show": { + "title": "Orange Is the New Black", + "year": 2013, + "ids": { + "trakt": 1415, + "slug": "orange-is-the-new-black", + "tvdb": 264586, + "imdb": "tt2372162", + "tmdb": 1424, + "tvrage": 32950 + } + }, + "seasons": [ + { + "number": 1, + "aired": 13, + "completed": 13, + "episodes": [ + { + "number": 1, + "completed": true, + "last_watched_at": "2014-07-22T01:09:08.000Z" + }, + { + "number": 2, + "completed": true, + "last_watched_at": "2014-07-28T00:53:02.000Z" + }, + { + "number": 3, + "completed": true, + "last_watched_at": "2014-07-28T01:59:32.000Z" + }, + { + "number": 4, + "completed": true, + "last_watched_at": "2014-07-28T02:52:57.000Z" + }, + { + "number": 5, + "completed": true, + "last_watched_at": "2014-07-28T08:23:51.000Z" + }, + { + "number": 6, + "completed": true, + "last_watched_at": "2014-07-28T09:17:40.000Z" + }, + { + "number": 7, + "completed": true, + "last_watched_at": "2014-07-28T10:14:20.000Z" + }, + { + "number": 8, + "completed": true, + "last_watched_at": "2014-07-30T02:11:29.000Z" + }, + { + "number": 9, + "completed": true, + "last_watched_at": "2014-07-30T22:19:20.000Z" + }, + { + "number": 10, + "completed": true, + "last_watched_at": "2014-07-30T23:15:25.000Z" + }, + { + "number": 11, + "completed": true, + "last_watched_at": "2014-07-31T00:13:04.000Z" + }, + { + "number": 12, + "completed": true, + "last_watched_at": "2014-07-31T01:14:40.000Z" + }, + { + "number": 13, + "completed": true, + "last_watched_at": "2014-07-31T02:16:41.000Z" + } + ] + }, + { + "number": 2, + "aired": 13, + "completed": 13, + "episodes": [ + { + "number": 1, + "completed": true, + "last_watched_at": "2014-07-31T23:10:08.000Z" + }, + { + "number": 2, + "completed": true, + "last_watched_at": "2014-08-01T00:04:48.000Z" + }, + { + "number": 3, + "completed": true, + "last_watched_at": "2014-08-01T01:03:48.000Z" + }, + { + "number": 4, + "completed": true, + "last_watched_at": "2014-08-01T02:59:16.000Z" + }, + { + "number": 5, + "completed": true, + "last_watched_at": "2014-08-01T02:59:31.000Z" + }, + { + "number": 6, + "completed": true, + "last_watched_at": "2014-08-02T01:34:27.000Z" + }, + { + "number": 7, + "completed": true, + "last_watched_at": "2014-08-02T03:26:28.000Z" + }, + { + "number": 8, + "completed": true, + "last_watched_at": "2014-08-02T04:22:58.000Z" + }, + { + "number": 9, + "completed": true, + "last_watched_at": "2014-08-02T05:22:49.000Z" + }, + { + "number": 10, + "completed": true, + "last_watched_at": "2014-08-02T06:24:45.000Z" + }, + { + "number": 11, + "completed": true, + "last_watched_at": "2014-08-02T15:15:51.000Z" + }, + { + "number": 12, + "completed": true, + "last_watched_at": "2014-08-02T16:19:49.000Z" + }, + { + "number": 13, + "completed": true, + "last_watched_at": "2014-08-02T22:18:15.000Z" + } + ] + }, + { + "number": 3, + "aired": 13, + "completed": 13, + "episodes": [ + { + "number": 1, + "completed": true, + "last_watched_at": "2015-06-20T23:00:22.000Z" + }, + { + "number": 2, + "completed": true, + "last_watched_at": "2015-06-21T03:14:28.000Z" + }, + { + "number": 3, + "completed": true, + "last_watched_at": "2015-06-21T03:14:34.000Z" + }, + { + "number": 4, + "completed": true, + "last_watched_at": "2015-06-21T03:14:40.000Z" + }, + { + "number": 5, + "completed": true, + "last_watched_at": "2015-06-21T03:14:47.000Z" + }, + { + "number": 6, + "completed": true, + "last_watched_at": "2015-06-21T17:20:29.000Z" + }, + { + "number": 7, + "completed": true, + "last_watched_at": "2015-06-22T03:38:11.000Z" + }, + { + "number": 8, + "completed": true, + "last_watched_at": "2015-06-22T03:38:12.000Z" + }, + { + "number": 9, + "completed": true, + "last_watched_at": "2015-06-22T03:38:24.000Z" + }, + { + "number": 10, + "completed": true, + "last_watched_at": "2015-06-22T03:39:08.000Z" + }, + { + "number": 11, + "completed": true, + "last_watched_at": "2015-06-22T03:52:20.000Z" + }, + { + "number": 12, + "completed": true, + "last_watched_at": "2015-06-23T02:12:37.000Z" + }, + { + "number": 13, + "completed": true, + "last_watched_at": "2015-06-23T02:13:04.000Z" + } + ] + }, + { + "number": 4, + "aired": 13, + "completed": 13, + "episodes": [ + { + "number": 1, + "completed": true, + "last_watched_at": "2016-07-23T06:57:26.000Z" + }, + { + "number": 2, + "completed": true, + "last_watched_at": "2016-07-23T08:02:06.000Z" + }, + { + "number": 3, + "completed": true, + "last_watched_at": "2016-07-23T18:51:09.000Z" + }, + { + "number": 4, + "completed": true, + "last_watched_at": "2016-07-23T22:33:25.000Z" + }, + { + "number": 5, + "completed": true, + "last_watched_at": "2016-07-23T23:34:07.000Z" + }, + { + "number": 6, + "completed": true, + "last_watched_at": "2016-07-24T00:31:41.000Z" + }, + { + "number": 7, + "completed": true, + "last_watched_at": "2016-07-24T17:46:25.000Z" + }, + { + "number": 8, + "completed": true, + "last_watched_at": "2016-07-24T17:46:26.000Z" + }, + { + "number": 9, + "completed": true, + "last_watched_at": "2016-07-24T17:46:27.000Z" + }, + { + "number": 10, + "completed": true, + "last_watched_at": "2016-07-24T17:46:28.000Z" + }, + { + "number": 11, + "completed": true, + "last_watched_at": "2016-07-24T18:45:52.000Z" + }, + { + "number": 12, + "completed": true, + "last_watched_at": "2016-07-24T19:45:37.000Z" + }, + { + "number": 13, + "completed": true, + "last_watched_at": "2016-07-25T00:13:08.000Z" + } + ] + }, + { + "number": 5, + "aired": 13, + "completed": 13, + "episodes": [ + { + "number": 1, + "completed": true, + "last_watched_at": "2018-02-19T03:20:51.000Z" + }, + { + "number": 2, + "completed": true, + "last_watched_at": "2018-02-20T05:41:16.000Z" + }, + { + "number": 3, + "completed": true, + "last_watched_at": "2018-02-22T05:32:07.000Z" + }, + { + "number": 4, + "completed": true, + "last_watched_at": "2018-02-22T17:34:23.000Z" + }, + { + "number": 5, + "completed": true, + "last_watched_at": "2018-02-23T08:17:30.000Z" + }, + { + "number": 6, + "completed": true, + "last_watched_at": "2018-02-24T07:15:42.000Z" + }, + { + "number": 7, + "completed": true, + "last_watched_at": "2018-02-24T18:33:03.000Z" + }, + { + "number": 8, + "completed": true, + "last_watched_at": "2018-02-25T18:06:59.000Z" + }, + { + "number": 9, + "completed": true, + "last_watched_at": "2018-03-01T02:18:59.000Z" + }, + { + "number": 10, + "completed": true, + "last_watched_at": "2018-03-01T03:25:58.000Z" + }, + { + "number": 11, + "completed": true, + "last_watched_at": "2018-03-01T21:15:47.000Z" + }, + { + "number": 12, + "completed": true, + "last_watched_at": "2018-03-02T01:28:16.000Z" + }, + { + "number": 13, + "completed": true, + "last_watched_at": "2018-03-02T02:57:10.000Z" + } + ] + }, + { + "number": 6, + "aired": 13, + "completed": 13, + "episodes": [ + { + "number": 1, + "completed": true, + "last_watched_at": "2019-07-22T00:37:10.000Z" + }, + { + "number": 2, + "completed": true, + "last_watched_at": "2019-07-22T00:38:57.000Z" + }, + { + "number": 3, + "completed": true, + "last_watched_at": "2019-07-22T11:58:16.000Z" + }, + { + "number": 4, + "completed": true, + "last_watched_at": "2019-07-23T01:36:48.000Z" + }, + { + "number": 5, + "completed": true, + "last_watched_at": "2019-07-24T01:43:53.000Z" + }, + { + "number": 6, + "completed": true, + "last_watched_at": "2019-07-24T01:44:44.000Z" + }, + { + "number": 7, + "completed": true, + "last_watched_at": "2019-07-24T03:07:06.000Z" + }, + { + "number": 8, + "completed": true, + "last_watched_at": "2019-07-27T02:28:58.000Z" + }, + { + "number": 9, + "completed": true, + "last_watched_at": "2019-07-27T03:25:36.000Z" + }, + { + "number": 10, + "completed": true, + "last_watched_at": "2019-07-27T19:35:41.000Z" + }, + { + "number": 11, + "completed": true, + "last_watched_at": "2019-07-28T01:37:27.000Z" + }, + { + "number": 12, + "completed": true, + "last_watched_at": "2019-07-28T02:35:32.000Z" + }, + { + "number": 13, + "completed": true, + "last_watched_at": "2019-07-28T05:38:12.000Z" + } + ] + }, + { + "number": 7, + "aired": 13, + "completed": 0, + "episodes": [ + { + "number": 1, + "completed": false, + "last_watched_at": null + }, + { + "number": 2, + "completed": false, + "last_watched_at": null + }, + { + "number": 3, + "completed": false, + "last_watched_at": null + }, + { + "number": 4, + "completed": false, + "last_watched_at": null + }, + { + "number": 5, + "completed": false, + "last_watched_at": null + }, + { + "number": 6, + "completed": false, + "last_watched_at": null + }, + { + "number": 7, + "completed": false, + "last_watched_at": null + }, + { + "number": 8, + "completed": false, + "last_watched_at": null + }, + { + "number": 9, + "completed": false, + "last_watched_at": null + }, + { + "number": 10, + "completed": false, + "last_watched_at": null + }, + { + "number": 11, + "completed": false, + "last_watched_at": null + }, + { + "number": 12, + "completed": false, + "last_watched_at": null + }, + { + "number": 13, + "completed": false, + "last_watched_at": null + } + ] + } + ], + "hidden_seasons": [], + "next_episode": { + "season": 7, + "number": 1, + "title": "Beginning of the End", + "ids": { + "trakt": 3541694, + "tvdb": 7199938, + "imdb": null, + "tmdb": 1795786, + "tvrage": 0 + } + }, + "last_episode": { + "season": 6, + "number": 13, + "title": "Be Free", + "ids": { + "trakt": 3057460, + "tvdb": 6773297, + "imdb": "tt6360850", + "tmdb": 1531576, + "tvrage": 0 + } + } +} diff --git a/CouchTrackerSyncTests/Resources/syncWatchedShows-Success.json b/CouchTrackerSyncTests/Resources/syncWatchedShows-Success.json index f103c214..817d76c7 100644 --- a/CouchTrackerSyncTests/Resources/syncWatchedShows-Success.json +++ b/CouchTrackerSyncTests/Resources/syncWatchedShows-Success.json @@ -1,238 +1,4 @@ [ - { - "plays": 17, - "last_watched_at": "2019-12-22T02:30:51.000Z", - "last_updated_at": "2019-12-22T02:30:51.000Z", - "reset_at": null, - "show": { - "title": "The End of the F***ing World", - "year": 2017, - "ids": { - "trakt": 124490, - "slug": "the-end-of-the-f-ing-world", - "tvdb": 336522, - "imdb": "tt6257970", - "tmdb": 74577, - "tvrage": null - } - } - }, - { - "plays": 39, - "last_watched_at": "2019-12-18T19:10:28.000Z", - "last_updated_at": "2019-12-18T19:10:28.000Z", - "reset_at": null, - "show": { - "title": "13 Reasons Why", - "year": 2017, - "ids": { - "trakt": 116129, - "slug": "13-reasons-why", - "tvdb": 323168, - "imdb": "tt1837492", - "tmdb": 66788, - "tvrage": null - } - } - }, - { - "plays": 28, - "last_watched_at": "2019-12-07T02:07:49.000Z", - "last_updated_at": "2019-12-07T02:07:49.000Z", - "reset_at": null, - "show": { - "title": "Atypical", - "year": 2017, - "ids": { - "trakt": 121107, - "slug": "atypical", - "tvdb": 330374, - "imdb": "tt6315640", - "tmdb": 71578, - "tvrage": null - } - } - }, - { - "plays": 23, - "last_watched_at": "2019-11-17T11:24:28.000Z", - "last_updated_at": "2019-11-17T11:24:28.000Z", - "reset_at": null, - "show": { - "title": "Money Heist", - "year": 2017, - "ids": { - "trakt": 118572, - "slug": "money-heist", - "tvdb": 327417, - "imdb": "tt6468322", - "tmdb": 71446, - "tvrage": null - } - } - }, - { - "plays": 25, - "last_watched_at": "2019-11-12T23:51:30.000Z", - "last_updated_at": "2019-11-12T23:51:30.000Z", - "reset_at": null, - "show": { - "title": "Stranger Things", - "year": 2016, - "ids": { - "trakt": 104439, - "slug": "stranger-things", - "tvdb": 305288, - "imdb": "tt4574334", - "tmdb": 66732, - "tvrage": 48493 - } - } - }, - { - "plays": 72, - "last_watched_at": "2019-10-25T07:00:00.000Z", - "last_updated_at": "2019-11-16T09:47:14.000Z", - "reset_at": null, - "show": { - "title": "BoJack Horseman", - "year": 2014, - "ids": { - "trakt": 60730, - "slug": "bojack-horseman", - "tvdb": 282254, - "imdb": "tt3398228", - "tmdb": 61222, - "tvrage": 39470 - } - } - }, - { - "plays": 5, - "last_watched_at": "2019-09-09T04:52:26.000Z", - "last_updated_at": "2019-09-09T04:52:26.000Z", - "reset_at": null, - "show": { - "title": "Secret Amazon", - "year": null, - "ids": { - "trakt": 100812, - "slug": "secret-amazon", - "tvdb": 298866, - "imdb": null, - "tmdb": null, - "tvrage": null - } - } - }, - { - "plays": 4, - "last_watched_at": "2019-09-02T05:30:26.000Z", - "last_updated_at": "2019-09-02T05:30:26.000Z", - "reset_at": null, - "show": { - "title": "Murdoch Mysteries", - "year": 2008, - "ids": { - "trakt": 12730, - "slug": "murdoch-mysteries", - "tvdb": 81670, - "imdb": "tt1091909", - "tmdb": 12786, - "tvrage": 17791 - } - } - }, - { - "plays": 127, - "last_watched_at": "2019-08-27T04:21:53.000Z", - "last_updated_at": "2019-08-27T04:21:53.000Z", - "reset_at": null, - "show": { - "title": "The Blacklist", - "year": 2013, - "ids": { - "trakt": 46676, - "slug": "the-blacklist", - "tvdb": 266189, - "imdb": "tt2741602", - "tmdb": 46952, - "tvrage": 35048 - } - } - }, - { - "plays": 155, - "last_watched_at": "2019-08-24T17:24:12.000Z", - "last_updated_at": "2019-08-24T17:24:12.000Z", - "reset_at": null, - "show": { - "title": "Elementary", - "year": 2012, - "ids": { - "trakt": 1406, - "slug": "elementary", - "tvdb": 255316, - "imdb": "tt2191671", - "tmdb": 1415, - "tvrage": 30750 - } - } - }, - { - "plays": 193, - "last_watched_at": "2019-08-24T04:08:38.000Z", - "last_updated_at": "2019-08-24T04:08:38.000Z", - "reset_at": null, - "show": { - "title": "Marvel's Agents of S.H.I.E.L.D.", - "year": 2013, - "ids": { - "trakt": 1394, - "slug": "marvel-s-agents-of-s-h-i-e-l-d", - "tvdb": 263365, - "imdb": "tt2364582", - "tmdb": 1403, - "tvrage": 32656 - } - } - }, - { - "plays": 31, - "last_watched_at": "2019-08-23T21:51:59.000Z", - "last_updated_at": "2019-08-23T21:51:59.000Z", - "reset_at": null, - "show": { - "title": "Rick and Morty", - "year": 2013, - "ids": { - "trakt": 69829, - "slug": "rick-and-morty", - "tvdb": 275274, - "imdb": "tt2861424", - "tmdb": 60625, - "tvrage": 33381 - } - } - }, - { - "plays": 11, - "last_watched_at": "2019-08-19T05:29:31.000Z", - "last_updated_at": "2019-08-19T05:29:31.000Z", - "reset_at": null, - "show": { - "title": "Titans", - "year": 2018, - "ids": { - "trakt": 127287, - "slug": "titans-2018", - "tvdb": 341663, - "imdb": "tt1043813", - "tmdb": 75450, - "tvrage": null - } - } - }, { "plays": 82, "last_watched_at": "2019-07-28T05:38:12.000Z", @@ -250,2003 +16,5 @@ "tvrage": 32950 } } - }, - { - "plays": 21, - "last_watched_at": "2019-07-20T20:16:45.000Z", - "last_updated_at": "2019-07-20T20:16:45.000Z", - "reset_at": null, - "show": { - "title": "Harrow", - "year": 2018, - "ids": { - "trakt": 127833, - "slug": "harrow", - "tvdb": 342568, - "imdb": "tt7242816", - "tmdb": 77947, - "tvrage": null - } - } - }, - { - "plays": 40, - "last_watched_at": "2019-07-13T03:48:23.000Z", - "last_updated_at": "2019-07-13T03:48:23.000Z", - "reset_at": null, - "show": { - "title": "Marvel's Jessica Jones", - "year": 2015, - "ids": { - "trakt": 79385, - "slug": "marvel-s-jessica-jones", - "tvdb": 284190, - "imdb": "tt2357547", - "tmdb": 38472, - "tvrage": 38797 - } - } - }, - { - "plays": 22, - "last_watched_at": "2019-07-08T23:53:48.000Z", - "last_updated_at": "2019-07-08T23:53:48.000Z", - "reset_at": null, - "show": { - "title": "Black Mirror", - "year": 2011, - "ids": { - "trakt": 41793, - "slug": "black-mirror", - "tvdb": 253463, - "imdb": "tt2085059", - "tmdb": 42009, - "tvrage": 30348 - } - } - }, - { - "plays": 20, - "last_watched_at": "2019-07-07T20:01:30.000Z", - "last_updated_at": "2019-07-07T20:01:30.000Z", - "reset_at": null, - "show": { - "title": "Marvel's Cloak & Dagger", - "year": 2018, - "ids": { - "trakt": 127167, - "slug": "marvel-s-cloak-dagger", - "tvdb": 341455, - "imdb": "tt5614844", - "tmdb": 66190, - "tvrage": null - } - } - }, - { - "plays": 71, - "last_watched_at": "2019-07-07T17:10:03.000Z", - "last_updated_at": "2019-07-07T17:10:03.000Z", - "reset_at": null, - "show": { - "title": "Vikings", - "year": 2013, - "ids": { - "trakt": 43973, - "slug": "vikings", - "tvdb": 260449, - "imdb": "tt2306299", - "tmdb": 44217, - "tvrage": 31136 - } - } - }, - { - "plays": 284, - "last_watched_at": "2019-05-26T20:46:41.000Z", - "last_updated_at": "2019-05-26T20:46:41.000Z", - "reset_at": null, - "show": { - "title": "The Big Bang Theory", - "year": 2007, - "ids": { - "trakt": 1409, - "slug": "the-big-bang-theory", - "tvdb": 80379, - "imdb": "tt0898266", - "tmdb": 1418, - "tvrage": 8511 - } - } - }, - { - "plays": 111, - "last_watched_at": "2019-05-26T03:42:10.000Z", - "last_updated_at": "2019-05-26T03:42:10.000Z", - "reset_at": null, - "show": { - "title": "House of Cards", - "year": 2013, - "ids": { - "trakt": 1416, - "slug": "house-of-cards", - "tvdb": 262980, - "imdb": "tt1856010", - "tmdb": 1425, - "tvrage": 27822 - } - } - }, - { - "plays": 87, - "last_watched_at": "2019-05-24T01:45:49.000Z", - "last_updated_at": "2019-05-24T01:45:49.000Z", - "reset_at": null, - "show": { - "title": "Supergirl", - "year": 2015, - "ids": { - "trakt": 99046, - "slug": "supergirl", - "tvdb": 295759, - "imdb": "tt4016454", - "tmdb": 62688, - "tvrage": 44824 - } - } - }, - { - "plays": 68, - "last_watched_at": "2019-05-24T00:49:25.000Z", - "last_updated_at": "2019-05-24T00:49:25.000Z", - "reset_at": null, - "show": { - "title": "DC's Legends of Tomorrow", - "year": 2016, - "ids": { - "trakt": 98898, - "slug": "dc-s-legends-of-tomorrow", - "tvdb": 295760, - "imdb": "tt4532368", - "tmdb": 62643, - "tvrage": 48407 - } - } - }, - { - "plays": 102, - "last_watched_at": "2019-05-21T02:07:09.000Z", - "last_updated_at": "2019-05-21T02:07:09.000Z", - "reset_at": null, - "show": { - "title": "Gotham", - "year": 2014, - "ids": { - "trakt": 60278, - "slug": "gotham", - "tvdb": 274431, - "imdb": "tt3749900", - "tmdb": 60708, - "tvrage": 38049 - } - } - }, - { - "plays": 116, - "last_watched_at": "2019-05-19T00:27:41.000Z", - "last_updated_at": "2019-05-19T00:27:41.000Z", - "reset_at": null, - "show": { - "title": "The Flash", - "year": 2014, - "ids": { - "trakt": 60300, - "slug": "the-flash-2014", - "tvdb": 279121, - "imdb": "tt3107288", - "tmdb": 60735, - "tvrage": 36939 - } - } - }, - { - "plays": 166, - "last_watched_at": "2019-05-18T22:02:53.000Z", - "last_updated_at": "2019-05-18T22:02:53.000Z", - "reset_at": null, - "show": { - "title": "Arrow", - "year": 2012, - "ids": { - "trakt": 1403, - "slug": "arrow", - "tvdb": 257655, - "imdb": "tt2193021", - "tmdb": 1412, - "tvrage": 30715 - } - } - }, - { - "plays": 10, - "last_watched_at": "2019-04-26T14:15:38.000Z", - "last_updated_at": "2019-04-26T14:15:38.000Z", - "reset_at": null, - "show": { - "title": "The Umbrella Academy", - "year": 2019, - "ids": { - "trakt": 137198, - "slug": "the-umbrella-academy", - "tvdb": 353764, - "imdb": "tt1312171", - "tmdb": 75006, - "tvrage": null - } - } - }, - { - "plays": 3, - "last_watched_at": "2019-04-20T03:51:49.000Z", - "last_updated_at": "2019-04-20T03:51:49.000Z", - "reset_at": null, - "show": { - "title": "GLOW", - "year": 2017, - "ids": { - "trakt": 116959, - "slug": "glow", - "tvdb": 324835, - "imdb": "tt5770786", - "tmdb": 70573, - "tvrage": null - } - } - }, - { - "plays": 8, - "last_watched_at": "2019-04-19T22:07:15.000Z", - "last_updated_at": "2019-04-19T22:07:15.000Z", - "reset_at": null, - "show": { - "title": "Sex Education", - "year": 2019, - "ids": { - "trakt": 140590, - "slug": "sex-education", - "tvdb": 356317, - "imdb": "tt7767422", - "tmdb": 81356, - "tvrage": null - } - } - }, - { - "plays": 20, - "last_watched_at": "2019-04-16T22:43:56.000Z", - "last_updated_at": "2019-04-16T22:43:56.000Z", - "reset_at": null, - "show": { - "title": "Disjointed", - "year": 2017, - "ids": { - "trakt": 118451, - "slug": "disjointed-2017", - "tvdb": 327359, - "imdb": "tt5884792", - "tmdb": 71308, - "tvrage": null - } - } - }, - { - "plays": 26, - "last_watched_at": "2019-04-07T07:11:55.000Z", - "last_updated_at": "2019-04-07T07:11:55.000Z", - "reset_at": null, - "show": { - "title": "Marvel's The Punisher", - "year": 2017, - "ids": { - "trakt": 112663, - "slug": "marvel-s-the-punisher", - "tvdb": 331980, - "imdb": "tt5675620", - "tmdb": 67178, - "tvrage": 52104 - } - } - }, - { - "plays": 18, - "last_watched_at": "2019-04-06T23:59:46.000Z", - "last_updated_at": "2019-04-06T23:59:46.000Z", - "reset_at": null, - "show": { - "title": "Love, Death & Robots", - "year": 2019, - "ids": { - "trakt": 142611, - "slug": "love-death-robots", - "tvdb": 357888, - "imdb": "tt9561862", - "tmdb": 86831, - "tvrage": null - } - } - }, - { - "plays": 75, - "last_watched_at": "2019-03-31T00:07:07.000Z", - "last_updated_at": "2019-03-31T00:07:07.000Z", - "reset_at": null, - "show": { - "title": "How to Get Away with Murder", - "year": 2014, - "ids": { - "trakt": 60576, - "slug": "how-to-get-away-with-murder", - "tvdb": 281620, - "imdb": "tt3205802", - "tmdb": 61056, - "tvrage": 37307 - } - } - }, - { - "plays": 505, - "last_watched_at": "2019-03-30T02:36:55.000Z", - "last_updated_at": "2019-03-30T02:36:55.000Z", - "reset_at": null, - "show": { - "title": "Naruto Shippuden", - "year": 2007, - "ids": { - "trakt": 31770, - "slug": "naruto-shippuden", - "tvdb": 79824, - "imdb": "tt0988824", - "tmdb": 31910, - "tvrage": null - } - } - }, - { - "plays": 220, - "last_watched_at": "2019-02-17T06:57:01.000Z", - "last_updated_at": "2019-02-17T06:57:01.000Z", - "reset_at": null, - "show": { - "title": "Naruto", - "year": 2002, - "ids": { - "trakt": 46003, - "slug": "naruto", - "tvdb": 78857, - "imdb": "tt0409591", - "tmdb": 46260, - "tvrage": 4620 - } - } - }, - { - "plays": 158, - "last_watched_at": "2019-01-01T07:25:27.000Z", - "last_updated_at": "2019-01-01T07:25:27.000Z", - "reset_at": null, - "show": { - "title": "Once Upon a Time", - "year": 2011, - "ids": { - "trakt": 39108, - "slug": "once-upon-a-time", - "tvdb": 248835, - "imdb": "tt1843230", - "tmdb": 39272, - "tvrage": 28385 - } - } - }, - { - "plays": 85, - "last_watched_at": "2018-12-17T05:55:11.000Z", - "last_updated_at": "2018-12-17T05:55:11.000Z", - "reset_at": null, - "show": { - "title": "Homeland", - "year": 2011, - "ids": { - "trakt": 1398, - "slug": "homeland", - "tvdb": 247897, - "imdb": "tt1796960", - "tmdb": 1407, - "tvrage": 27811 - } - } - }, - { - "plays": 31, - "last_watched_at": "2018-11-24T15:36:49.000Z", - "last_updated_at": "2018-11-24T15:36:49.000Z", - "reset_at": null, - "show": { - "title": "Shooter", - "year": 2016, - "ids": { - "trakt": 107790, - "slug": "shooter", - "tvdb": 311900, - "imdb": "tt4181172", - "tmdb": 66857, - "tvrage": null - } - } - }, - { - "plays": 45, - "last_watched_at": "2018-10-27T17:04:25.000Z", - "last_updated_at": "2018-10-27T17:04:25.000Z", - "reset_at": null, - "show": { - "title": "Marvel's Daredevil", - "year": 2015, - "ids": { - "trakt": 77938, - "slug": "marvel-s-daredevil", - "tvdb": 281662, - "imdb": "tt3322312", - "tmdb": 61889, - "tvrage": 38796 - } - } - }, - { - "plays": 19, - "last_watched_at": "2018-10-20T03:18:10.000Z", - "last_updated_at": "2018-10-20T03:18:10.000Z", - "reset_at": null, - "show": { - "title": "Legion", - "year": 2017, - "ids": { - "trakt": 113656, - "slug": "legion", - "tvdb": 320724, - "imdb": "tt5114356", - "tmdb": 67195, - "tvrage": 52471 - } - } - }, - { - "plays": 35, - "last_watched_at": "2018-10-01T10:09:12.000Z", - "last_updated_at": "2018-10-01T10:09:12.000Z", - "reset_at": null, - "show": { - "title": "Love", - "year": 2016, - "ids": { - "trakt": 104465, - "slug": "love", - "tvdb": 305378, - "imdb": "tt4061080", - "tmdb": 53606, - "tvrage": null - } - } - }, - { - "plays": 23, - "last_watched_at": "2018-09-16T04:17:43.000Z", - "last_updated_at": "2018-09-16T04:17:43.000Z", - "reset_at": null, - "show": { - "title": "Marvel's Iron Fist", - "year": 2017, - "ids": { - "trakt": 112082, - "slug": "marvel-s-iron-fist", - "tvdb": 317953, - "imdb": "tt3322310", - "tmdb": 62127, - "tvrage": null - } - } - }, - { - "plays": 30, - "last_watched_at": "2018-09-07T08:29:54.000Z", - "last_updated_at": "2018-09-07T08:29:54.000Z", - "reset_at": null, - "show": { - "title": "Rectify", - "year": 2013, - "ids": { - "trakt": 46347, - "slug": "rectify", - "tvdb": 266609, - "imdb": "tt2183404", - "tmdb": 46619, - "tvrage": 30069 - } - } - }, - { - "plays": 56, - "last_watched_at": "2018-08-27T04:43:38.000Z", - "last_updated_at": "2018-08-27T04:43:38.000Z", - "reset_at": null, - "show": { - "title": "Strike Back", - "year": 2010, - "ids": { - "trakt": 32433, - "slug": "strike-back", - "tvdb": 148581, - "imdb": "tt1492179", - "tmdb": 32573, - "tvrage": 25652 - } - } - }, - { - "plays": 62, - "last_watched_at": "2018-08-20T04:44:41.000Z", - "last_updated_at": "2018-08-20T04:44:41.000Z", - "reset_at": null, - "show": { - "title": "Sleepy Hollow", - "year": 2013, - "ids": { - "trakt": 50503, - "slug": "sleepy-hollow", - "tvdb": 269578, - "imdb": "tt2647544", - "tmdb": 50825, - "tvrage": 34726 - } - } - }, - { - "plays": 24, - "last_watched_at": "2018-08-12T21:04:18.000Z", - "last_updated_at": "2018-08-12T21:04:18.000Z", - "reset_at": null, - "show": { - "title": "Sense8", - "year": 2015, - "ids": { - "trakt": 70384, - "slug": "sense8", - "tvdb": 268156, - "imdb": "tt2431438", - "tmdb": 61664, - "tvrage": 35197 - } - } - }, - { - "plays": 27, - "last_watched_at": "2018-08-09T02:19:09.000Z", - "last_updated_at": "2018-08-09T02:19:09.000Z", - "reset_at": null, - "show": { - "title": "Marvel's Luke Cage", - "year": 2016, - "ids": { - "trakt": 79382, - "slug": "marvel-s-luke-cage", - "tvdb": 304219, - "imdb": "tt3322314", - "tmdb": 62126, - "tvrage": null - } - } - }, - { - "plays": 77, - "last_watched_at": "2018-06-01T01:18:21.000Z", - "last_updated_at": "2018-06-01T01:18:21.000Z", - "reset_at": null, - "show": { - "title": "The Americans", - "year": 2013, - "ids": { - "trakt": 46263, - "slug": "the-americans-2013", - "tvdb": 261690, - "imdb": "tt2149175", - "tmdb": 46533, - "tvrage": 30449 - } - } - }, - { - "plays": 94, - "last_watched_at": "2018-05-31T20:17:55.000Z", - "last_updated_at": "2018-05-31T20:17:55.000Z", - "reset_at": null, - "show": { - "title": "Scorpion", - "year": 2014, - "ids": { - "trakt": 60356, - "slug": "scorpion", - "tvdb": 281630, - "imdb": "tt3514324", - "tmdb": 60797, - "tvrage": 40717 - } - } - }, - { - "plays": 41, - "last_watched_at": "2018-05-23T23:08:19.000Z", - "last_updated_at": "2018-05-23T23:08:19.000Z", - "reset_at": null, - "show": { - "title": "The Magicians", - "year": 2015, - "ids": { - "trakt": 100940, - "slug": "the-magicians-2015", - "tvdb": 299139, - "imdb": "tt4254242", - "tmdb": 64432, - "tvrage": 43586 - } - } - }, - { - "plays": 2, - "last_watched_at": "2018-03-04T23:29:11.000Z", - "last_updated_at": "2018-03-04T23:29:11.000Z", - "reset_at": null, - "show": { - "title": "Fullmetal Alchemist: Brotherhood", - "year": 2009, - "ids": { - "trakt": 31771, - "slug": "fullmetal-alchemist-brotherhood", - "tvdb": 85249, - "imdb": "tt1355642", - "tmdb": 31911, - "tvrage": null - } - } - }, - { - "plays": 23, - "last_watched_at": "2018-02-14T02:03:22.000Z", - "last_updated_at": "2018-02-14T02:03:22.000Z", - "reset_at": null, - "show": { - "title": "Scream Queens", - "year": 2015, - "ids": { - "trakt": 96979, - "slug": "scream-queens-2015", - "tvdb": 293302, - "imdb": "tt4145384", - "tmdb": 62046, - "tvrage": 45726 - } - } - }, - { - "plays": 38, - "last_watched_at": "2018-01-25T21:13:17.000Z", - "last_updated_at": "2018-01-25T21:13:17.000Z", - "reset_at": null, - "show": { - "title": "Black Sails", - "year": 2014, - "ids": { - "trakt": 47374, - "slug": "black-sails", - "tvdb": 262407, - "imdb": "tt2375692", - "tmdb": 47665, - "tvrage": 32725 - } - } - }, - { - "plays": 24, - "last_watched_at": "2017-12-26T21:37:47.000Z", - "last_updated_at": "2017-12-26T21:37:47.000Z", - "reset_at": null, - "show": { - "title": "The Girlfriend Experience", - "year": 2016, - "ids": { - "trakt": 100225, - "slug": "the-girlfriend-experience-2016", - "tvdb": 297346, - "imdb": "tt3846642", - "tmdb": 64387, - "tvrage": 43172 - } - } - }, - { - "plays": 32, - "last_watched_at": "2017-12-18T00:33:54.000Z", - "last_updated_at": "2017-12-18T00:33:54.000Z", - "reset_at": null, - "show": { - "title": "Mr. Robot", - "year": 2015, - "ids": { - "trakt": 93720, - "slug": "mr-robot", - "tvdb": 289590, - "imdb": "tt4158110", - "tmdb": 62560, - "tvrage": 42422 - } - } - }, - { - "plays": 50, - "last_watched_at": "2017-11-17T09:55:02.000Z", - "last_updated_at": "2017-11-17T09:55:02.000Z", - "reset_at": null, - "show": { - "title": "Bates Motel", - "year": 2013, - "ids": { - "trakt": 46510, - "slug": "bates-motel", - "tvdb": 262414, - "imdb": "tt2188671", - "tmdb": 46786, - "tvrage": 32210 - } - } - }, - { - "plays": 44, - "last_watched_at": "2017-10-15T16:40:54.000Z", - "last_updated_at": "2017-10-15T16:40:54.000Z", - "reset_at": null, - "show": { - "title": "Two and a Half Men", - "year": 2003, - "ids": { - "trakt": 2673, - "slug": "two-and-a-half-men", - "tvdb": 72227, - "imdb": "tt0369179", - "tmdb": 2691, - "tvrage": 6454 - } - } - }, - { - "plays": 19, - "last_watched_at": "2017-10-10T02:06:51.000Z", - "last_updated_at": "2017-10-10T02:06:51.000Z", - "reset_at": null, - "show": { - "title": "The Fall", - "year": 2013, - "ids": { - "trakt": 48703, - "slug": "the-fall", - "tvdb": 258107, - "imdb": "tt2294189", - "tmdb": 49010, - "tvrage": 35498 - } - } - }, - { - "plays": 46, - "last_watched_at": "2017-10-07T06:56:52.000Z", - "last_updated_at": "2017-10-07T06:56:52.000Z", - "reset_at": null, - "show": { - "title": "The Strain", - "year": 2014, - "ids": { - "trakt": 47350, - "slug": "the-strain", - "tvdb": 276564, - "imdb": "tt2654620", - "tmdb": 47640, - "tvrage": 33229 - } - } - }, - { - "plays": 92, - "last_watched_at": "2017-09-12T03:48:32.000Z", - "last_updated_at": "2017-09-12T03:48:32.000Z", - "reset_at": null, - "show": { - "title": "Sons of Anarchy", - "year": 2008, - "ids": { - "trakt": 1400, - "slug": "sons-of-anarchy", - "tvdb": 82696, - "imdb": "tt1124373", - "tmdb": 1409, - "tvrage": 18174 - } - } - }, - { - "plays": 8, - "last_watched_at": "2017-08-20T02:38:43.000Z", - "last_updated_at": "2017-08-20T02:38:43.000Z", - "reset_at": null, - "show": { - "title": "Marvel's The Defenders", - "year": 2017, - "ids": { - "trakt": 118025, - "slug": "marvel-s-the-defenders", - "tvdb": 326490, - "imdb": "tt4230076", - "tmdb": 62285, - "tvrage": 41117 - } - } - }, - { - "plays": 88, - "last_watched_at": "2017-06-03T07:45:28.000Z", - "last_updated_at": "2017-06-03T07:45:28.000Z", - "reset_at": null, - "show": { - "title": "Prison Break", - "year": 2005, - "ids": { - "trakt": 2274, - "slug": "prison-break", - "tvdb": 360115, - "imdb": "tt0455275", - "tmdb": 2288, - "tvrage": null - } - } - }, - { - "plays": 50, - "last_watched_at": "2017-03-01T03:45:35.000Z", - "last_updated_at": "2017-03-01T03:45:35.000Z", - "reset_at": null, - "show": { - "title": "Wilfred", - "year": 2011, - "ids": { - "trakt": 39352, - "slug": "wilfred-2011", - "tvdb": 239761, - "imdb": "tt1703925", - "tmdb": 39525, - "tvrage": null - } - } - }, - { - "plays": 15, - "last_watched_at": "2017-01-19T23:39:08.000Z", - "last_updated_at": "2017-01-19T23:39:08.000Z", - "reset_at": null, - "show": { - "title": "Sherlock", - "year": 2010, - "ids": { - "trakt": 19792, - "slug": "sherlock", - "tvdb": 176941, - "imdb": "tt1475582", - "tmdb": 19885, - "tvrage": 23433 - } - } - }, - { - "plays": 21, - "last_watched_at": "2016-11-23T01:03:05.000Z", - "last_updated_at": "2016-11-23T01:03:05.000Z", - "reset_at": null, - "show": { - "title": "Fear the Walking Dead", - "year": 2015, - "ids": { - "trakt": 94961, - "slug": "fear-the-walking-dead", - "tvdb": 290853, - "imdb": "tt3743822", - "tmdb": 62286, - "tvrage": 48384 - } - } - }, - { - "plays": 26, - "last_watched_at": "2016-11-16T01:43:10.000Z", - "last_updated_at": "2016-11-16T01:43:10.000Z", - "reset_at": null, - "show": { - "title": "Hemlock Grove", - "year": 2013, - "ids": { - "trakt": 42072, - "slug": "hemlock-grove", - "tvdb": 259948, - "imdb": "tt2309295", - "tmdb": 42295, - "tvrage": 33272 - } - } - }, - { - "plays": 84, - "last_watched_at": "2016-10-26T00:48:16.000Z", - "last_updated_at": "2016-10-26T00:48:16.000Z", - "reset_at": null, - "show": { - "title": "The Walking Dead", - "year": 2010, - "ids": { - "trakt": 1393, - "slug": "the-walking-dead", - "tvdb": 153021, - "imdb": "tt1520211", - "tmdb": 1402, - "tvrage": 25056 - } - } - }, - { - "plays": 206, - "last_watched_at": "2016-10-05T00:49:41.000Z", - "last_updated_at": "2016-10-05T00:49:41.000Z", - "reset_at": null, - "show": { - "title": "Person of Interest", - "year": 2011, - "ids": { - "trakt": 1402, - "slug": "person-of-interest", - "tvdb": 248742, - "imdb": "tt1839578", - "tmdb": 1411, - "tvrage": 28376 - } - } - }, - { - "plays": 12, - "last_watched_at": "2016-09-19T23:25:10.000Z", - "last_updated_at": "2016-09-19T23:25:10.000Z", - "reset_at": null, - "show": { - "title": "The Night Manager", - "year": 2016, - "ids": { - "trakt": 94686, - "slug": "the-night-manager", - "tvdb": 290508, - "imdb": "tt1399664", - "tmdb": 61859, - "tvrage": null - } - } - }, - { - "plays": 209, - "last_watched_at": "2016-09-08T02:45:18.000Z", - "last_updated_at": "2016-09-08T02:45:34.000Z", - "reset_at": null, - "show": { - "title": "How I Met Your Mother", - "year": 2005, - "ids": { - "trakt": 1095, - "slug": "how-i-met-your-mother", - "tvdb": 75760, - "imdb": "tt0460649", - "tmdb": 1100, - "tvrage": 3918 - } - } - }, - { - "plays": 20, - "last_watched_at": "2016-08-12T23:54:07.000Z", - "last_updated_at": "2016-08-12T23:54:02.000Z", - "reset_at": null, - "show": { - "title": "Fargo", - "year": 2014, - "ids": { - "trakt": 60203, - "slug": "fargo", - "tvdb": 269613, - "imdb": "tt2802850", - "tmdb": 60622, - "tvrage": 35276 - } - } - }, - { - "plays": 43, - "last_watched_at": "2016-07-30T04:09:13.000Z", - "last_updated_at": "2016-07-30T04:09:11.000Z", - "reset_at": null, - "show": { - "title": "Banshee", - "year": 2013, - "ids": { - "trakt": 41522, - "slug": "banshee", - "tvdb": 259765, - "imdb": "tt2017109", - "tmdb": 41727, - "tvrage": 30823 - } - } - }, - { - "plays": 27, - "last_watched_at": "2016-07-23T05:34:05.000Z", - "last_updated_at": "2016-07-23T05:34:01.000Z", - "reset_at": null, - "show": { - "title": "Penny Dreadful", - "year": 2014, - "ids": { - "trakt": 54327, - "slug": "penny-dreadful", - "tvdb": 265766, - "imdb": "tt2628232", - "tmdb": 54671, - "tvrage": 34172 - } - } - }, - { - "plays": 28, - "last_watched_at": "2016-07-03T00:19:24.000Z", - "last_updated_at": "2016-07-03T00:19:24.000Z", - "reset_at": null, - "show": { - "title": "Da Vinci's Demons", - "year": 2013, - "ids": { - "trakt": 40108, - "slug": "da-vinci-s-demons", - "tvdb": 259669, - "imdb": "tt2094262", - "tmdb": 40293, - "tvrage": 32724 - } - } - }, - { - "plays": 19, - "last_watched_at": "2016-06-12T18:06:24.000Z", - "last_updated_at": "2016-06-13T11:50:49.000Z", - "reset_at": null, - "show": { - "title": "Marvel's Agent Carter", - "year": 2015, - "ids": { - "trakt": 77677, - "slug": "marvel-s-agent-carter", - "tvdb": 281485, - "imdb": "tt3475734", - "tmdb": 61550, - "tvrage": 38412 - } - } - }, - { - "plays": 63, - "last_watched_at": "2016-01-27T02:15:50.000Z", - "last_updated_at": "2016-01-27T02:15:50.000Z", - "reset_at": null, - "show": { - "title": "American Horror Story", - "year": 2011, - "ids": { - "trakt": 1404, - "slug": "american-horror-story", - "tvdb": 250487, - "imdb": "tt1844624", - "tmdb": 1413, - "tvrage": 28776 - } - } - }, - { - "plays": 16, - "last_watched_at": "2015-11-30T04:15:53.000Z", - "last_updated_at": "2015-11-30T04:15:53.000Z", - "reset_at": null, - "show": { - "title": "True Detective", - "year": 2014, - "ids": { - "trakt": 46375, - "slug": "true-detective", - "tvdb": 270633, - "imdb": "tt2356777", - "tmdb": 46648, - "tvrage": 31369 - } - } - }, - { - "plays": 3, - "last_watched_at": "2015-11-21T03:32:56.000Z", - "last_updated_at": "2015-11-21T03:32:56.000Z", - "reset_at": null, - "show": { - "title": "Jake 2.0", - "year": 2003, - "ids": { - "trakt": 4545, - "slug": "jake-2-0", - "tvdb": 78898, - "imdb": "tt0367344", - "tmdb": 4569, - "tvrage": 4033 - } - } - }, - { - "plays": 78, - "last_watched_at": "2015-11-19T22:57:30.000Z", - "last_updated_at": "2015-11-19T22:57:30.000Z", - "reset_at": null, - "show": { - "title": "The X-Files", - "year": 1993, - "ids": { - "trakt": 4063, - "slug": "the-x-files", - "tvdb": 77398, - "imdb": "tt0106179", - "tmdb": 4087, - "tvrage": 6312 - } - } - }, - { - "plays": 13, - "last_watched_at": "2015-11-18T00:36:00.000Z", - "last_updated_at": "2015-11-19T03:35:26.000Z", - "reset_at": null, - "show": { - "title": "Intelligence", - "year": 2014, - "ids": { - "trakt": 50307, - "slug": "intelligence-2014", - "tvdb": 267260, - "imdb": "tt2693776", - "tmdb": 50628, - "tvrage": 34469 - } - } - }, - { - "plays": 13, - "last_watched_at": "2015-11-02T20:15:07.000Z", - "last_updated_at": "2015-11-02T20:15:07.000Z", - "reset_at": null, - "show": { - "title": "Constantine", - "year": 2014, - "ids": { - "trakt": 60307, - "slug": "constantine", - "tvdb": 273690, - "imdb": "tt3489184", - "tmdb": 60743, - "tvrage": 38109 - } - } - }, - { - "plays": 42, - "last_watched_at": "2015-10-19T17:41:49.000Z", - "last_updated_at": "2015-10-19T17:41:49.000Z", - "reset_at": null, - "show": { - "title": "Continuum", - "year": 2012, - "ids": { - "trakt": 42793, - "slug": "continuum", - "tvdb": 258171, - "imdb": "tt1954347", - "tmdb": 43020, - "tvrage": 30789 - } - } - }, - { - "plays": 19, - "last_watched_at": "2015-10-13T01:51:21.000Z", - "last_updated_at": "2015-10-13T01:51:21.000Z", - "reset_at": null, - "show": { - "title": "Mortal Kombat: Legacy", - "year": 2011, - "ids": { - "trakt": 62318, - "slug": "mortal-kombat-legacy", - "tvdb": 237951, - "imdb": "tt1842127", - "tmdb": 61579, - "tvrage": 28092 - } - } - }, - { - "plays": 39, - "last_watched_at": "2015-08-29T04:56:01.000Z", - "last_updated_at": "2015-08-29T04:56:01.000Z", - "reset_at": null, - "show": { - "title": "Hannibal", - "year": 2013, - "ids": { - "trakt": 39825, - "slug": "hannibal", - "tvdb": 259063, - "imdb": "tt2243973", - "tmdb": 40008, - "tvrage": 30909 - } - } - }, - { - "plays": 110, - "last_watched_at": "2015-06-14T21:05:42.000Z", - "last_updated_at": "2015-06-14T21:05:42.000Z", - "reset_at": null, - "show": { - "title": "Community", - "year": 2009, - "ids": { - "trakt": 18265, - "slug": "community", - "tvdb": 94571, - "imdb": "tt1439629", - "tmdb": 18347, - "tvrage": 22589 - } - } - }, - { - "plays": 45, - "last_watched_at": "2015-05-23T03:13:10.000Z", - "last_updated_at": "2015-05-23T03:13:10.000Z", - "reset_at": null, - "show": { - "title": "The Following", - "year": 2013, - "ids": { - "trakt": 44846, - "slug": "the-following", - "tvdb": 258744, - "imdb": "tt2071645", - "tmdb": 45094, - "tvrage": 31672 - } - } - }, - { - "plays": 23, - "last_watched_at": "2015-05-18T01:44:35.000Z", - "last_updated_at": "2015-05-18T01:44:35.000Z", - "reset_at": null, - "show": { - "title": "Forever", - "year": 2014, - "ids": { - "trakt": 60291, - "slug": "forever-2014", - "tvdb": 281535, - "imdb": "tt3487382", - "tmdb": 60726, - "tvrage": 41038 - } - } - }, - { - "plays": 157, - "last_watched_at": "2015-02-23T02:12:23.000Z", - "last_updated_at": "2015-02-23T02:12:24.000Z", - "reset_at": null, - "show": { - "title": "The Mentalist", - "year": 2008, - "ids": { - "trakt": 5882, - "slug": "the-mentalist", - "tvdb": 82459, - "imdb": "tt1196946", - "tmdb": 5920, - "tvrage": 18967 - } - } - }, - { - "plays": 6, - "last_watched_at": "2015-01-24T15:47:40.000Z", - "last_updated_at": "2015-01-24T15:47:40.000Z", - "reset_at": null, - "show": { - "title": "The Code", - "year": 2014, - "ids": { - "trakt": 80201, - "slug": "the-code", - "tvdb": 285507, - "imdb": "tt3914672", - "tmdb": 61496, - "tvrage": 44898 - } - } - }, - { - "plays": 11, - "last_watched_at": "2015-01-06T01:07:41.000Z", - "last_updated_at": "2015-01-06T01:07:42.000Z", - "reset_at": null, - "show": { - "title": "Prisoners of War", - "year": 2010, - "ids": { - "trakt": 67198, - "slug": "prisoners-of-war", - "tvdb": 147411, - "imdb": "tt1676462", - "tmdb": 51157, - "tvrage": null - } - } - }, - { - "plays": 75, - "last_watched_at": "2014-12-26T06:15:41.000Z", - "last_updated_at": "2014-12-26T06:15:41.000Z", - "reset_at": null, - "show": { - "title": "Covert Affairs", - "year": 2010, - "ids": { - "trakt": 31494, - "slug": "covert-affairs", - "tvdb": 104281, - "imdb": "tt1495708", - "tmdb": 31631, - "tvrage": 23686 - } - } - }, - { - "plays": 82, - "last_watched_at": "2014-12-26T05:19:20.000Z", - "last_updated_at": "2014-12-26T05:19:20.000Z", - "reset_at": null, - "show": { - "title": "White Collar", - "year": 2009, - "ids": { - "trakt": 21410, - "slug": "white-collar", - "tvdb": 108611, - "imdb": "tt1358522", - "tmdb": 21510, - "tvrage": 20720 - } - } - }, - { - "plays": 80, - "last_watched_at": "2014-12-23T03:22:28.000Z", - "last_updated_at": "2014-12-23T03:22:28.000Z", - "reset_at": null, - "show": { - "title": "True Blood", - "year": 2008, - "ids": { - "trakt": 10494, - "slug": "true-blood", - "tvdb": 82283, - "imdb": "tt0844441", - "tmdb": 10545, - "tvrage": 12662 - } - } - }, - { - "plays": 76, - "last_watched_at": "2014-11-26T02:48:26.000Z", - "last_updated_at": "2014-11-26T02:48:26.000Z", - "reset_at": null, - "show": { - "title": "Flashpoint", - "year": 2008, - "ids": { - "trakt": 5792, - "slug": "flashpoint", - "tvdb": 82438, - "imdb": "tt1059475", - "tmdb": 5829, - "tvrage": 18531 - } - } - }, - { - "plays": 65, - "last_watched_at": "2014-09-15T03:46:35.000Z", - "last_updated_at": "2014-09-15T03:46:35.000Z", - "reset_at": null, - "show": { - "title": "Veronica Mars", - "year": 2004, - "ids": { - "trakt": 1423, - "slug": "veronica-mars", - "tvdb": 73730, - "imdb": "tt0412253", - "tmdb": 1432, - "tvrage": null - } - } - }, - { - "plays": 205, - "last_watched_at": "2014-09-08T01:52:50.000Z", - "last_updated_at": "2014-09-08T01:52:50.000Z", - "reset_at": null, - "show": { - "title": "24", - "year": 2001, - "ids": { - "trakt": 1960, - "slug": "24", - "tvdb": 76290, - "imdb": "tt0285331", - "tmdb": 1973, - "tvrage": 2445 - } - } - }, - { - "plays": 85, - "last_watched_at": "2014-09-08T01:49:19.000Z", - "last_updated_at": "2014-09-08T01:49:19.000Z", - "reset_at": null, - "show": { - "title": "Californication", - "year": 2007, - "ids": { - "trakt": 1209, - "slug": "californication", - "tvdb": 80349, - "imdb": "tt0904208", - "tmdb": 1215, - "tvrage": 15319 - } - } - }, - { - "plays": 9, - "last_watched_at": "2014-07-20T01:26:58.000Z", - "last_updated_at": "2014-07-20T01:26:58.000Z", - "reset_at": null, - "show": { - "title": "In the Flesh", - "year": 2013, - "ids": { - "trakt": 46471, - "slug": "in-the-flesh", - "tvdb": 261742, - "imdb": "tt2480514", - "tmdb": 46746, - "tvrage": null - } - } - }, - { - "plays": 43, - "last_watched_at": "2014-05-24T01:27:03.000Z", - "last_updated_at": "2015-01-28T07:17:09.000Z", - "reset_at": null, - "show": { - "title": "Revolution", - "year": 2012, - "ids": { - "trakt": 1401, - "slug": "revolution", - "tvdb": 258823, - "imdb": "tt2070791", - "tmdb": 1410, - "tvrage": 30897 - } - } - }, - { - "plays": 22, - "last_watched_at": "2014-05-08T03:30:26.000Z", - "last_updated_at": "2014-05-08T03:30:26.000Z", - "reset_at": null, - "show": { - "title": "The Tomorrow People (US)", - "year": 2013, - "ids": { - "trakt": 48556, - "slug": "the-tomorrow-people-us", - "tvdb": 268591, - "imdb": "tt2660734", - "tmdb": 48860, - "tvrage": null - } - } - }, - { - "plays": 13, - "last_watched_at": "2014-03-09T09:20:30.000Z", - "last_updated_at": "2014-03-09T09:20:30.000Z", - "reset_at": null, - "show": { - "title": "Almost Human", - "year": 2013, - "ids": { - "trakt": 50696, - "slug": "almost-human", - "tvdb": 267702, - "imdb": "tt2654580", - "tmdb": 51019, - "tvrage": null - } - } - }, - { - "plays": 44, - "last_watched_at": "2014-03-02T21:56:44.000Z", - "last_updated_at": "2014-03-02T21:56:44.000Z", - "reset_at": null, - "show": { - "title": "Workaholics", - "year": 2011, - "ids": { - "trakt": 36837, - "slug": "workaholics", - "tvdb": 211751, - "imdb": "tt1610527", - "tmdb": 36994, - "tvrage": 23658 - } - } - }, - { - "plays": 10, - "last_watched_at": "2014-01-26T01:38:11.000Z", - "last_updated_at": "2014-01-26T01:38:11.000Z", - "reset_at": null, - "show": { - "title": "Dracula", - "year": 2013, - "ids": { - "trakt": 58540, - "slug": "dracula", - "tvdb": 263724, - "imdb": "tt2296682", - "tmdb": 58928, - "tvrage": 32370 - } - } - }, - { - "plays": 178, - "last_watched_at": "2014-01-24T02:24:05.000Z", - "last_updated_at": "2017-02-12T17:15:20.000Z", - "reset_at": null, - "show": { - "title": "House", - "year": 2004, - "ids": { - "trakt": 1399, - "slug": "house", - "tvdb": 73255, - "imdb": "tt0412142", - "tmdb": 1408, - "tvrage": 3908 - } - } - }, - { - "plays": 15, - "last_watched_at": "2014-01-13T04:42:09.000Z", - "last_updated_at": "2014-01-13T04:42:09.000Z", - "reset_at": null, - "show": { - "title": "Hostages", - "year": 2013, - "ids": { - "trakt": 54738, - "slug": "hostages", - "tvdb": 269642, - "imdb": "tt2647258", - "tmdb": 55083, - "tvrage": 33027 - } - } - }, - { - "plays": 73, - "last_watched_at": "2014-01-09T05:52:37.000Z", - "last_updated_at": "2014-01-09T05:52:37.000Z", - "reset_at": null, - "show": { - "title": "Nikita", - "year": 2010, - "ids": { - "trakt": 32726, - "slug": "nikita", - "tvdb": 164301, - "imdb": "tt1592154", - "tmdb": 32868, - "tvrage": null - } - } - }, - { - "plays": 6, - "last_watched_at": "2013-12-30T07:41:37.000Z", - "last_updated_at": "2013-12-30T07:41:37.000Z", - "reset_at": null, - "show": { - "title": "Mob City", - "year": 2013, - "ids": { - "trakt": 44592, - "slug": "mob-city", - "tvdb": 259632, - "imdb": "tt2176609", - "tmdb": 44840, - "tvrage": null - } - } - }, - { - "plays": 39, - "last_watched_at": "2013-12-30T06:56:22.000Z", - "last_updated_at": "2013-12-30T06:56:22.000Z", - "reset_at": null, - "show": { - "title": "Blue Mountain State", - "year": 2010, - "ids": { - "trakt": 31801, - "slug": "blue-mountain-state", - "tvdb": 134511, - "imdb": "tt1344204", - "tmdb": 31941, - "tvrage": 22667 - } - } - }, - { - "plays": 11, - "last_watched_at": "2013-12-25T17:57:49.000Z", - "last_updated_at": "2013-12-25T17:57:49.000Z", - "reset_at": null, - "show": { - "title": "Terra Nova", - "year": 2011, - "ids": { - "trakt": 32613, - "slug": "terra-nova", - "tvdb": 164091, - "imdb": "tt1641349", - "tmdb": 32754, - "tvrage": 25729 - } - } - }, - { - "plays": 8, - "last_watched_at": "2013-12-25T17:56:38.000Z", - "last_updated_at": "2013-12-25T17:56:38.000Z", - "reset_at": null, - "show": { - "title": "The River", - "year": 2012, - "ids": { - "trakt": 39171, - "slug": "the-river-2012", - "tvdb": 248836, - "imdb": "tt1836195", - "tmdb": 39336, - "tvrage": null - } - } - }, - { - "plays": 118, - "last_watched_at": "2013-12-25T17:55:13.000Z", - "last_updated_at": "2013-12-25T17:55:13.000Z", - "reset_at": null, - "show": { - "title": "Numb3rs", - "year": 2005, - "ids": { - "trakt": 577, - "slug": "numb3rs", - "tvdb": 73918, - "imdb": "tt0433309", - "tmdb": 578, - "tvrage": 4696 - } - } - }, - { - "plays": 120, - "last_watched_at": "2013-12-25T17:52:31.000Z", - "last_updated_at": "2013-12-25T17:52:31.000Z", - "reset_at": null, - "show": { - "title": "Lost", - "year": 2004, - "ids": { - "trakt": 4583, - "slug": "lost-2004", - "tvdb": 73739, - "imdb": "tt0411008", - "tmdb": 4607, - "tvrage": 4284 - } - } - }, - { - "plays": 24, - "last_watched_at": "2013-12-25T17:52:13.000Z", - "last_updated_at": "2013-12-25T17:52:13.000Z", - "reset_at": null, - "show": { - "title": "The IT Crowd", - "year": 2006, - "ids": { - "trakt": 2475, - "slug": "the-it-crowd", - "tvdb": 79216, - "imdb": "tt0487831", - "tmdb": 2490, - "tvrage": 8044 - } - } - }, - { - "plays": 48, - "last_watched_at": "2013-12-25T17:52:04.000Z", - "last_updated_at": "2013-12-25T17:52:04.000Z", - "reset_at": null, - "show": { - "title": "Lie to Me", - "year": 2009, - "ids": { - "trakt": 8312, - "slug": "lie-to-me", - "tvdb": 83602, - "imdb": "tt1235099", - "tmdb": 8358, - "tvrage": null - } - } - }, - { - "plays": 13, - "last_watched_at": "2013-12-25T17:51:46.000Z", - "last_updated_at": "2013-12-25T17:51:46.000Z", - "reset_at": null, - "show": { - "title": "Last Resort", - "year": 2012, - "ids": { - "trakt": 44404, - "slug": "last-resort", - "tvdb": 255413, - "imdb": "tt2172103", - "tmdb": 44652, - "tvrage": null - } - } - }, - { - "plays": 78, - "last_watched_at": "2013-12-25T17:48:27.000Z", - "last_updated_at": "2013-12-25T17:48:27.000Z", - "reset_at": null, - "show": { - "title": "Heroes", - "year": 2006, - "ids": { - "trakt": 1628, - "slug": "heroes", - "tvdb": 79501, - "imdb": "tt0813715", - "tmdb": 1639, - "tvrage": 8172 - } - } - }, - { - "plays": 100, - "last_watched_at": "2013-12-25T17:47:53.000Z", - "last_updated_at": "2013-12-25T17:47:53.000Z", - "reset_at": null, - "show": { - "title": "Fringe", - "year": 2008, - "ids": { - "trakt": 1693, - "slug": "fringe", - "tvdb": 82066, - "imdb": "tt1119644", - "tmdb": 1705, - "tvrage": 18388 - } - } - }, - { - "plays": 22, - "last_watched_at": "2013-12-25T17:46:42.000Z", - "last_updated_at": "2013-12-25T17:46:42.000Z", - "reset_at": null, - "show": { - "title": "The Event", - "year": 2010, - "ids": { - "trakt": 32589, - "slug": "the-event", - "tvdb": 163531, - "imdb": "tt1582459", - "tmdb": 32730, - "tvrage": null - } - } - }, - { - "plays": 96, - "last_watched_at": "2013-12-25T17:45:48.000Z", - "last_updated_at": "2013-12-25T17:45:48.000Z", - "reset_at": null, - "show": { - "title": "Dexter", - "year": 2006, - "ids": { - "trakt": 1396, - "slug": "dexter", - "tvdb": 79349, - "imdb": "tt0773262", - "tmdb": 1405, - "tvrage": null - } - } - }, - { - "plays": 23, - "last_watched_at": "2013-12-25T17:41:34.000Z", - "last_updated_at": "2013-12-25T17:41:34.000Z", - "reset_at": null, - "show": { - "title": "Breakout Kings", - "year": 2011, - "ids": { - "trakt": 32720, - "slug": "breakout-kings", - "tvdb": 219341, - "imdb": "tt1590961", - "tmdb": 32861, - "tvrage": 24612 - } - } - }, - { - "plays": 62, - "last_watched_at": "2013-12-25T17:41:14.000Z", - "last_updated_at": "2013-12-25T17:41:14.000Z", - "reset_at": null, - "show": { - "title": "Breaking Bad", - "year": 2008, - "ids": { - "trakt": 1388, - "slug": "breaking-bad", - "tvdb": 81189, - "imdb": "tt0903747", - "tmdb": 1396, - "tvrage": 18164 - } - } - }, - { - "plays": 24, - "last_watched_at": "2013-12-25T17:30:59.000Z", - "last_updated_at": "2013-12-25T17:30:59.000Z", - "reset_at": null, - "show": { - "title": "Alphas", - "year": 2011, - "ids": { - "trakt": 39196, - "slug": "alphas", - "tvdb": 210841, - "imdb": "tt1183865", - "tmdb": 39362, - "tvrage": null - } - } - }, - { - "plays": 13, - "last_watched_at": "2013-12-25T17:30:18.000Z", - "last_updated_at": "2013-12-25T17:30:18.000Z", - "reset_at": null, - "show": { - "title": "Alcatraz", - "year": 2012, - "ids": { - "trakt": 35187, - "slug": "alcatraz", - "tvdb": 248646, - "imdb": "tt1728102", - "tmdb": 35339, - "tvrage": null - } - } - }, - { - "plays": 2, - "last_watched_at": "2013-12-25T17:14:21.000Z", - "last_updated_at": "2013-12-25T17:14:21.000Z", - "reset_at": null, - "show": { - "title": "Bonnie & Clyde", - "year": 2013, - "ids": { - "trakt": 71228, - "slug": "bonnie-clyde", - "tvdb": 270110, - "imdb": "tt2707792", - "tmdb": 62829, - "tvrage": 33031 - } - } - }, - { - "plays": 91, - "last_watched_at": "2013-12-25T16:38:24.000Z", - "last_updated_at": "2013-12-25T16:38:24.000Z", - "reset_at": null, - "show": { - "title": "Chuck", - "year": 2007, - "ids": { - "trakt": 1395, - "slug": "chuck", - "tvdb": 80348, - "imdb": "tt0934814", - "tmdb": 1404, - "tvrage": 15614 - } - } } ] diff --git a/CouchTrackerSyncTests/Resources/watchedProgress-Success.json b/CouchTrackerSyncTests/Resources/watchedProgress-Success.json new file mode 100644 index 00000000..604aa702 --- /dev/null +++ b/CouchTrackerSyncTests/Resources/watchedProgress-Success.json @@ -0,0 +1,537 @@ +{ + "aired": 91, + "completed": 78, + "last_watched_at": "2019-07-28T05:38:12.000Z", + "reset_at": null, + "seasons": [ + { + "number": 1, + "aired": 13, + "completed": 13, + "episodes": [ + { + "number": 1, + "completed": true, + "last_watched_at": "2014-07-22T01:09:08.000Z" + }, + { + "number": 2, + "completed": true, + "last_watched_at": "2014-07-28T00:53:02.000Z" + }, + { + "number": 3, + "completed": true, + "last_watched_at": "2014-07-28T01:59:32.000Z" + }, + { + "number": 4, + "completed": true, + "last_watched_at": "2014-07-28T02:52:57.000Z" + }, + { + "number": 5, + "completed": true, + "last_watched_at": "2014-07-28T08:23:51.000Z" + }, + { + "number": 6, + "completed": true, + "last_watched_at": "2014-07-28T09:17:40.000Z" + }, + { + "number": 7, + "completed": true, + "last_watched_at": "2014-07-28T10:14:20.000Z" + }, + { + "number": 8, + "completed": true, + "last_watched_at": "2014-07-30T02:11:29.000Z" + }, + { + "number": 9, + "completed": true, + "last_watched_at": "2014-07-30T22:19:20.000Z" + }, + { + "number": 10, + "completed": true, + "last_watched_at": "2014-07-30T23:15:25.000Z" + }, + { + "number": 11, + "completed": true, + "last_watched_at": "2014-07-31T00:13:04.000Z" + }, + { + "number": 12, + "completed": true, + "last_watched_at": "2014-07-31T01:14:40.000Z" + }, + { + "number": 13, + "completed": true, + "last_watched_at": "2014-07-31T02:16:41.000Z" + } + ] + }, + { + "number": 2, + "aired": 13, + "completed": 13, + "episodes": [ + { + "number": 1, + "completed": true, + "last_watched_at": "2014-07-31T23:10:08.000Z" + }, + { + "number": 2, + "completed": true, + "last_watched_at": "2014-08-01T00:04:48.000Z" + }, + { + "number": 3, + "completed": true, + "last_watched_at": "2014-08-01T01:03:48.000Z" + }, + { + "number": 4, + "completed": true, + "last_watched_at": "2014-08-01T02:59:16.000Z" + }, + { + "number": 5, + "completed": true, + "last_watched_at": "2014-08-01T02:59:31.000Z" + }, + { + "number": 6, + "completed": true, + "last_watched_at": "2014-08-02T01:34:27.000Z" + }, + { + "number": 7, + "completed": true, + "last_watched_at": "2014-08-02T03:26:28.000Z" + }, + { + "number": 8, + "completed": true, + "last_watched_at": "2014-08-02T04:22:58.000Z" + }, + { + "number": 9, + "completed": true, + "last_watched_at": "2014-08-02T05:22:49.000Z" + }, + { + "number": 10, + "completed": true, + "last_watched_at": "2014-08-02T06:24:45.000Z" + }, + { + "number": 11, + "completed": true, + "last_watched_at": "2014-08-02T15:15:51.000Z" + }, + { + "number": 12, + "completed": true, + "last_watched_at": "2014-08-02T16:19:49.000Z" + }, + { + "number": 13, + "completed": true, + "last_watched_at": "2014-08-02T22:18:15.000Z" + } + ] + }, + { + "number": 3, + "aired": 13, + "completed": 13, + "episodes": [ + { + "number": 1, + "completed": true, + "last_watched_at": "2015-06-20T23:00:22.000Z" + }, + { + "number": 2, + "completed": true, + "last_watched_at": "2015-06-21T03:14:28.000Z" + }, + { + "number": 3, + "completed": true, + "last_watched_at": "2015-06-21T03:14:34.000Z" + }, + { + "number": 4, + "completed": true, + "last_watched_at": "2015-06-21T03:14:40.000Z" + }, + { + "number": 5, + "completed": true, + "last_watched_at": "2015-06-21T03:14:47.000Z" + }, + { + "number": 6, + "completed": true, + "last_watched_at": "2015-06-21T17:20:29.000Z" + }, + { + "number": 7, + "completed": true, + "last_watched_at": "2015-06-22T03:38:11.000Z" + }, + { + "number": 8, + "completed": true, + "last_watched_at": "2015-06-22T03:38:12.000Z" + }, + { + "number": 9, + "completed": true, + "last_watched_at": "2015-06-22T03:38:24.000Z" + }, + { + "number": 10, + "completed": true, + "last_watched_at": "2015-06-22T03:39:08.000Z" + }, + { + "number": 11, + "completed": true, + "last_watched_at": "2015-06-22T03:52:20.000Z" + }, + { + "number": 12, + "completed": true, + "last_watched_at": "2015-06-23T02:12:37.000Z" + }, + { + "number": 13, + "completed": true, + "last_watched_at": "2015-06-23T02:13:04.000Z" + } + ] + }, + { + "number": 4, + "aired": 13, + "completed": 13, + "episodes": [ + { + "number": 1, + "completed": true, + "last_watched_at": "2016-07-23T06:57:26.000Z" + }, + { + "number": 2, + "completed": true, + "last_watched_at": "2016-07-23T08:02:06.000Z" + }, + { + "number": 3, + "completed": true, + "last_watched_at": "2016-07-23T18:51:09.000Z" + }, + { + "number": 4, + "completed": true, + "last_watched_at": "2016-07-23T22:33:25.000Z" + }, + { + "number": 5, + "completed": true, + "last_watched_at": "2016-07-23T23:34:07.000Z" + }, + { + "number": 6, + "completed": true, + "last_watched_at": "2016-07-24T00:31:41.000Z" + }, + { + "number": 7, + "completed": true, + "last_watched_at": "2016-07-24T17:46:25.000Z" + }, + { + "number": 8, + "completed": true, + "last_watched_at": "2016-07-24T17:46:26.000Z" + }, + { + "number": 9, + "completed": true, + "last_watched_at": "2016-07-24T17:46:27.000Z" + }, + { + "number": 10, + "completed": true, + "last_watched_at": "2016-07-24T17:46:28.000Z" + }, + { + "number": 11, + "completed": true, + "last_watched_at": "2016-07-24T18:45:52.000Z" + }, + { + "number": 12, + "completed": true, + "last_watched_at": "2016-07-24T19:45:37.000Z" + }, + { + "number": 13, + "completed": true, + "last_watched_at": "2016-07-25T00:13:08.000Z" + } + ] + }, + { + "number": 5, + "aired": 13, + "completed": 13, + "episodes": [ + { + "number": 1, + "completed": true, + "last_watched_at": "2018-02-19T03:20:51.000Z" + }, + { + "number": 2, + "completed": true, + "last_watched_at": "2018-02-20T05:41:16.000Z" + }, + { + "number": 3, + "completed": true, + "last_watched_at": "2018-02-22T05:32:07.000Z" + }, + { + "number": 4, + "completed": true, + "last_watched_at": "2018-02-22T17:34:23.000Z" + }, + { + "number": 5, + "completed": true, + "last_watched_at": "2018-02-23T08:17:30.000Z" + }, + { + "number": 6, + "completed": true, + "last_watched_at": "2018-02-24T07:15:42.000Z" + }, + { + "number": 7, + "completed": true, + "last_watched_at": "2018-02-24T18:33:03.000Z" + }, + { + "number": 8, + "completed": true, + "last_watched_at": "2018-02-25T18:06:59.000Z" + }, + { + "number": 9, + "completed": true, + "last_watched_at": "2018-03-01T02:18:59.000Z" + }, + { + "number": 10, + "completed": true, + "last_watched_at": "2018-03-01T03:25:58.000Z" + }, + { + "number": 11, + "completed": true, + "last_watched_at": "2018-03-01T21:15:47.000Z" + }, + { + "number": 12, + "completed": true, + "last_watched_at": "2018-03-02T01:28:16.000Z" + }, + { + "number": 13, + "completed": true, + "last_watched_at": "2018-03-02T02:57:10.000Z" + } + ] + }, + { + "number": 6, + "aired": 13, + "completed": 13, + "episodes": [ + { + "number": 1, + "completed": true, + "last_watched_at": "2019-07-22T00:37:10.000Z" + }, + { + "number": 2, + "completed": true, + "last_watched_at": "2019-07-22T00:38:57.000Z" + }, + { + "number": 3, + "completed": true, + "last_watched_at": "2019-07-22T11:58:16.000Z" + }, + { + "number": 4, + "completed": true, + "last_watched_at": "2019-07-23T01:36:48.000Z" + }, + { + "number": 5, + "completed": true, + "last_watched_at": "2019-07-24T01:43:53.000Z" + }, + { + "number": 6, + "completed": true, + "last_watched_at": "2019-07-24T01:44:44.000Z" + }, + { + "number": 7, + "completed": true, + "last_watched_at": "2019-07-24T03:07:06.000Z" + }, + { + "number": 8, + "completed": true, + "last_watched_at": "2019-07-27T02:28:58.000Z" + }, + { + "number": 9, + "completed": true, + "last_watched_at": "2019-07-27T03:25:36.000Z" + }, + { + "number": 10, + "completed": true, + "last_watched_at": "2019-07-27T19:35:41.000Z" + }, + { + "number": 11, + "completed": true, + "last_watched_at": "2019-07-28T01:37:27.000Z" + }, + { + "number": 12, + "completed": true, + "last_watched_at": "2019-07-28T02:35:32.000Z" + }, + { + "number": 13, + "completed": true, + "last_watched_at": "2019-07-28T05:38:12.000Z" + } + ] + }, + { + "number": 7, + "aired": 13, + "completed": 0, + "episodes": [ + { + "number": 1, + "completed": false, + "last_watched_at": null + }, + { + "number": 2, + "completed": false, + "last_watched_at": null + }, + { + "number": 3, + "completed": false, + "last_watched_at": null + }, + { + "number": 4, + "completed": false, + "last_watched_at": null + }, + { + "number": 5, + "completed": false, + "last_watched_at": null + }, + { + "number": 6, + "completed": false, + "last_watched_at": null + }, + { + "number": 7, + "completed": false, + "last_watched_at": null + }, + { + "number": 8, + "completed": false, + "last_watched_at": null + }, + { + "number": 9, + "completed": false, + "last_watched_at": null + }, + { + "number": 10, + "completed": false, + "last_watched_at": null + }, + { + "number": 11, + "completed": false, + "last_watched_at": null + }, + { + "number": 12, + "completed": false, + "last_watched_at": null + }, + { + "number": 13, + "completed": false, + "last_watched_at": null + } + ] + } + ], + "hidden_seasons": [], + "next_episode": { + "season": 7, + "number": 1, + "title": "Beginning of the End", + "ids": { + "trakt": 3541694, + "tvdb": 7199938, + "imdb": null, + "tmdb": 1795786, + "tvrage": 0 + } + }, + "last_episode": { + "season": 6, + "number": 13, + "title": "Be Free", + "ids": { + "trakt": 3057460, + "tvdb": 6773297, + "imdb": "tt6360850", + "tmdb": 1531576, + "tvrage": 0 + } + } +} diff --git a/TraktSwift/Models/Base/BaseShow.swift b/TraktSwift/Models/Base/BaseShow.swift index 334077d7..3b38a3fb 100755 --- a/TraktSwift/Models/Base/BaseShow.swift +++ b/TraktSwift/Models/Base/BaseShow.swift @@ -11,6 +11,7 @@ public struct BaseShow: Codable, Hashable { public let completed: Int? public let hiddenSeasons: [Season]? public let nextEpisode: Episode? + public let lastEpisode: Episode? private enum CodingKeys: String, CodingKey { case show, seasons, plays, aired, completed @@ -19,6 +20,31 @@ public struct BaseShow: Codable, Hashable { case lastWatchedAt = "last_watched_at" case hiddenSeasons = "hidden_seasons" case nextEpisode = "next_episode" + case lastEpisode = "last_episode" + } + + public init(show: Show? = nil, + seasons: [BaseSeason]? = nil, + lastCollectedAt: Date? = nil, + listedAt: Date? = nil, + plays: Int? = nil, + lastWatchedAt: Date? = nil, + aired: Int? = nil, + completed: Int? = nil, + hiddenSeasons: [Season]? = nil, + nextEpisode: Episode? = nil, + lastEpisode: Episode? = nil) { + self.show = show + self.seasons = seasons + self.lastCollectedAt = lastCollectedAt + self.listedAt = listedAt + self.plays = plays + self.lastWatchedAt = lastWatchedAt + self.aired = aired + self.completed = completed + self.hiddenSeasons = hiddenSeasons + self.nextEpisode = nextEpisode + self.lastEpisode = lastEpisode } public init(from decoder: Decoder) throws { @@ -31,6 +57,7 @@ public struct BaseShow: Codable, Hashable { completed = try container.decodeIfPresent(Int.self, forKey: .completed) hiddenSeasons = try container.decodeIfPresent([Season].self, forKey: .hiddenSeasons) nextEpisode = try container.decodeIfPresent(Episode.self, forKey: .nextEpisode) + lastEpisode = try container.decodeIfPresent(Episode.self, forKey: .lastEpisode) let lastCollectedAt = try container.decodeIfPresent(String.self, forKey: .lastCollectedAt) let listedAt = try container.decodeIfPresent(String.self, forKey: .listedAt)