From 353a4cc8b69cdbf3a7a9357114e4edb3cd516121 Mon Sep 17 00:00:00 2001 From: auouymous Date: Sat, 4 Mar 2023 19:26:36 -0700 Subject: [PATCH] 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)`. --- src/gpodder/query.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gpodder/query.py b/src/gpodder/query.py index 8ebbb1f8..9144ba34 100644 --- a/src/gpodder/query.py +++ b/src/gpodder/query.py @@ -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'):