LMS-Community/slimserver

Genres not reset

theking2 opened this issue · 12 comments

After a "Clear library and rescan everything" genres are not cleared.

  1. Select "Clear library and rescan everything" and click "Rescan
  2. Wait for the process to finalize
  3. The Genres list contains empty genres

The content of the scanner.log file:

[24-11-25 08:56:59.9367] main::main (213) Starting Lyrion Music Server scanner (v9.0.0, 1732014181, Wed Nov 20 02:59:14 UTC 2024) perl 5.036000
[24-11-25 08:57:37.9688] Slim::Music::Import::runImporter (581) Starting Slim::Media::MediaFolderScan scan
[24-11-25 08:57:37.9695] Slim::Utils::Scanner::Local::rescan (180) Discovering audio files in /music
[24-11-25 08:57:45.9524] Slim::Utils::Scanner::Local::__ANON__ (192) Start processing found tracks
[24-11-25 08:57:45.9531] Slim::Utils::Scanner::Local::__ANON__ (200) Connect do DB
[24-11-25 08:57:45.9535] Slim::Utils::Scanner::Local::__ANON__ (203) Get latest ID
[24-11-25 08:57:45.9541] Slim::Utils::Scanner::Local::__ANON__ (228) Build temporary table for deleted tracks
[24-11-25 08:57:45.9551] Slim::Utils::Scanner::Local::__ANON__ (249) Build temporary table for new tracks
[24-11-25 08:57:45.9984] Slim::Utils::Scanner::Local::__ANON__ (269) Build temporary table for changed tracks
[24-11-25 08:57:46.0126] Slim::Utils::Scanner::Local::__ANON__ (292) Get deleted tracks count
[24-11-25 08:57:46.0131] Slim::Utils::Scanner::Local::__ANON__ (299) Get new tracks count
[24-11-25 08:57:46.0138] Slim::Utils::Scanner::Local::__ANON__ (304) Get changed tracks count
[24-11-25 08:57:46.0142] Slim::Utils::Scanner::Local::deleteTracks (421) Removing deleted audio files (0)
[24-11-25 08:57:46.0146] Slim::Utils::Scanner::Local::updateTracks (588) Rescanning changed audio files (0)
[24-11-25 08:57:46.0150] Slim::Utils::Scanner::Local::addTracks (504) Scanning new audio files (13430)
[24-11-25 09:06:11.4151] Slim::Music::Import::endImporter (714) Completed Slim::Media::MediaFolderScan Scan in 513.446 seconds.
[24-11-25 09:06:11.4162] Slim::Music::Import::runImporter (581) Starting Slim::Plugin::ExtendedBrowseModes::Libraries scan
[24-11-25 09:06:11.4167] Slim::Music::Import::endImporter (714) Completed Slim::Plugin::ExtendedBrowseModes::Libraries Scan in 0.001 seconds.
[24-11-25 09:06:11.4174] Slim::Music::Import::runImporter (581) Starting Slim::Plugin::FullTextSearch::Plugin scan
[24-11-25 09:06:11.4187] Slim::Plugin::FullTextSearch::Plugin::_rebuildIndex (513) Starting fulltext index build
[24-11-25 09:06:11.4192] Slim::Plugin::FullTextSearch::Plugin::_rebuildIndex (521) Initialize fulltext table
[24-11-25 09:06:11.4231] Slim::Plugin::FullTextSearch::Plugin::_rebuildIndex (534) Create fulltext index for tracks
[24-11-25 09:06:32.8452] Slim::Plugin::FullTextSearch::Plugin::_rebuildIndex (544) Create fulltext index for albums
[24-11-25 09:06:40.3096] Slim::Plugin::FullTextSearch::Plugin::_rebuildIndex (553) Create fulltext index for contributors
[24-11-25 09:06:40.5573] Slim::Plugin::FullTextSearch::Plugin::_rebuildIndex (563) Create fulltext index for works
[24-11-25 09:06:45.7869] Slim::Plugin::FullTextSearch::Plugin::_rebuildIndex (572) Create fulltext index for playlists
[24-11-25 09:06:45.9642] Slim::Plugin::FullTextSearch::Plugin::_rebuildIndex (587) Optimize fulltext index
[24-11-25 09:06:46.2065] Slim::Plugin::FullTextSearch::Plugin::_rebuildIndex (602) Fulltext index build done!
[24-11-25 09:06:46.2073] Slim::Music::Import::endImporter (714) Completed Slim::Plugin::FullTextSearch::Plugin Scan in 34.790 seconds.
[24-11-25 09:06:46.2619] Slim::Music::Artwork::precacheAllArtwork (658) Starting precacheArtwork for 1081 albums
[24-11-25 09:08:00.9072] Slim::Music::Artwork::__ANON__ (809) precacheArtwork finished in 74.6371159553528
[24-11-25 09:08:00.9222] Slim::Music::Import::endImporter (714) Completed precacheArtwork Scan in 74.714 seconds.
[24-11-25 09:08:01.5928] Slim::Music::Import::runScanPostProcessing (483) Starting Database optimization.
[24-11-25 09:08:10.9633] Slim::Music::Import::endImporter (714) Completed dbOptimize Scan in 9.370 seconds.

A wipe & rescan deletes everything from the tables. See https://github.com/LMS-Community/slimserver/blob/public/9.0/SQL/SQLite/schema_clear.sql. If you end up with empty genres, then something else might be at play. Please check your files for where the tag might have survived. It could also be there's an album which has some tracks with that genre only, or with multiple genres, and the menu was filtering at the album level or whatever.

If you end up with empty genres, then something else might be at play. Please check your files for where the tag might have survived. It could also be there's an album which has some tracks with that genre only, or with multiple genres, and the menu was filtering at the album level or whatever.

Possibly but if I click Genres from the main menu those tracks than would be listed under the specific genre, wouldn't they? Is there a way to find that in the database?

If you enable logging for database.sql, you'll get to see what queries are being used when browsing menus. Maybe this helps shed some light on the issue? Also feel free to send me a copy of your library.db file https://www.dropbox.com/request/T3RctyzGgNg0oFDubq6a

...Also feel free to send me a copy of your library.db file https://www.dropbox.com/request/T3RctyzGgNg0oFDubq6a

done

Did you browse to such an empty genre with the logging enabled? I can't find any trace of it in server.log.

The scanner.log doesn't have a single error message. I believe the scan itself is fine. Maybe you can share your library.db with me?

Did you browse to such an empty genre with the logging enabled? I can't find any trace of it in server.log.

The scanner.log doesn't have a single error message. I believe the scan itself is fine. Maybe you can share your library.db with me?

It's a little difficult as I don't know which of these should be on info (debug?)

(database.info) - Metadata & Parsing Logging
(database.mysql) - MySQL Initialization & Process Information
(database.sql) - SQL Logging (Advanced)
(database.virtuallibraries) - Library Views (virtual libraries)

but I think these are ones you are looking for? (the last select turned out zero tracks) :


[24-12-01 14:42:52.9400] Slim::Menu::BrowseLibrary::_topLevel (768) params=>mode=genres
[24-12-01 14:42:52.9528] Slim::Menu::BrowseLibrary::_generic (938) genres (0, 1): tags ->tags:sZZ
[24-12-01 14:42:52.9602] Slim::Menu::BrowseLibrary::__ANON__ (897) genres (0, 51): tags ->tags:s
[24-12-01 14:42:55.6629] Slim::Menu::BrowseLibrary::_topLevel (768) params=>mode=genres
[24-12-01 14:42:55.6635] Slim::Menu::BrowseLibrary::__ANON__ (897) genres (0, 1): tags ->tags:s
[24-12-01 14:42:55.6667] Slim::Menu::BrowseLibrary::_topLevel (768) params=>genre_id=624&role_id=ALBUMARTIST&mode=artists
[24-12-01 14:42:55.6674] Slim::Menu::BrowseLibrary::_generic (938) artists (0, 1): tags ->genre_id:624, role_id:ALBUMARTIST, tags:sZZ
[24-12-01 14:42:55.6701] Slim::Menu::BrowseLibrary::__ANON__ (897) artists (0, 50): tags ->genre_id:624, role_id:ALBUMARTIST, tags:s
[24-12-01 14:42:55.6729] Slim::Control::Queries::artistsQuery (1235) Artists query: SELECT contributors.id, contributors.name, contributors.namesort FROM contributors JOIN contributor_track ON contributor_track.contributor = contributors.id JOIN tracks ON tracks.id = contributor_track.track JOIN genre_track ON genre_track.track = tracks.id JOIN albums ON albums.id = tracks.album WHERE genre_track.genre IN (?) AND (contributor_track.role IN (5,1) )  AND (albums.compilation IS NULL OR albums.compilation = 0 OR contributors.id = 6860) GROUP BY contributors.id ORDER BY contributors.namesort COLLATE en_US , contributors.musicbrainz_id LIMIT ?,?  / [624, 0, 50]
[24-12-01 14:42:59.2893] Slim::Menu::BrowseLibrary::_topLevel (768) params=>mode=genres
[24-12-01 14:42:59.2900] Slim::Menu::BrowseLibrary::__ANON__ (897) genres (1, 1): tags ->tags:s
[24-12-01 14:42:59.2931] Slim::Menu::BrowseLibrary::_topLevel (768) params=>role_id=ALBUMARTIST&genre_id=631&mode=artists
[24-12-01 14:42:59.2937] Slim::Menu::BrowseLibrary::_generic (938) artists (0, 1): tags ->genre_id:631, role_id:ALBUMARTIST, tags:sZZ
[24-12-01 14:42:59.2957] Slim::Menu::BrowseLibrary::__ANON__ (897) artists (0, 50): tags ->genre_id:631, role_id:ALBUMARTIST, tags:s

How do I access library.db?

My second language is SQL so if I were able to issue queries directly I could try and help you. Is that possible?

Yes, that might be the relevant query. You'll find the library.db file in your cache folder, as listed in Settings/Information.

Uploaded library.db

Your log snippet only shows one SQL query. But if I apply the same for the genre ID thereafter (631), then I'd indeed get an empty list. The problem seems to be that the tracks linked to that genre "A Capella" are all attributed to an album "No Album", which is flagged as a compilation. And compilations are explicitly NOT listed under genres.

The album in question seems to be Diana Krall's "Live in Paris"? Those tracks also lack artwork, year and likely more. Maybe you should double check that album's metadata.

I use Tag & Rename to add and edit metadata.

The majority tracks in my collection are ripped from my CD's using eac and a FLAC plug in where I use CDDB to set track/album and genres. Other tracks were acquired from Bandcamp, Hyperion, and the now defunct B&W Society of Sound mostly.

Btw Diana Krall definitely is not genred as 'A capella' (or shouldn't be at least).

I don't see an genre_id in tracks nor albums is there a separate tables?

select 
  id,
  title,
  album
from 
  tracks 
join genre_track on genre_track.track=tracks.id
where genre=613
limit 4;

Yes, there's genres and genre_track. Look at the logged SQL query you posted.

Can you show what tags you have for that album? Eg. /music/Diana Krall/Live in Paris/01 I Love Being Here With You.m4a

Thanks for that question. Mystery solved. Indeed "Live in Paris" didn't have a Album nor Album artist set, and Genre was A Capella (thank you apple store!) I understand now that

  1. because there was wo Album information it was treated as a compilation (as you wrote)
  2. because of that the (wrong) genre appeared in the list but has no tracks associated with it.

And indeed after straitening these omissions the 'ghostlike' genre disappeared.

Sorry for this error but I learned something about the inner workings of Lyrion Media server...

[EDIT] Maybe it would be an idea of having access to this type of tracks in the fe.