rycochet/plex-find-mismatch

By rycochet

Updated over 1 year ago

Finds incorrectly matched media folders in Plex

Image
Data science
0

276

rycochet/plex-find-mismatch repository overview

plex-find-mismatch

GitHub Actions Workflow Status GitHub contributors Docker Pulls Docker Image Size

Finds incorrectly matched media folders in Plex. This requires you to include the TVDB, TMDB, or IMDB id in the folder path as per the Plex (and TRaSH guide) recommendations.

Specifically include {tvdb-<TVDB id>} / {tvdb-<TMDB id>} / {imdb-<IMDB id>} in the folder path for the TV Show or Movie, and this script will tell you when Plex is matching against the wrong source.

Note

While the IMDB is a single consistent id, the others get more data from the general public and as such you may have some media matched against a removed ID - generally the more recently an entry is made to them the more likely two (or more) have been added, and the duplicates will be removed. This only checks if Plex matches the folder name, but Plex itself will remove a link if that gets removed!

Running

Python

This is a standard Python script, and should be run however you would normally run anything with Python. It requires python-plexapi, python_dotenv, and schedule installed and available.

Docker

This is designed to be used via Docker / Docker Compose, all options are available via environmental variables, with sensible defaults.

services:
  plex-find-mismatch:
    image: rycochet/plex-find-mismatch:latest
    network_mode: host # Ensure this has access to plex
    environment:
      PLEX_TOKEN: "YOURTOKENVALUEHERE"
    volumes:
      # Copy the same media paths you supply to Plex

Environment Variables

NameDefinitionDefault
PLEX_TOKEN or
PLEX_TOKEN_FILE [^1]
Required
A Plex authentication token (see the Plex docs)
PLEX_URLThe URL to access Plex on.http://localhost:32400
LOG_LEVELHow much to log. All mismatches are WARNING, so all other information can be hidden easily hidden. Must be one of DEBUG, INFO, WARNING, or ERROR.DEBUG
CHECK_ADD_LABELShould a label be added to the item within Plex. This makes it easy to add a filter for the specific FixMatch label.true
CHECK_UNMATCHThis will force Plex to unmatch, but can't help Plex to find the correct match. It is useful to stop Plex from serving up incorrect information, but still need manual correction.true
CHECK_NOWIf set then this will run once and then quit.true if running in a shell
CHECK_ATTime(s) to check every day. By default this checks half an hour after Plex does it's daily udates, but you can supply a list of comma separate times for multiple checks.06:30
CHECK_AGENTSA comma separated list of agents to check against.tvdb,tmdb,imdb
CHECK_LIBRARYA comma separated list of (case insensitive) Plex library names to check. By default it will look at all libraries by using a * wildcard, but this can optimise performance slightly.*
CHECK_PATH<n> *and CHECK_PATH<n>_REPLACEPaired paths for replacing from the Plex config. This is most useful when running in a shell and the path mappings are different. Note that you may only include nine (9) at most.

Tag summary

Content type

Image

Digest

sha256:23422b379

Size

20.7 MB

Last updated

over 1 year ago

docker pull rycochet/plex-find-mismatch