-
Notifications
You must be signed in to change notification settings - Fork 361
Fix work images and artwork precaching #1517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
michaelherger
merged 2 commits into
LMS-Community:public/9.2
from
darrell-k:fix-work-images
Feb 26, 2026
+6
−2
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This prioritisation of external images would only work if the hash didn't happen to be an all numerical value, right? Is it worth the casting overhead? Did you measure the overhead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In more detail: the double cast converts the column's value to numeric and then back to text. we then compare it to the original value and if they're equal, we know that the original value was an integer, ie the size of the embedded artwork rather than a path to the external image.
This is then enclosed in a CASE statement so as to return 1 if the artwork is embedded and 0 if it is external.
The whole thing is used as the first sort key so that an external image will always take priority over an embedded image.
The existing code just uses the first track's image even if it was embedded and there is also an album-level image in the album's folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry, I only saw your initial description after I posted... and then edited my comment to be more specific. And now I see that I confused
coverandcoverid...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run a quick test listing tracks using those orders on my Pi4, with about 22k tracks. Overhead is negligible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's good. What do you say about further work to bring Slim::Music::Artwork::updateStandaloneArtwork and Slim::Music::Artwork::precacheAllArtwork into line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Align how the two work? I'm all for that. But this PR started as a fix, which I believe should even go into 9.1. Further alignment might be beyond a
stablescope. What do you think?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might do and definitely this fix should go into 9.1. Leave it with me for now.
I'm actually having ideas about #1513 now I have studied Slim::Music::Artwork. I think that PR can be simplified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, shall we merge this one, and back port in a few if good?
And yes, #1513 needs some cleanup IMHO. There were some no-op changes and probably cruft left behind by the AI assistant forgetting what it had done before...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me check whether the
sth_get_album_artprocessing needs adding toSlim::Music::Artwork::updateStandaloneArtwork. I'm wondering if it needs to be for a album rescan.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michaelherger Let's go with this as it is.