diff options
| author | Robert Honz <exislow+github@gmail.com> | 2025-10-20 08:06:25 +0200 |
|---|---|---|
| committer | Robert Honz <exislow+github@gmail.com> | 2025-10-20 08:06:25 +0200 |
| commit | 2b932e84b4cdb9f9c09635f23b4914e860d185b6 (patch) | |
| tree | 7a9858eeca3c907a3d3014773f23e69a6c6cdbf5 | |
| parent | 61cc05788bcb0ececd9e5adc38af7868c36e5c99 (diff) | |
| download | tidal-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.
| -rw-r--r-- | tidal_dl_ng/download.py | 2 |
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: |
