• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Development Server Development How does the library.db understand relationships between actors and movies?

     
    • 0 Vote(s) - 0 Average

    How does the library.db understand relationships between actors and movies?

    Kevin Blansit
    Offline

    Junior Member

    Posts: 2
    Threads: 2
    Joined: 2023 Dec
    Reputation: 0
    #1
    2023-12-23, 05:18 AM
    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
    ickyfehmleh
    Offline

    Junior Member

    Posts: 10
    Threads: 1
    Joined: 2023 Jul
    Reputation: 0
    Country:United States
    #2
    2025-01-13, 12:56 AM
    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'
    Venson
    Offline

    Moderator, Server Dev, XBox Maintainer

    Posts: 375
    Threads: 7
    Joined: 2023 Jun
    Reputation: 15
    Country:Germany
    #3
    2025-01-13, 07:01 AM
    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.
    typos are finders, keepers.
    Next Jellyfin release 10.11.0 will be Soon™
    Soon™ is an unregistered trademark of Jellyfin International
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode