2023-01-21, 07:52
Some quick background: I've been significantly modifying and cleaning up my music over the last few months, and Kodi's not handled the changes very well. I had a lot of ghost entries in the library that no longer existed, albums that wouldn't be added, etc. No amount of cleaning the database and scanning seemed to fix it, so I decided to blow away and start over now that my clean-up is mostly complete.
Problem now is that I can't get kodi to successfully re-build my music library. I've had two primary issues.
First attempt:
I went the straightforward route - remove all music sources (removing all songs when prompted), then cleanup library, then re-add the source and let it scan. It performed a full scan w/ scraping, taking close to 2 hours to complete. However, when trying to view my music it would tell me that it needs to do another scan to read all tags. Repeated this every time for no reason I could determine. Upon reviewing my library it looked like everything was scraped, and if I viewed all songs it show thousands of songs as expected, but if I navigated my library via Genre, Artist, and then Album, most albums were empty. Even songs that displayed when viewing all Songs would not display when viewing their Album. Very odd.
I recently had some weird database issues with old TV episodes not being cleaned up, so I tried manually deleting all rows in the music database tables and running through the above process again. Same results.
Second attempt:
This time I decided to drop the music database entirely and start from scratch. My thinking here (and per the documentation) is that kodi will create it's database automatically if it doesn't already exist, so I figured if there was any kind of weird corruption issue this might help. It does create the database, but not completely - the views aren't re-created. Now I get ERRORs in the log for every album saying songview doesn't exist:
I'm pretty certain I'm not running into a permission issue here. I gave it wide-open access:
I even enabled general query logging in mariadb. I see all of the create statements for the database, tables, indexes, etc., but it doesn't try to create any views. It does insert songs into the database during the scan:
After the scan if I run a 'select * from song;' it reports 26490 rows, which should cover my whole collection. But even now Kodi tells me that my music library is empty.
I'm stumped at this point. Can anyone recommend how to proceed from here? I don't care about preserving any music data whatsoever - just want to start from scratch as far as kodi is concerned and scan a new music library.
I'll provide a debug log in the next post. Need to capture logging from a much smaller source, otherwise it's far too big.
Problem now is that I can't get kodi to successfully re-build my music library. I've had two primary issues.
First attempt:
I went the straightforward route - remove all music sources (removing all songs when prompted), then cleanup library, then re-add the source and let it scan. It performed a full scan w/ scraping, taking close to 2 hours to complete. However, when trying to view my music it would tell me that it needs to do another scan to read all tags. Repeated this every time for no reason I could determine. Upon reviewing my library it looked like everything was scraped, and if I viewed all songs it show thousands of songs as expected, but if I navigated my library via Genre, Artist, and then Album, most albums were empty. Even songs that displayed when viewing all Songs would not display when viewing their Album. Very odd.
I recently had some weird database issues with old TV episodes not being cleaned up, so I tried manually deleting all rows in the music database tables and running through the above process again. Same results.
Second attempt:
This time I decided to drop the music database entirely and start from scratch. My thinking here (and per the documentation) is that kodi will create it's database automatically if it doesn't already exist, so I figured if there was any kind of weird corruption issue this might help. It does create the database, but not completely - the views aren't re-created. Now I get ERRORs in the log for every album saying songview doesn't exist:
Code:
2023-01-20 23:26:27.878 T:31726 ERROR <general>: SQL: [kodi_music82] The table does not exist
Query: SELECT * FROM songview where strPath='/home/media/data/music/Lossless/Classical/Aubrey Hilliard/Piano Classics/' ORDER BY strFileName
I'm pretty certain I'm not running into a permission issue here. I gave it wide-open access:
Code:
MariaDB [mysql]> show grants for 'kodi_admin';
+--------------------------------------------------------------------------------------------------------------------+
| Grants for kodi_admin@% |
+--------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO `kodi_admin`@`%` IDENTIFIED BY PASSWORD '*XXXXX' |
| GRANT ALL PRIVILEGES ON `kodi_videos%`.* TO `kodi_admin`@`%` |
| GRANT ALL PRIVILEGES ON `kodi_music%`.* TO `kodi_admin`@`%` |
+--------------------------------------------------------------------------------------------------------------------+
I even enabled general query logging in mariadb. I see all of the create statements for the database, tables, indexes, etc., but it doesn't try to create any views. It does insert songs into the database during the scan:
Code:
128 Query INSERT INTO song (idSong, dateNew, idAlbum, idPath, strArtistDisp, strTitle, iTrack, iDuration, strReleaseDate, strOrigReleaseDate, iBPM, iBitrate, iSampleRate, iChannels, strDiscSubtitle, strFileName, dateAdded, strMusicBrainzTrackID, strArtistSort, iTimesPlayed, iStartOffset, iEndOffset, lastplayed, rating, userrating, votes, comment, mood, strReplayGain) VALUES (NULL, NULL, 1, 4, 'Aubrey Hilliard', 'Turkish Rondo', 1, 257, '1998', '1998', 0, 616, 44100, 2,'', '01-Turkish Rondo.flac', '2022-11-12 14:42:07' ,NULL,NULL,0,0,0,NULL, 0.0, 0, 0,'', '', '-3.330,1.000,-5.320,0.985')
After the scan if I run a 'select * from song;' it reports 26490 rows, which should cover my whole collection. But even now Kodi tells me that my music library is empty.
I'm stumped at this point. Can anyone recommend how to proceed from here? I don't care about preserving any music data whatsoever - just want to start from scratch as far as kodi is concerned and scan a new music library.
I'll provide a debug log in the next post. Need to capture logging from a much smaller source, otherwise it's far too big.