Skip to content

Commit

Permalink
Allowing agent to send back watched/unwatched sessions which have no …
Browse files Browse the repository at this point in the history
…video yet
  • Loading branch information
insidegui committed Jun 7, 2021
1 parent 01aaa40 commit 5ed6d35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions WWDCAgent/WWDCAgentService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand All @@ -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))

Expand Down

0 comments on commit 5ed6d35

Please sign in to comment.