• 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 Plugin Development Manually create library with a script?

    Pages (2): 1 2 Next »

     
    • 0 Vote(s) - 0 Average

    Manually create library with a script?

    z33d
    Offline

    Junior Member

    Posts: 5
    Threads: 1
    Joined: 2024 Jul
    Reputation: 0
    #1
    2024-07-05, 03:52 PM
    tl'dr
    I want to manually (by script or plugin) create a library, completely bypassing built-in worker.

    I have a quite large collection of movies, spanning multiple drives, with nested structures, etc.
    When using the built-in worker it does identifies most of the movies, but creates a lot of mess by including extras, misinterpreting nested structures, and so on.
    Luckily I've been following a naming structure, that allowed me to parse disks content, identify 99,9% of the movies, and even grab the data from imdb [1].
    I've used it to create a small web application to help select the next movie to watch.

    So I have a small database where I have all the movies, including paths, imdb ids, genres, ratings, everything.
    I want to use it to manually build a library.

    I can try to create a custom plugin or write a script that will inject data straight into database?
    If you could point me into the right direction. Smiling-face
    Efficient_Good_5784
    Offline

    Community Moderator

    Posts: 1,167
    Threads: 3
    Joined: 2023 Jun
    Reputation: 50
    #2
    2024-07-05, 04:20 PM (This post was last modified: 2024-07-05, 04:20 PM by Efficient_Good_5784.)
    (2024-07-05, 03:52 PM)z33d Wrote: When using the built-in worker it does identifies most of the movies, but creates a lot of mess by including extras, misinterpreting nested structures, and so on.
    Are your media files correctly organized how Jellyfin expects them to be? You're not supposed to nest folders beyond what Jellyfin expects.

    Take a look at the documentation:

    https://jellyfin.org/docs/general/server/media/movies

    https://jellyfin.org/docs/general/server/media/shows
    z33d
    Offline

    Junior Member

    Posts: 5
    Threads: 1
    Joined: 2024 Jul
    Reputation: 0
    #3
    2024-07-05, 09:03 PM
    No, they are not.
    But I have them catalogued already, and I'd rather write a script or plugin to import them manually than rename all of them.
    Efficient_Good_5784
    Offline

    Community Moderator

    Posts: 1,167
    Threads: 3
    Joined: 2023 Jun
    Reputation: 50
    #4
    2024-07-05, 11:31 PM
    (2024-07-05, 09:03 PM)z33d Wrote: No, they are not.
    But I have them catalogued already, and I'd rather write a script or plugin to import them manually than rename all of them.
    Are you never going to rescan the library you're putting them into ever again? Because a rescan will most likely break things again.
    z33d
    Offline

    Junior Member

    Posts: 5
    Threads: 1
    Joined: 2024 Jul
    Reputation: 0
    #5
    2024-07-06, 11:01 AM
    If I'll be able to build the library manually I see no reason to.
    Like I've said, I have my own script, that can catalogue all of my collection, and fetch corresponding imdb info on its own.

    All I want is to use that script (or data) to manually build jellyfins library myself.
    Efficient_Good_5784
    Offline

    Community Moderator

    Posts: 1,167
    Threads: 3
    Joined: 2023 Jun
    Reputation: 50
    #6
    2024-07-06, 12:52 PM
    It's possible to do what you want, but it will be quite a lot of work. You'll basically be replacing Jellyfin's own scanner and replacing it with your own. As long as you insert your data into the database correctly, they should appear in the server without any scan. But do note that any scan of that library at all will break things.

    From speaking with a team member, different types of media each have a class that can be saved into the database. You should look at those class files to figure out how to make your external metadata into a new instance and insert it into the database. The team member also points out that "most of them inherit the 'LibraryItem' Class".

    I myself am not much help here, so you'll have to wait for others knowledgeable enough in this subject to help you.
    z33d
    Offline

    Junior Member

    Posts: 5
    Threads: 1
    Joined: 2024 Jul
    Reputation: 0
    #7
    2024-07-06, 04:16 PM
    Cool!
    I'm only interested in using Jellyfin for movies.

    For someone who's not familiar with the codebase at all, nor fluent in c# (although I've been programming for 20y and I'm familiar with OOP languages), what would be the recommended path - creating my own scanner based on the existing one (this would act as a plugin, right?) or writing an external script that would inject data directly into database?

    In either case, would you be so kind and point me to the code responsible for the default movie scanner?
    mcarlton00
    Offline

    Kodi Addon Maintainer

    Posts: 145
    Threads: 1
    Joined: 2023 Sep
    Reputation: 9
    Country:United States
    #8
    2024-07-06, 07:55 PM
    The recommended path is "seriously, do not do this". This is such a massive project that it's going to be a lot of pain before you get any sort of realistic functionality out of it. If you insist, then the only real guidance we can give you is to run the server, import your stuff, and then go digging through it to figure out what goes where. It's not going to be fun. It's also going to be very fragile, as anytime there's an update to the scanning code and the database format shifts slightly you're going to have to update your script to match it.

    Good luck.
    I-G-1-1
    Offline

    Junior Member

    Posts: 13
    Threads: 1
    Joined: 2023 Jun
    Reputation: 0
    #9
    2024-07-20, 04:45 PM
    Why don't you create a script to ln (hardlinks) all the folders/files with the structure that jellyfin library scanner expects in some folder called jellyfin_library?
    z33d
    Offline

    Junior Member

    Posts: 5
    Threads: 1
    Joined: 2024 Jul
    Reputation: 0
    #10
    2024-07-22, 02:28 PM
    Hey, that's quite brilliant, I really like the idea.
    If I'll be hosting JF on linux this will probably be the solution.
    Pages (2): 1 2 Next »

    « 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