summaryrefslogtreecommitdiff
path: root/tidal_dl_ng
diff options
context:
space:
mode:
authorRobert Honz <exislow+github@gmail.com>2025-10-20 08:06:25 +0200
committerRobert Honz <exislow+github@gmail.com>2025-10-20 08:06:25 +0200
commit2b932e84b4cdb9f9c09635f23b4914e860d185b6 (patch)
tree7a9858eeca3c907a3d3014773f23e69a6c6cdbf5 /tidal_dl_ng
parent61cc05788bcb0ececd9e5adc38af7868c36e5c99 (diff)
downloadtidal-dl-ng-2b932e84b4cdb9f9c09635f23b4914e860d185b6.tar.gz
fix(download): 🐛 update sorting method for track paths
* 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.
Diffstat (limited to 'tidal_dl_ng')
-rw-r--r--tidal_dl_ng/download.py2
1 files changed, 1 insertions, 1 deletions
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: