From 8b746cec9ce86f461fdbf0b04012887ff66680be Mon Sep 17 00:00:00 2001 From: Jamie Gravendeel Date: Fri, 8 Aug 2025 11:30:42 +0200 Subject: [PATCH] Sort audiobook chapter files based on disk number (#2302) Fixes https://github.com/music-assistant/support/issues/3905 --- music_assistant/providers/filesystem_local/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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( -- 2.34.1