Server Version#: 1.23.2.4656-1
Player Version#:Windows Version 1.31.1.2262-74fdc6b7
I have noticed that I can use track mood in audio smartplaylists
All my tracks in the library have the Genre set is there anyway to use this in smart playlists or a way to copy the genre which is embedded in the track into the mood field in the database
or have an option to say use track genre as the track mood
No you can only filter by Genre at album or artist level.
a good example are greatest hits album where there are the artists usual songs but also include a Christmas song
if you have set the genre of the tracks to lets say Pop but one track has been set to Xmas there is no way to say play artist songs but dont play any xmas ones.
or the opposite play Xmas songs only
Plex seems to the only music app that does not provide the ability to filter at track level
Unless i go through the database and manually set the mood to what is already stored in the tracks Genre Tag
it wouldnt be too bad to do if you are only adding a couple of albums at a time, but when you are adding a couple of thousand albums which are already correctly tagged, it is virtually impossible to manually set the track mood
Plex unfortunately doesnât store the genre at the track level.
So it wonât be possible to filter genre at the track level.
Nor would it be possible to copy the Genre to the Mood inside of Plex, because the Genre doesnât exist in Plex.
AFAIK, Plex reads the Genre tags, but does not read the Mood tags from files at all (it only pulls them from last.fm/musicbrainz) - so unfortunately you canât do it by tagging your files with Mood = Genre.
Tracks-based genres shouldnât be very hard for Plex to implement on the lower level: individual tracks already have a Genre field in the database, itâs just always blank. But by the looks of it, the queries on top of it only consider Album genres.
It would appear that there must be a field in the database for track mood as I have manually set mood values for tracks to things like qwerty and been able to filter on it.
Therefore Iâm presuming a bit of SQL could be used to set this.
Obviously if the track genre is blank in the database Iâd have to rescan the actual track externally to extract genre, and locating correct track in database presumably would not be trivial either.
Iâll download a copy of the database and have a browse around it
Of course Mood and Genre can be stored in track-level fields if you put them there, thatâs trivial and you could easily populate them with an python script etc. But in order to actually use track-level metadata within a Plex client (web UI or the apps) the SQL queries in Plex also need to be modified to not only search albums (metadata_type = 9), the API needs to be redefined to not just return albums but also tracks, and the client code needs to know what to do when it receives tracks instead of albums as the answer to its API requests.
Itâs not as simple as just putting track-level data in the DB and expecting that the rest of the stack magically knows what to do with it.
Open the database, go to the metadata_items table, and filter for metadata_type = 9 (albums). Records with metadata_type 10 are tracks.
Genre is stored in the field tags_genre.
Mood is stored in the field user_fields: you see something like lockedFields =300 . Havenât figured out yet what table contains the Mood names.
The moods appear to be stored in the tags table with a tagtype of 300
viewing the XML for a track shows the following
Mood id=â11866â filter=âmood=11866â tag=âQwertyâ [which is what i set my test record to be]
as you said tracks which have a mood set show lockedFields=300 in the metadata_items table, but there doesnt seem to be a mapping to the correct record in the tags table to pick up the vale of the mood tag, a bit puzzling
I guess the lockedFields=300 value is just there to help the filtering, there must be a join table somewhere with the relationship metadata_item id <-> tags id. Maybe itâs the metadata_relations table?
Plex is a weird mix of âproperâ many-to-many database design like that, and on the other hand ugly hacks like Genre where they store multiple values in the tags_genre field as a single string with a | separator: Easy Listening|Bossa Nova (ouch!). Not to mention the whole mess where album artist is a proper DB record, but track artist is a completely unrelated text field inside the tracks record.