From 49590dcc6c396c9e648001b78d99cc2abfe62c35 Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Sat, 25 Sep 2021 19:26:37 +0100 Subject: [PATCH] Fix a failed download leaving temp file. --- helpers/myradio_api.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/helpers/myradio_api.py b/helpers/myradio_api.py index 0573ba1..f7bc5d0 100644 --- a/helpers/myradio_api.py +++ b/helpers/myradio_api.py @@ -276,6 +276,8 @@ class MyRadioAPI: request = await self.async_api_call(url, api_version="non") if not request or not isinstance(request, (bytes, bytearray)): + # Remove the .downloading temp file given we gave up trying to download. + os.remove(filename + dl_suffix) return (None, False) if did_download else None try: