From: Jamie Gravendeel Date: Fri, 8 Aug 2025 09:30:42 +0000 (+0200) Subject: Sort audiobook chapter files based on disk number (#2302) X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=8b746cec9ce86f461fdbf0b04012887ff66680be;p=music-assistant-server.git Sort audiobook chapter files based on disk number (#2302) Fixes https://github.com/music-assistant/support/issues/3905 --- diff --git a/music_assistant/providers/filesystem_local/__init__.py b/music_assistant/providers/filesystem_local/__init__.py index c75d3a1f..222b3f73 100644 --- a/music_assistant/providers/filesystem_local/__init__.py +++ b/music_assistant/providers/filesystem_local/__init__.py @@ -1708,7 +1708,7 @@ class LocalFileSystemProvider(MusicProvider): if item_tags.track is None: continue chapter_file_tags.append(item_tags) - chapter_file_tags.sort(key=lambda x: x.track or 0) + chapter_file_tags.sort(key=lambda x: (x.disc or 0, x.track or 0)) for chapter_tags in chapter_file_tags: assert chapter_tags.duration is not None chapters.append(