diff options
| author | Robert Honz <exislow+github@gmail.com> | 2025-10-20 08:12:34 +0200 |
|---|---|---|
| committer | Robert Honz <exislow+github@gmail.com> | 2025-10-20 08:12:34 +0200 |
| commit | ffbd7849a11c7ef1c39294c8e92686edb6775c71 (patch) | |
| tree | ea8cec482bc1f1d26ce340a2b7fb261167aab9cb /tidal_dl_ng | |
| parent | a4c36ff6f502aff1dad72bbdce755502aa400f79 (diff) | |
| download | tidal-dl-ng-ffbd7849a11c7ef1c39294c8e92686edb6775c71.tar.gz | |
fix(download): 🐛 handle missing `st_birthtime` attribute in track sorting
* 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.
Diffstat (limited to 'tidal_dl_ng')
| -rw-r--r-- | tidal_dl_ng/download.py | 4 |
1 files changed, 3 insertions, 1 deletions
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: |
