... | ... |
@@ -20,7 +20,7 @@ sql_request () { |
20 | 20 |
} |
21 | 21 |
|
22 | 22 |
covered () { |
23 |
- case "$1" in |
|
23 |
+ case "${forcing_level:-none}" in |
|
24 | 24 |
retry) |
25 | 25 |
if compgen -G "${album#*:}/$no_cover_flag" > /dev/null; then |
26 | 26 |
rm -f "${album#*:}/$no_cover_flag" 2>/dev/null |
... | ... |
@@ -32,7 +32,7 @@ covered () { |
32 | 32 |
force) |
33 | 33 |
return 1 |
34 | 34 |
;; |
35 |
- empty) |
|
35 |
+ none) |
|
36 | 36 |
compgen -G "${album#*:}/$cover_img.*" > /dev/null \ |
37 | 37 |
|| compgen -G "${album#*:}/$no_cover_flag" > /dev/null |
38 | 38 |
;; |
... | ... |
@@ -75,7 +75,9 @@ IFS=$'\n' |
75 | 75 |
for arg in $@; do |
76 | 76 |
if [[ $arg =~ ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}:/ ]]; then |
77 | 77 |
albums[${#albums[@]}]=$arg |
78 |
- elif ! [[ $arg =~ ^(force|retry)$ ]]; then |
|
78 |
+ elif [[ $arg =~ ^(force|retry)$ ]]; then |
|
79 |
+ forcing_level=$arg |
|
80 |
+ else |
|
79 | 81 |
WARNING "incohérence sur $arg" |
80 | 82 |
fi |
81 | 83 |
done |
... | ... |
@@ -92,7 +94,7 @@ for album in ${albums[@]}; do |
92 | 94 |
WARNING "${album#*:}: chemin inconnu" |
93 | 95 |
continue |
94 | 96 |
fi |
95 |
- if ! covered ${1:-empty}; then |
|
97 |
+ if ! covered; then |
|
96 | 98 |
echo -n "${album#*:} " |
97 | 99 |
curl -Ls $coverartarchive_api/${album%%:*} > $coverart |
98 | 100 |
if test $(file -bn --mime-type $coverart) = application/json; then |