Skip to content
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

No recently album music added since Kodi19 #481

Closed
750913372 opened this issue Mar 8, 2021 · 10 comments · Fixed by #490
Closed

No recently album music added since Kodi19 #481

750913372 opened this issue Mar 8, 2021 · 10 comments · Fixed by #490
Labels
bug Something isn't working

Comments

@750913372
Copy link

Since I updated to Kodi 19, when I add new music albums on JellyFin, they are correctly synced wih Kodi (using Kodi Sync Queue) but the albums are no more added to the recently added albums view in Kodi.

I activated the debug mode in Kodi and in the plugin and attached to this issue the section for the jellyfin music sync
kodi.log, but I didn't find any relevant error...

I looked into the new Kodi music DB (MyMusic82.db) and I found that the field dateAdded is correctly filled for all songs but is empty for albums added after my update to KODI 19.

Does anybody else have the same issue ? 

Thank you ! 

My configuration
Jellyfin 10.6.4 on NAS Docker (Linux)
Kodi 19 on NVidia Shield (Android)
Jellyfin-Kodi plugin 0.7.0+py3

@750913372 750913372 changed the title No recently album music album since Kodi19 No recently album music added since Kodi19 Mar 8, 2021
@mcarlton00 mcarlton00 added the bug Something isn't working label Mar 8, 2021
@mcarlton00
Copy link
Member

Very odd. I wonder if this is a change in the music database that we haven't accounted for. Especially if it's only happening after the upgrade to Kodi 19.

@750913372
Copy link
Author

Thank you for the answer!

This is not directly to this issue (as the recently added album list is not based on the albumview) but with Kodi 19, they for example changed the way the dateAdded is built in the albumview in the music DB.
In MyMusic72.db: (SELECT MAX(song.dateAdded) FROM song WHERE song.idAlbum = album.idAlbum) AS dateAdded
In MyMusic82.db: dateAdded (from album)

So apparently, they indeed made some changes in the way the dateAdded is managed for albums in the new KODI Music DB.

@mcarlton00
Copy link
Member

So I finally got some time to check into this and I can't replicate it. I added a new album both when Kodi was running (get the new data via websocket) and while Kodi was turned off (via the Kodi Sync Queue plugin) and both times it synced fine. I do see that the entire dateAdded column is blank on a fresh sync from Kodi 19, but the view on the home screen seems to be behaving properly. It's worth noting that the skin doesn't refresh automatically, so it doesn't dynamically update as soon as new media is added. After a restart the home screen shows both of the albums I added under the 'Recently added albums' heading.

2021-03-14-174843_669x441_scrot

I added Guitar Gangsters... while Kodi was turned off, and Beyond Hell... while Kodi was running and they've both shown up fine.

So on a hunch, I'm guessing that different views are querying the database in different ways. Not sure why dateAdded isn't being populated in Kodi 19 yet, but on my system at least it doesn't appear to be an issue. Possibly it's using that column as primary and falling back to another method if it can't find anything? That will still need investigating.

@750913372
Copy link
Author

Thank you for your investigations.
Could my issue be related to the KODI skin I'm using?
I'm using the default skin (Estuary), may I ask you which skin you are using ?
Or to the skin language? I'm using French...

@aenima99x
Copy link

I can verify that I'm seeing the same issue on Kodi 19. The new albums are added in the Music, but they do not show up in the Recently Added Music. Even when browsing into the Music library through the Jellyfin plugin on Kodi, the latest Music there is not the same as what shows in Jellyfin web.

@mcarlton00
Copy link
Member

I'm assuming thew views are defined to look by dateAdded, but falls back to something else if it's not present. But since you upgraded from v18 that had dateAdded, but the sync isn't adding it for v19 it's taking the older values and missing the new ones. We'll need to look into the queries to see why that field isn't being populated properly

@aenima99x
Copy link

Ok I found the issue. I opened up the MyMusic82.db in v19 and it looks like they're no longer using dateAdded but are now using dateNew instead.
mymusic82db

@mcarlton00
Copy link
Member

Yeah, I just diffed the schemas for Kodi18 vs Kodi19 and saw the same thing, good catch.

kronos% sqlite3 .kodi/userdata/Database/MyMusic72.db
sqlite> PRAGMA table_info(album);
0|idAlbum|integer|0||1
1|strAlbum|varchar(256)|0||0
2|strMusicBrainzAlbumID|text|0||0
3|strReleaseGroupMBID|text|0||0
4|strArtistDisp|text|0||0
5|strArtistSort|text|0||0
6|strGenres|text|0||0
7|iYear|integer|0||0
8|bCompilation|integer|1|'0'|0
9|strMoods|text|0||0
10|strStyles|text|0||0
11|strThemes|text|0||0
12|strReview|text|0||0
13|strImage|text|0||0
14|strLabel|text|0||0
15|strType|text|0||0
16|fRating|FLOAT|1|0|0
17|iVotes|INTEGER|1|0|0
18|iUserrating|INTEGER|1|0|0
19|lastScraped|varchar(20)|0|NULL|0
20|bScrapedMBID|INTEGER|1|0|0
21|strReleaseType|text|0||0
22|idInfoSetting|INTEGER|1|0|0
kronos% sqlite3 .kodi/userdata/Database/MyMusic82.db
sqlite> PRAGMA table_info(album);
0|idAlbum|INTEGER|0||1
1|strAlbum|VARCHAR(256)|0||0
2|strMusicBrainzAlbumID|TEXT|0||0
3|strReleaseGroupMBID|TEXT|0||0
4|strArtistDisp|TEXT|0||0
5|strArtistSort|TEXT|0||0
6|strGenres|TEXT|0||0
7|strReleaseDate|TEXT|0||0
8|strOrigReleaseDate|TEXT|0||0
9|bBoxedSet|INTEGER|1|0|0
10|bCompilation|INTEGER|1|'0'|0
11|strMoods|TEXT|0||0
12|strStyles|TEXT|0||0
13|strThemes|TEXT|0||0
14|strReview|TEXT|0||0
15|strImage|TEXT|0||0
16|strLabel|TEXT|0||0
17|strType|TEXT|0||0
18|fRating|FLOAT|1|0|0
19|iVotes|INTEGER|1|0|0
20|iUserrating|INTEGER|1|0|0
21|lastScraped|VARCHAR(20)|0|NULL|0
22|bScrapedMBID|INTEGER|1|0|0
23|strReleaseType|TEXT|0||0
24|iDiscTotal|INTEGER|1|0|0
25|idInfoSetting|INTEGER|1|0|0
26|strReleaseStatus|TEXT|0||0
27|dateAdded|TEXT|0||0
28|dateNew|TEXT|0||0
29|dateModified|TEXT|0||0
30|iAlbumDuration|INTEGER|1|0|0

Should be an easy enough fix. Just another example of playing with the database that we're not supposed to play with.

@750913372
Copy link
Author

Thank you all for your finding and already for the upcoming fix!

@aenima99x
Copy link

I pulled the changed files and updated my local plugin. I can verify that the Recently Added Music is now properly updating in Kodi widgets and within the Jellyfin plugin.
I did run into an issue though with trying to repair/update the existing music library and had to just reset the local kodi db.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants