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.
This commit is contained in:
@@ -1560,7 +1560,7 @@ class Download:
|
|||||||
path_tracks.sort()
|
path_tracks.sort()
|
||||||
elif not is_album:
|
elif not is_album:
|
||||||
# If it is not an album sort by creation time
|
# 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
|
# Write data to m3u file
|
||||||
with path_playlist.open(mode="w", encoding="utf-8") as f:
|
with path_playlist.open(mode="w", encoding="utf-8") as f:
|
||||||
|
|||||||
Reference in New Issue
Block a user