From fec187994b3ffe5825b5f06852e05c7d0139c331 Mon Sep 17 00:00:00 2001 From: Ritiek Malhotra Date: Mon, 18 May 2020 03:56:10 +0530 Subject: [PATCH] Bugfix: writing to STDOUT would do opposite --- Dockerfile | 2 +- spotdl/helpers/spotify.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2f648a7..6ff5b57 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,4 +13,4 @@ RUN pip install . RUN mkdir /music WORKDIR /music -ENTRYPOINT ["spotdl", "-f", "/music"] +ENTRYPOINT ["spotdl"] diff --git a/spotdl/helpers/spotify.py b/spotdl/helpers/spotify.py index ab3ea38..9695a39 100644 --- a/spotdl/helpers/spotify.py +++ b/spotdl/helpers/spotify.py @@ -156,10 +156,10 @@ class SpotifyHelpers: logger.info(u"Writing {0} tracks to {1}.".format(tracks["total"], target_file)) write_to_stdout = target_file == "-" if write_to_stdout: - with open(target_file, "a") as file_out: - track_urls = writer(tracks, file_out) - else: file_out = sys.stdout track_urls = writer(tracks, file_out) + else: + with open(target_file, "a") as file_out: + track_urls = writer(tracks, file_out) return track_urls