mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-23 05:26:37 +00:00
Use Django setting to restrict find locations
This commit is contained in:
parent
993fdc2503
commit
2bf4af7920
@ -3,14 +3,29 @@
|
|||||||
playlist_id="${1}"
|
playlist_id="${1}"
|
||||||
total_entries="${2}"
|
total_entries="${2}"
|
||||||
|
|
||||||
downloaded_entries="$( find / \
|
# select YOUTUBE_*DIR settings
|
||||||
|
# convert None to ''
|
||||||
|
# convert PosixPath('VALUE') to 'VALUE'
|
||||||
|
# assign a shell variable with the setting name and value
|
||||||
|
_awk_prog='$2 == "=" && $1 ~ /^YOUTUBE_/ && $1 ~ /DIR$/ {
|
||||||
|
sub(/^None$/, "'\'\''", $3);
|
||||||
|
r = sub(/^PosixPath[(]/, "", $3);
|
||||||
|
NF--;
|
||||||
|
if(r) {sub(/[)]$/, "", $NF);};
|
||||||
|
$3=$1 $2 $3; $1=$2=""; sub("^" OFS "+", "");
|
||||||
|
print;
|
||||||
|
}'
|
||||||
|
. <(python3 /app/manage.py diffsettings --output hash | awk "${_awk_prog}")
|
||||||
|
WHERE="${YOUTUBE_DL_CACHEDIR:-/dev/shm}"
|
||||||
|
|
||||||
|
downloaded_entries="$( find /dev/shm "${WHERE}" \
|
||||||
-path '*/infojson/playlist/postprocessor_*_temp\.info\.json' \
|
-path '*/infojson/playlist/postprocessor_*_temp\.info\.json' \
|
||||||
-name "postprocessor_[[]${playlist_id}[]]_*_${total_entries}_temp\.info\.json" \
|
-name "postprocessor_[[]${playlist_id}[]]_*_${total_entries}_temp\.info\.json" \
|
||||||
-exec basename '{}' ';' | \
|
-exec basename '{}' ';' | \
|
||||||
sed -e 's/^postprocessor_[[].*[]]_//;s/_temp.*\.json$//;' | \
|
sed -e 's/^postprocessor_[[].*[]]_//;s/_temp.*\.json$//;' | \
|
||||||
cut -d '_' -f 1 )"
|
cut -d '_' -f 1 )"
|
||||||
|
|
||||||
find / \
|
find /dev/shm "${WHERE}" \
|
||||||
-path '*/infojson/playlist/postprocessor_*_temp\.info\.json' \
|
-path '*/infojson/playlist/postprocessor_*_temp\.info\.json' \
|
||||||
-name "postprocessor_[[]${playlist_id}[]]_*_temp\.info\.json" \
|
-name "postprocessor_[[]${playlist_id}[]]_*_temp\.info\.json" \
|
||||||
-type f -delete
|
-type f -delete
|
||||||
|
Loading…
Reference in New Issue
Block a user