Allow custom metadata agents to add theme music to movies

This feature suggestion was marked as implemented even though it is not fully implemented into Plex.

Metadata agents still cannot add theme songs to movies it appears.

This code should work but it does not work fully.

load_file = Core.storage.load
theme_song = <full filepath or url to theme song>
theme_data = load_file(theme_song)
#theme_data = HTTP.Request(theme_song) #for a url instead
metadata.themes[theme_song] = Proxy.Media(theme_data, sort_order = y)
metadata.themes.validate_keys(theme_song)

The mp3 file is actually added to the metadata folder and if renamed to have the .mp3 extension you can play the file in a media player; however Plex will not play the theme song in any client.

There is a workaround possible with a modified version of python-plexapi, but it’s not practical for most metadata agent developers to modify python-plexapi. For one the api wrapper doesn’t include a method to add theme songs by default. For two, the api wrapper is setup for python 3.x and Plex is still on python 2.7.

Please add the ability for metadata agents to use the method in my code above.

It does work. Just throw a theme.mp3 in the movie folder.

Did you even read what I wrote? Custom metadata agents cannot add theme music.

The request is NOT for the ability to use theme music as local media assets.

Hi there

How does one go about initiating this code?

It goes inside the metadata update function inside of agents. If you have a custom agent you wrote I will be happy to help you further.

Thank you for the response :slight_smile:

I’m relatively new to this, so I might need a dummies guide to getting this to work