diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2018-04-06 14:36:19 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2018-04-06 14:36:19 +0200 |
commit | 6d4bee5d17d4ffbfde73eb7d493b39c9a741637b (patch) | |
tree | afaa659356c8a7bd260a0b025a124907e7f74561 /odin | |
parent | 2e13c35e55cace64537d41c4b202f9abf163387e (diff) | |
download | nixos-6d4bee5d17d4ffbfde73eb7d493b39c9a741637b.tar nixos-6d4bee5d17d4ffbfde73eb7d493b39c9a741637b.tar.gz nixos-6d4bee5d17d4ffbfde73eb7d493b39c9a741637b.tar.bz2 nixos-6d4bee5d17d4ffbfde73eb7d493b39c9a741637b.tar.xz nixos-6d4bee5d17d4ffbfde73eb7d493b39c9a741637b.zip |
cache_media
Diffstat (limited to 'odin')
-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 | ||