From 5ed6d35f9dbe3ed95deb71d08b97489d8f41b079 Mon Sep 17 00:00:00 2001 From: Gui Rambo Date: Mon, 7 Jun 2021 20:07:37 -0300 Subject: [PATCH] Allowing agent to send back watched/unwatched sessions which have no video yet --- WWDCAgent/WWDCAgentService.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WWDCAgent/WWDCAgentService.swift b/WWDCAgent/WWDCAgentService.swift index fff6ce06..e1495953 100644 --- a/WWDCAgent/WWDCAgentService.swift +++ b/WWDCAgent/WWDCAgentService.swift @@ -174,7 +174,7 @@ extension WWDCAgentService: WWDCAgentInterface { func fetchWatchedSessions(for event: String?, completion: @escaping ([String]) -> Void) { os_log("%{public}@", log: log, type: .debug, #function) - let predicate = NSPredicate(format: "(SUBQUERY(progresses, $progress, $progress.relativePosition >= \(Constants.watchedVideoRelativePosition)).@count > 0) AND ANY assets.rawAssetType == \"WWDCSessionAssetTypeStreamingVideo\"") + let predicate = NSPredicate(format: "(SUBQUERY(progresses, $progress, $progress.relativePosition >= \(Constants.watchedVideoRelativePosition)).@count > 0)") let sessionIdentifiers = fetchSessionIdentifiers(for: andPredicateWithOptionalEventId(event, predicate)) @@ -184,7 +184,7 @@ extension WWDCAgentService: WWDCAgentInterface { func fetchUnwatchedSessions(for event: String?, completion: @escaping ([String]) -> Void) { os_log("%{public}@", log: log, type: .debug, #function) - let predicate = NSPredicate(format: "(SUBQUERY(progresses, $progress, $progress.relativePosition < \(Constants.watchedVideoRelativePosition)).@count > 0 OR progresses.@count == 0) AND ANY assets.rawAssetType == \"WWDCSessionAssetTypeStreamingVideo\"") + let predicate = NSPredicate(format: "(SUBQUERY(progresses, $progress, $progress.relativePosition < \(Constants.watchedVideoRelativePosition)).@count > 0 OR progresses.@count == 0)") let sessionIdentifiers = fetchSessionIdentifiers(for: andPredicateWithOptionalEventId(event, predicate))