The chapter order on the tonie is already fully API-controlled via
SortChaptersOfTonie/PATCH. This adds an explicit way to define that
order via an .m3u/.m3u8 file placed in the tonie folder, instead of
relying on alphabetical filenames:
- internal/syncer/playlist.go: finds a single playlist file in the
tonie folder, parses its entries (ignoring blanks/#-comments), and
reorders local tracks accordingly. Tracks not referenced by the
playlist are appended afterwards so nothing is silently dropped;
playlist entries without a matching local file are ignored.
Multiple playlist files in the same folder is an error (ambiguous
order).
- ListLocalTracks now prefers this playlist-defined order, falling
back to alphabetical filename order when no playlist is present.
- Tests covering playlist ordering, unreferenced-track handling,
missing entries, and the multiple-playlists error case.
- README documents the .m3u/.m3u8 convention.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>