Setting track mood to be same as embedded track genre

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

Thanks

AFAIR you can use genre just as well in a filter, and thus in a smart playlist.

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.

I know thats the problem, but it could be made to copy the track genre into the track mood when scraping the album into the database as a default

Plex doesn’t scrape the genre into the properties of the tracks. Thus, what you want is unfortunately not possible.

See above,

it must store the mood in the track properties as you can filter on it

therefore the code that scrapes the track could be modified to query the genre tag at scraping and store this in mood property.

or they could just amend the database and scrape and store the genre (and all the other fields they gaily ignore such as year)

You might want to put your vote on this request: Music tracks need genre

I already have

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

Any thoughts

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.

1 Like

Thanks for Info most helpful

Had a quick browse at lunhctime

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.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.