Put time for playlist filename in a variable.
The old behaviour could have lead to more than 1 playlist per run.
This commit is contained in:
parent
2a80fa1ba2
commit
03c8b512ea
|
@ -70,11 +70,12 @@ function main()
|
||||||
# [[ ${?} -eq 0 ]] || die 3 "youtube-dl returned an error."
|
# [[ ${?} -eq 0 ]] || die 3 "youtube-dl returned an error."
|
||||||
done
|
done
|
||||||
local files_after="$(find "${download_dir}" -type f)"
|
local files_after="$(find "${download_dir}" -type f)"
|
||||||
|
local time="$(date +'%F_%R')"
|
||||||
while read file; do
|
while read file; do
|
||||||
# https://stackoverflow.com/a/8811800/5965450
|
# https://stackoverflow.com/a/8811800/5965450
|
||||||
if [[ "${files_before#*${file}}" == "${files_before}" ]]; then
|
if [[ "${files_before#*${file}}" == "${files_before}" ]]; then
|
||||||
echo "${file/${download_dir}\//}" \
|
echo "${file/${download_dir}\//}" \
|
||||||
>> "${download_dir}/New_$(date +'%F_%R').m3u"
|
>> "${download_dir}/New_${time}.m3u"
|
||||||
fi
|
fi
|
||||||
done <<<"${files_after}"
|
done <<<"${files_after}"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue