Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #5 from MrZablah/update-config-renamer
Browse files Browse the repository at this point in the history
[UPDATE] Renamer 5.3.7 and update sample config
  • Loading branch information
MrZablah authored Nov 13, 2023
2 parents 2a0d4d7 + bd7cd3d commit 358de67
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
22 changes: 8 additions & 14 deletions config.sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,28 +72,22 @@ renamer:
- Movies
- TV Shows
- Anime Movies
# Where your ingest movies folder is (The source and destination should not be the same directory)
# Where your ingest movies folder is (THe source and destination should not be the same directory)
source_dir: /path/to/posters/ <--- Lowest priority
# What posters you'd like to override the source dirs with.
# This dir will take priority for assets over source_dir
# To not use any override, leave it blank or remove it from the config
# What posters you'd like to override the souce dir with. This dir will take priority for assets over source_dir
# To not use any override, simply leave it blank or remove it from the config
# Can be a single dir or a list of dirs
source_overrides:
- /path/to/posters/override/ <--- Middle priority
- /path/to/posters/override2/ <--- Highest priority
# Where your posters are going to go.
# In my use case, I use Plex-Meta-Manager.
# This is the /config/assets dir for PMM for me.
# Where your posters are going to go. In my usecase I use Plex-Meta-Manager. This is the /config/assets dir for PMM for me.
destination_dir: /path/to/poster/destination
# The thresholds are used to consider what is a "Match",
# As with any automation, there is never a 100% guarantee of accuracy.
# There will be times that script will mess up.
# If, however, you see it messing up more often on things, you can restrict the threshold.
# The thresholds are used to consider what is a "Match"
# As with any automation there is never a 100% guarantee of accuracy.
# There will be times the script will mess up.
# If however you see it messing up more often on things you can restrict the threshold.
# 0 = Anything goes, 100 = Must be exact match
# The default numbers here are based upon what I've seen to be the most effective, I've had one-offs where I had to manually fix things.
# Eg. Hanna vs Anna, One letter difference, and in the case I had the years were the same too.
movies_threshold: 96
series_threshold: 96
collection_threshold: 99
# Decide which radarr instance you will be using for renamer, this is useful if you have,
# for example, A Sonarr/Sonarr-Anime and/or Radarr/Radarr-Anime
Expand Down
8 changes: 7 additions & 1 deletion modules/renamer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Description: This script will check for unmatched assets in your Plex library.
# It will output the results to a file in the logs folder.
# This is a modified version of the original script by Drazzilb:
# Version: 5.3.6
# Version: 5.3.7
# you can find the original script here: https://github.com/Drazzilb08/userScripts/blob/master/python-scripts/renamer.py
# ===================================================================================================

Expand Down Expand Up @@ -170,6 +170,11 @@ def match_media(media, source_file_list, type):
alternate_titles = []
normalized_alternate_titles = []
arr_title = item['title']
try:
if item['originalTitle']:
arr_title = item['originalTitle']
except KeyError:
pass
arr_path = os.path.basename(item['path'])
arr_path = year_regex.sub("", arr_path).strip()
normalized_arr_path = normalize_titles(arr_path)
Expand Down Expand Up @@ -439,6 +444,7 @@ def normalize_titles(title):
normalized_title = normalized_title.rstrip()
normalized_title = normalized_title.replace('&', 'and')
normalized_title = re.sub(remove_special_chars, '', normalized_title).lower()
normalized_title = normalized_title.replace(' ', '')
return normalized_title


Expand Down

0 comments on commit 358de67

Please sign in to comment.