Skip to content

Conversation

@avedor
Copy link
Contributor

@avedor avedor commented May 4, 2025

Simplifies search of media in Jellyfin library by looking for clean track title. Adds recursive parameter, the lack of which seemed to be causing Explo to fail to find tracks (just found the artists)

Potentially addresses #14

Copy link
Owner

@LumePart LumePart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RefreshLibrary() (line 123) would need an extra parameter to the reqParam variable to refresh metadata:
reqParam := fmt.Sprintf("/Items/%s/Refresh?metadataRefreshMode=FullRefresh", c.LibraryID)
Currently it just searches for new files and doesn't add metadata so item.AlbumArtist can't be used to reliably search for songs

Run full metadata refresh
@avedor avedor force-pushed the feat/update-jellyfin-search branch from b5931b4 to 6aef4f4 Compare May 5, 2025 23:06
@avedor avedor requested a review from LumePart May 5, 2025 23:06
@avedor
Copy link
Contributor Author

avedor commented May 5, 2025

I can see how that would be... less than ideal! I've added in that param

@avedor
Copy link
Contributor Author

avedor commented May 11, 2025

i realized during my tests that the playlist wasn't being found by the jellyfin search so was creating duplicates. this latest commit should address that as well


for _, item := range results.Items {
if strings.Contains(item.Path, track.File) {
if track.MainArtist == item.AlbumArtist && strings.Contains(item.Path, track.CleanTitle) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for requesting changes 2 times, this completely slipped my mind. I think strings.Contains(item.Path, track.CleanTitle) can be replaced with item.Name == track.CleanTitle.

Path isn't needed at all anymore (since we're not comparing it with the track.File that was done previously). CleanTitle and Path can differ from each other (special symbols can be in CleanTitle, but are removed in Path), so using item.Name should have a higher match rate.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i somehow missed this so opened #25 to address it--sorry!

@LumePart LumePart merged commit 44e42b8 into LumePart:dev May 13, 2025
@avedor avedor deleted the feat/update-jellyfin-search branch May 13, 2025 18:04
@avedor avedor mentioned this pull request May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants