How does the library.db understand relationships between actors and movies? - Printable Version +- Jellyfin Forum (https://forum.jellyfin.org) +-- Forum: Development (https://forum.jellyfin.org/f-development) +--- Forum: Server Development (https://forum.jellyfin.org/f-server-development) +--- Thread: How does the library.db understand relationships between actors and movies? (/t-how-does-the-library-db-understand-relationships-between-actors-and-movies) |
How does the library.db understand relationships between actors and movies? - Kevin Blansit - 2023-12-23 Hi, As I understand it, the library.db is the primary repository for the meta-data associated with Jellyfin content. I am trying to write a simple python script (with a connection to the SQlite database) to automatically add genre tags associated with certain people (based off of a YAML file I am making for myself). For a simple example, I can see Les Misérables as a concert movie row in my SQLite database in the table TypedBaseItems. I also for example see Victor Hugo as another row a person (again in the same table). When I have the Jellyfin server running and I navigate to Victor Hugo, I can see Les Misérables is associated content with this person. I would perhaps want all media content (i.e. Movies/Tv Shows/ Etc) associated with Victor Hugo to append the genre list with the tag 'French'. I can see that I can modify the Genres tag where it appears each genre is separated by a '|' character. My question is how do I determine what content is associated with Victor Hugo? I cannot see any mention of the guid I have associated with Victor Hugo in the database. Is this information contained somehow in the 'data' column? Thank you for your help! Best, KB RE: How does the library.db understand relationships between actors and movies? - ickyfehmleh - 2025-01-13 It's not a good idea to modify a sqlite database out from under the application. You may want to look into the Jellyfin API to see if what you're doing is possible. It looks like you could query on people.name to find all the ItemIds that a person appears in, joining people.itemid to eg TypedBasedItems.guid: > select tbi.path, p.name from TypedBaseItems tbi, People p where p.itemid=tbi.guid and p.name='Patrick Stewart' RE: How does the library.db understand relationships between actors and movies? - Venson - 2025-01-13 Not great. Actors are stored in 3 different ways. - ItemValues - TypeBasedItem themselfs - AncestorIds So you have an actor that itself is also an TypeBasedItem of type Person. That then has an ItemValue and a Role attached it it. Jellyfin _currently_ looks up all referenced movies for that actor by enumerating though _all_ ItemValues and then matching referenced TypeBaseItems by Name. |