Bugzilla – Bug 8303
New Schema
Last modified: 2014-08-15 06:46:31 UTC
New database arrangement to try to allow flexibility and multiple users
hi, great idea. can we please add bugs 8001 and 8324 as related bugs to this? one thing the SC database does not handle well is users with very basic tags, aka no user defined tags. i know thats also a scanner issue but it is also a database issue imo, (meaning the database should be designed to work for such users as well, we aren't lepers!) you might also consider adding bugs: 112, 2470, 4624, 4754, 6208, 6444, 6451, 6490, 6577, 7698, 7836 also, along with supporting multiple users, supporting multiple libraries would be smart to do. ie. different physical locations are treated as separate libraries. however, in such a case, an option to view all separate libraries as one library would also be good. finally, i proposed a wiki project that would painstakingly document SC's expected behaviors given a certain data set. if you are going to build a new DB schema from scratch, this seems like the perfect time to do it, as you went, so everyone would know what was expected given certain data and certain options. it would be a lot of work but it would pay off in the long run.
Created attachment 3411 [details] Patch for new tables and scanning code This patch includes a first try of the database schema change and the scanning code to add data to it. It currently doesn't contain any browsing, so you will have to use the Custom Browse plugin together with the soon attached BrowseByTags plugin. The table principle: - tags: Contains the tag values together with a unique id - tag_tracks: Contains the relation between the tag values and the track object in the tracks table The tag_tracks table contains a referencetype and reference column, these can be used to find the real object representing the tag in the contributors, genres, years and albums tables. The reference column points to the object in the tags table for tags that doesn't represent a genre, album, contributor or year. The patch doesn't change the main layout of the database, the albums, contributors, genres and years can still be used, but through the tags and tag_track tables you can also browse custom tags. The new Slim::Schema::* classes has only been tested through scanning, so there might still be bugs in the browsing code in these classes.
Created attachment 3412 [details] BrowseByTags plugin Install this BrowseByTags plugin together with the Custom Browse plugin of version 2.0 or later. This will give you a new "Browse By Tags" menu where you can test the performance of the new table layout. Please note that the BrowseByTags plugin is only attached so users can use the database patch, the code in the BrowseByTags plugin is taken from the Custom Scan plugin and is currently pretty messy so this is obviously not the browsing code that should be included in the final solution.
When implementing this, please look in the following forum thread where this has been discussed a bit: http://forums.slimdevices.com/showthread.php?t=48575
might want to add 5177 as well. also, i hope the schema will be flexible, maning it will do morethan just address tagging issues. it should know the difference between new users and existing users, so new features can hhave different default settings for instance. i would also like to see modular plugin scanners. and i would like to see a clear delineation between those options that apply to prescanner (scanning options) and postscanner (media library options). i understand this bug is just for the schema, BUT i think this ideas need to be kept in mind.
sorry, also add 8380 and 8764
How about adding #7515 to the list as well?
Should we add bug 5211?
Might want to add (enhancement) bug 11159 as well ... (Sort Names)
just to be clear, it would be good if it was no longer necessary to think of options as pre or post scanner, meaning, changing options would not require a rescan. also, you shouldn't have to go into home -> artists or home -> albums, etc... you should be able to arrange your sorts on the fly dynamically via whatever field[s]/tag[s] in whatever order you want and then toggle art on/off from anywhere.
Erland notes that this bug is blocking some plugin development due to its uncertainty. The bug meeting should discuss if we can give better guidance.
As guidance, this is not going to happen for a Long Time. We don't have the resources to address this right now.