From 03c8b512ea560cb57d7fbf4af42e483582f1c53a Mon Sep 17 00:00:00 2001 From: tastytea Date: Thu, 17 Dec 2020 12:37:47 +0100 Subject: [PATCH] Put time for playlist filename in a variable. The old behaviour could have lead to more than 1 playlist per run. --- download-yt-feeds | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/download-yt-feeds b/download-yt-feeds index 56a5afc..d64e62e 100755 --- a/download-yt-feeds +++ b/download-yt-feeds @@ -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}"