From 2b932e84b4cdb9f9c09635f23b4914e860d185b6 Mon Sep 17 00:00:00 2001 From: Robert Honz Date: Mon, 20 Oct 2025 08:06:25 +0200 Subject: [PATCH] =?UTF-8?q?fix(download):=20=F0=9F=90=9B=20update=20sortin?= =?UTF-8?q?g=20method=20for=20track=20paths?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Changed sorting method from `os.path.getctime` to `x.stat().st_birthtime` for better accuracy in track creation time. * This improves the reliability of track order when not dealing with albums. --- tidal_dl_ng/download.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tidal_dl_ng/download.py b/tidal_dl_ng/download.py index 4ac2b14..cf9e260 100644 --- a/tidal_dl_ng/download.py +++ b/tidal_dl_ng/download.py @@ -1560,7 +1560,7 @@ 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: os.path.getctime(x)) + path_tracks.sort(key=lambda x: x.stat().st_birthtime) # Write data to m3u file with path_playlist.open(mode="w", encoding="utf-8") as f: