diff options
Diffstat (limited to 'odin/strm/cache_media')
-rw-r--r-- | odin/strm/cache_media | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/odin/strm/cache_media b/odin/strm/cache_media index 68938799..8c345489 100644 --- a/odin/strm/cache_media +++ b/odin/strm/cache_media | |||
@@ -22,5 +22,15 @@ function notmuch { | |||
22 | done | 22 | done |
23 | } | 23 | } |
24 | 24 | ||
25 | exec -- nice -n 5 -- ionice -n 5 -- xargs -d '\n' -n 1 -r -P 1 -- download_youtube \ | 25 | while { |
26 | <<<$(notmuch search --sort=oldest-first --output=messages --format=text "( tag:inbox AND is:media AND is:unread ) AND NOT ( tag:new OR tag:killed OR tag:failed OR tag:cached )") \ | 26 | results=$(notmuch search --sort=oldest-first --output=messages "( tag:inbox AND is:media AND is:unread ) AND NOT ( tag:new OR tag:killed OR tag:failed OR tag:cached )") |
27 | ids=("${(f)results}") | ||
28 | for i in $checkedIds; do | ||
29 | ids=(${ids#$i}) | ||
30 | done | ||
31 | checkedIds=($checkedIds $ids) | ||
32 | } && [[ -n "${ids}" ]]; do | ||
33 | url="" | ||
34 | |||
35 | xargs -d '\n' -n 1 -r -P 1 -- download_youtube <<<$(print -l ${ids}) | ||
36 | done | ||