File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -33,14 +33,14 @@ extension PredicateMediaList {
3333 NSCompoundPredicate ( type: . or, subpredicates: [
3434 // We don't include movies that are marked as 'not watched'
3535 NSPredicate (
36- format: " type = %@ AND ( watchedState = nil OR watchedState != %@) " ,
36+ format: " type = %@ AND watchedState != %@ " ,
3737 MediaType . movie. rawValue,
3838 MovieWatchState . notWatched. rawValue
3939 ) ,
4040 // We don't include shows that are marked as explicitly 'not watched'
4141 NSCompoundPredicate ( type: . and, subpredicates: [
4242 NSPredicate ( format: " type = %@ " , MediaType . show. rawValue) ,
43- ShowWatchState . showsNotWatchedPredicate,
43+ ShowWatchState . showsNotWatchedPredicate. negated ( ) ,
4444 ] ) ,
4545 ] ) ,
4646 // If any of these applies, information is missing
Original file line number Diff line number Diff line change @@ -120,3 +120,10 @@ struct LastNameComparator: SortComparator {
120120 return lhsLastName. compare ( rhsLastName)
121121 }
122122}
123+
124+ extension NSPredicate {
125+ /// Returns a negated version of this predicate
126+ func negated( ) -> NSPredicate {
127+ NSCompoundPredicate ( type: . not, subpredicates: [ self ] )
128+ }
129+ }
You can’t perform that action at this time.
0 commit comments