• 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 Off Topic General Discussion Is there a way to validate the media info data?

     
    • 0 Vote(s) - 0 Average

    Is there a way to validate the media info data?

    kodiuser
    Offline

    Junior Member

    Posts: 2
    Threads: 1
    Joined: 2024 Nov
    Reputation: 0
    #1
    2024-11-29, 01:06 PM
    I have just seen that an anime show that I watch has been catalogued as another show I have, one that is in a different parent folder.  I have checked that my tvshow.nfo file is correct for both shows.

    Is there a tool or method that can see if the metadata held for a show is correct?

    For example:
        path: /anime/Chainsaw Man/Season 1/...
        metadata: title: Chainsaw Man

    A tool or such would say that the data matches and is therefore correct.
    Without looking at the API yet, I suppose I could use that?

    Thanks
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,375
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #2
    2024-11-29, 05:08 PM (This post was last modified: 2024-11-29, 05:08 PM by TheDreadPirate.)
    I am only aware of a way to see if a show/movie has not been identified at all. I am not aware of a way to check for mis-identified content. I recommend including the TMDB ID in the folder name to help prevent this from happening.

    Code:
    /anime/Chainsaw Man [tmdbid-114410]
    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]
    kodiuser
    Offline

    Junior Member

    Posts: 2
    Threads: 1
    Joined: 2024 Nov
    Reputation: 0
    #3
    2024-11-29, 05:24 PM (This post was last modified: 2024-11-29, 05:26 PM by kodiuser. Edited 1 time in total.)
    I have been playing and sorted it with PowerShell.  Copy this into a new file (Jellyfin_Fix.ps1) and execute it.
    It will scan all your libraries that are of type "tvshow" and output a proper PowerShell object with the relevant details.

    Just remember to add your API key and User ID at the bottom where indicated.

    Enjoy.

    ----------

    Code:
    Clear-Host

    Function Get-TVLibrary {
        Param (
            [object]$authInfo
        )

        $headers = @{}
        $headers['X-MediaBrowser-Token'] = $authInfo.ApiKey
        $response = Invoke-RestMethod -Uri "$($authInfo.Url)/Views" -Method Get -Headers $headers

        ForEach ($item In ($response.Items | Sort-Object -Property 'Name')) {
            If ($item.CollectionType -eq 'tvshows') {
                [pscustomobject]@{'Id' = $item.Id; 'Name' = $item.Name}
            }
        }
    }

    Function Get-LibraryItem {
        Param (
            [object]$authInfo,
            [string]$LibraryId
        )

        $headers = @{}
        $headers['X-MediaBrowser-Token'] = $authInfo.ApiKey
        $response = Invoke-RestMethod -Uri "$($authInfo.Url)/Items?=SortName%2CPath&ParentId=$LibraryId" -Method Get -Headers $headers

        ForEach ($item In ($response.Items | Sort-Object -Property 'Name')) {
            [pscustomobject]@{'Id' = $item.Id; 'Name' = $item.Name}
        }
    }

    Function Get-Item {
        Param (
            [object]$authInfo,
            [string]$ItemId
        )

        $headers = @{}
        $headers['X-MediaBrowser-Token'] = $authInfo.ApiKey
        Return (Invoke-RestMethod -Uri "$($authInfo.Url)/Items/$ItemId" -Method Get -Headers $headers)
    }

    Function Read-Library {
        Param (
            $AuthInfo,
            $Library
        )

        ForEach ($item In $Library) {
            $shows = (Get-LibraryItem -authInfo $AuthInfo -LibraryId $item.Id)
            ForEach ($show In $shows) {
                $showItem  = (Get-Item -authInfo $AuthInfo -ItemId $show.Id)
                $showItem.Name = $showItem.Name.replace(':', '').replace('!', '').replace('/', ' ').replace('?', '').replace('&', 'And').replace('*', '.')
                $showItem.Name = $showItem.Name.TrimEnd('.')    # Synology Really does not like folder names that end with a dot (.)

                $showPath = $showItem.Name
                $origPath = ($showItem.Path).split('/')[-1]
                If (-not $showItem.Name.EndsWith(')')) {
                    # Discard entries with year or language suffix.  For exmaple:  "TV Show (2024)" -or- "TV Show (Korean)"
                    $showPath = ($origPath) -replace "\s\((?:\d{4}|\w{1,})\)", ''
                }
    #            If ($showPath -eq $origPath) { $origPath = '' }

                If (($showItem.Name) -ine ($showPath)) {
                    [pscustomobject]@{
                        'Library'        = $Library.Name
                        'Jellyfin Title' = $showitem.Name
                        'Cleaned Title'  = $showPath
                        'Original Title' = $origPath
                    }
                }
            }
        }
    }

    $authInfo = @{
        ApiKey = '3f5ab1e3a75b4830b25780cd0a772839'
        Url    = 'http://192.168.42.31:8096/Users/4fccdac58fd4477893a7f6acdb50bd71'
    }

    Get-TVLibrary -authInfo $authInfo | ForEach-Object {
        Read-Library -AuthInfo $authInfo -Library $_
    } | Format-Table -AutoSize
    « 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