chore: add a tool for finding Music tracks whose files have gone
Build and publish container / build (pull_request) Successful in 3m8s
Build and publish container / build (pull_request) Successful in 3m8s
Lidarr renames an artist or album folder, music-mirror prunes the old path and encodes the new one, and every entry in Apple Music pointing at the old path dies. Music offers no view of those, and the exclamation mark only appears once a track is touched. Reads the XML from Music's own Export Library rather than asking Music itself. A broken track makes AppleScript's `location` raise instead of returning a value, so a bulk query dies on the first one with error -1728 and a per-track loop costs an Apple event apiece. Checked against a single directory walk rather than a test per file. On a fifty-thousand-track library that is around seven thousand directory reads instead of fifty thousand stat calls, and over SMB each of those stats is a network round trip -- which is the difference between seconds and minutes. Two comparisons have to be loosened or most of the library reads as missing. macOS stores filenames decomposed while the share composes them, so the umlauts in Motley Crue are two different byte strings depending on which side wrote the name; both are normalised to NFC. And the share is very likely case-insensitive, so a file is not missing because someone capitalised it differently. The test stage now copies tools/ as well, since the suite covers this and the runtime image deliberately does not carry it.
This commit is contained in:
@@ -28,5 +28,8 @@ FROM runtime AS test
|
||||
|
||||
RUN pip install --no-cache-dir pytest
|
||||
COPY pytest.ini ./
|
||||
# The host-side tools are not part of the runtime image, but their tests are
|
||||
# part of the suite, so they have to be present for it.
|
||||
COPY tools ./tools
|
||||
COPY tests ./tests
|
||||
RUN python -m pytest
|
||||
|
||||
Reference in New Issue
Block a user