From ffbd7849a11c7ef1c39294c8e92686edb6775c71 Mon Sep 17 00:00:00 2001 From: Robert Honz Date: Mon, 20 Oct 2025 08:12:34 +0200 Subject: [PATCH] =?UTF-8?q?fix(download):=20=F0=9F=90=9B=20handle=20missin?= =?UTF-8?q?g=20`st=5Fbirthtime`=20attribute=20in=20track=20sorting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Updated the sorting method for track paths to check for the presence of `st_birthtime`. * If `st_birthtime` is not available, fallback to using `st_ctime` for sorting. --- tidal_dl_ng/download.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tidal_dl_ng/download.py b/tidal_dl_ng/download.py index cf9e260..f6ddf48 100644 --- a/tidal_dl_ng/download.py +++ b/tidal_dl_ng/download.py @@ -1560,7 +1560,9 @@ class Download: path_tracks.sort() elif not is_album: # If it is not an album sort by creation time - path_tracks.sort(key=lambda x: x.stat().st_birthtime) + path_tracks.sort( + key=lambda x: x.stat().st_birthtime if hasattr(x.stat(), "st_birthtime") else x.stat().st_ctime + ) # Write data to m3u file with path_playlist.open(mode="w", encoding="utf-8") as f: