Add EQL adjectives 'failed' and 'paused'.

Allowing all failed downloads to be filtered with `(failed)`, all paused
episodes with `(paused)`, and all downloading episodes, excluding paused
episodes with `(downloading and not paused)`.
This commit is contained in:
auouymous 2023-03-04 19:26:36 -07:00
parent 8d31d9dd40
commit 353a4cc8b6
1 changed files with 5 additions and 0 deletions

View File

@ -101,6 +101,11 @@ class Matcher(object):
return episode.file_type() == k
elif k == 'torrent':
return episode.url.endswith('.torrent') or 'torrent' in episode.mime_type
elif k == 'paused':
return (episode.download_task is not None
and episode.download_task.status in (episode.download_task.PAUSED, episode.download_task.PAUSING))
elif k == 'failed':
return (episode.download_task is not None and episode.download_task.status == episode.download_task.FAILED)
# Nouns (for comparisons)
if k in ('megabytes', 'mb'):