Skip to content

Commit

Permalink
bz19968: fix filter logic for watched folders
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Dean-Kawamura committed Mar 26, 2013
1 parent 0b75111 commit 33699cc
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tv/lib/frontends/widgets/itemfilter.py
Expand Up @@ -220,7 +220,15 @@ class ItemFilterAudio(ItemFilterAudioVideo):
def add_to_query(self, query):
query.add_condition('file_type', '=', 'audio')

class ItemFilterWatchedFolderVideo(ItemFilter):
class ItemFilterWatchedFolderAudioVideo(ItemFilter):
def switch_to_filter(self, previous_filters):
# allow unplayed filter to remain
rv = set((self.key,))
if u'unplayed' in previous_filters:
rv.add(u'unplayed')
return rv

class ItemFilterWatchedFolderVideo(ItemFilterWatchedFolderAudioVideo):
"""Filter for video items in watch folders.
This works like the Video filter, but it doesn't automatically select
Expand All @@ -232,7 +240,7 @@ class ItemFilterWatchedFolderVideo(ItemFilter):
def add_to_query(self, query):
query.add_condition('file_type', '=', 'video')

class ItemFilterWatchedFolderAudio(ItemFilter):
class ItemFilterWatchedFolderAudio(ItemFilterWatchedFolderAudioVideo):
"""Filter for audio items in watch folders.
This works like the Audio filter, but it doesn't automatically select
Expand Down

0 comments on commit 33699cc

Please sign in to comment.