• 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 Support General Questions Is it possible to have separate library based on language?

    Pages (2): 1 2 Next »

     
    • 0 Vote(s) - 0 Average

    Is it possible to have separate library based on language?

    fedonr
    Offline

    Junior Member

    Posts: 21
    Threads: 3
    Joined: 2024 Jun
    Reputation: 0
    #1
    2024-06-21, 03:05 PM (This post was last modified: 2024-06-21, 03:14 PM by TheDreadPirate. Edited 1 time in total.)
    Okay, so I am using [Censored by TDP] for my media libraries, where I have separate movies and TV show folders which works great. But is there a way that I can separate the libraries in Jellyfin based on their language? So I prefer to watch movies in X and Y both languages, while the other members only prefers X language, so is there a way I can have a separate library for X language? This would be really helpful for my parents to navigate their media.
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,374
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #2
    2024-06-21, 03:23 PM
    Are you asking about the metadata for the library or what audio track is played by default?. Showing library metadata in a particular language requires creating a separate library and changing the language in the library settings to your language of choice. Settings > Dashboard > Library > Add new library > Set "Preferred download language" to your language of choice, configure rest of library settings as you normally would. You can go one step farther and create a separate account for your family and only give them access to the libraries in their language.

    If you only care about the audio track played by default, you don't need a separate library. You have to change the client settings to prefer your language's audio track. Settings > Playback > Audio settings > Preferred audio language.
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    fedonr
    Offline

    Junior Member

    Posts: 21
    Threads: 3
    Joined: 2024 Jun
    Reputation: 0
    #3
    2024-06-21, 03:32 PM
    Im mainly referring to the audio language of the movies.

    For example, I have 5 movies in X language and 5 movies in Y Language. Now I want my library to show up all 10 movies, while for my parent's library I want only 5 movies to show up which are in X language.

    Or if both X and Y can have separate library I can manage with that, as my parents won't need to go thru a huge library as they only watch movies in X language (audio)
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,374
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #4
    2024-06-21, 03:39 PM (This post was last modified: 2024-06-21, 03:40 PM by TheDreadPirate.)
    AFAIK, you cannot filter based on the audio language. So you'd need to go the separate library route. You can use symlinks to the movie folders so you don't have to duplicate data.
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    fedonr
    Offline

    Junior Member

    Posts: 21
    Threads: 3
    Joined: 2024 Jun
    Reputation: 0
    #5
    2024-06-21, 06:37 PM (This post was last modified: 2024-06-21, 06:38 PM by fedonr. Edited 1 time in total.)
    I'm not sure how to do it automatically.

    I tried this and ran it as cronjob with every reboot

    Code:
    #!/bin/bash

    # Define directories and language code
    SOURCE_DIR="/drive1t/media/movies"
    TARGET_DIR="/drive1t/media/himovies"
    LANGUAGE="hin"

    # Check ffprobe path (modify if necessary)
    FFPROBE_PATH="/usr/bin/ffprobe"  # Update this if ffprobe is in a different location

    # Create the target directory if it doesn't exist
    mkdir -p "$TARGET_DIR"

    while true; do
      # Loop through video files (mp4, mkv)
      find "$SOURCE_DIR" -type f \( -name "*.mp4" -o -name "*.mkv" \) | while read -r FILE; do
        echo "Processing file: $FILE"

        # Extract language using ffprobe (error handling added)
        LANG=$("$FFPROBE_PATH" -v error -select_streams a:0 -show_entries stream=codec_type:stream_tags=language:stream=codec_name -of default=noprint_wrappers=1:nokey=1 "$FILE" 2>&1 | grep -oP '(?<=language=)[^,]+' | head -n 1)

        # Check for ffprobe errors (optional)
        if [[ $? -ne 0 ]]; then
          echo "Error extracting language for: $FILE (ffprobe might have failed)"
          continue  # Skip to the next file if ffprobe has errors
        fi

        echo "Detected language: $LANG"

        # Check if language matches and create symlink if needed
        if [ "$LANG" == "$LANGUAGE" ]; then
          if [ ! -L "$TARGET_DIR/$(basename "$FILE")" ]; then
            ln -s "$FILE" "$TARGET_DIR/$(basename "$FILE")"
            echo "Created symlink for: $FILE"
          else
            echo "Symlink already exists for: $FILE"
          fi
        fi
      done

      # Sleep for 10 minutes (600 seconds)
      sleep 600
    done

    ....doesn't work tho
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,374
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #6
    2024-06-21, 07:02 PM (This post was last modified: 2024-06-21, 07:06 PM by TheDreadPirate. Edited 2 times in total.)
    In your ffprobe you are specifying "default=noprint_wrappers=1:nokey=1", but then grepping on the key "language". When nokey is set to 1 the output is

    Code:
    chris@rat-trap:~$ /usr/bin/ffprobe -v error -select_streams a:0 -show_entries stream=codec_type:stream_tags=language:stream=codec_name -of default=noprint_wrappers=1:nokey=1 "/media/storage2/testMovies/Mad Max Fury Road/Mad Max Fury Road.mkv"
    truehd
    audio
    eng

    As a result, the grep doesn't retrieve anything and LANG is always null. But when it is set to 0.

    Code:
    chris@rat-trap:~$ /usr/bin/ffprobe -v error -select_streams a:0 -show_entries stream=codec_type:stream_tags=language:stream=codec_name -of default=noprint_wrappers=1:nokey=0 "/media/storage2/testMovies/Mad Max Fury Road/Mad Max Fury Road.mkv"
    codec_name=truehd
    codec_type=audio
    TAG:language=eng

    And debug output confirms that LANG is populated now.

    Code:
    + grep -oP (?<=language=)[^,]+
    + + echohead /media/storage2/testMovies/Batman -n Begins/Batman 1 Begins.mkv
    + /usr/bin/ffprobe -v error -i /media/storage2/testMovies/Batman Begins/Batman Begins.mkv -select_streams a:0 -show_entries stream=codec_type:stream_tags=language:stream=codec_name -of default=noprint_wrappers=1:nokey=0
    + LANG=eng
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,374
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #7
    2024-06-21, 07:19 PM (This post was last modified: 2024-06-21, 07:21 PM by TheDreadPirate. Edited 3 times in total.)
    Oh. And instead of making symlinks for the file you need to make a symlink for the folder that the movie is in. In my code blocks in the above post I would make a symlink for "/media/storage2/testMovies/Batman Begins" instead of the mkv in it.

    Jellyfin will follow symlinks for folders but will ignore symlinks for files.
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    fedonr
    Offline

    Junior Member

    Posts: 21
    Threads: 3
    Joined: 2024 Jun
    Reputation: 0
    #8
    2024-06-21, 08:52 PM
    (2024-06-21, 07:19 PM)TheDreadPirate Wrote: Oh.  And instead of making symlinks for the file you need to make a symlink for the folder that the movie is in.  In my code blocks in the above post I would make a symlink for "/media/storage2/testMovies/Batman Begins" instead of the mkv in it.

    Jellyfin will follow symlinks for folders but will ignore symlinks for files.

    THanks that worked, but now I am able to play it from the Network Storage File Manager, but Jellyfin would not add it in library, I get errors like

    Code:
    [02:14:50] [ERR] [24] Emby.Server.Implementations.IO.ManagedFileSystem: Reading the file size of the symlink at /data/regmov/movies/Khufiya (2023) WEBRip-1080p.mkv failed. Marking the file as not existing.
    System.IO.FileNotFoundException: Could not find file '/data/regmov/movies/Khufiya (2023) WEBRip-1080p.mkv'.
    File name: '/data/regmov/movies/Khufiya (2023) WEBRip-1080p.mkv'
      at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError)
      at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
      at System.IO.File.OpenHandle(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
      at Emby.Server.Implementations.IO.ManagedFileSystem.GetFileSystemMetadata(FileSystemInfo info)
    [02:14:54] [INF] [15] Emby.Server.Implementations.ScheduledTasks.TaskManager: Scan Media Library Completed after 0 minute(s) and 4 seconds
    [02:14:54] [INF] [20] Emby.Server.Implementations.IO.LibraryMonitor: Watching directory /data/regmov
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,374
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #9
    2024-06-21, 08:57 PM
    In your source folder each movie needs to be in its own folder, which is what our documentation states is the recommended folder and file structure anyway.

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

    Once you put each movie in its own folder, modify your script to symlink the folder instead of the file.

    As I stated, Jellyfin will follow symlinks for folders and will ignore symlinks for files.
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    1
    fedonr
    Offline

    Junior Member

    Posts: 21
    Threads: 3
    Joined: 2024 Jun
    Reputation: 0
    #10
    2024-06-21, 09:33 PM (This post was last modified: 2024-06-21, 09:47 PM by fedonr. Edited 1 time in total.)
    Ah! I thought so that would be an issue, and I am truly so much thankful to you. It works now.

    I can't thank you enough it, would make navigation for my parents so much easy.

    And me being a noob I didn't even write that scripts I just asked multiple AI tools to do it and did trial and error.
    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