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:
tastytea 2020-12-17 12:37:47 +01:00
parent 2a80fa1ba2
commit 03c8b512ea
1 changed files with 2 additions and 1 deletions

View File

@ -70,11 +70,12 @@ function main()
# [[ ${?} -eq 0 ]] || die 3 "youtube-dl returned an error."
done
local files_after="$(find "${download_dir}" -type f)"
local time="$(date +'%F_%R')"
while read file; do
# https://stackoverflow.com/a/8811800/5965450
if [[ "${files_before#*${file}}" == "${files_before}" ]]; then
echo "${file/${download_dir}\//}" \
>> "${download_dir}/New_$(date +'%F_%R').m3u"
>> "${download_dir}/New_${time}.m3u"
fi
done <<<"${files_after}"