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

Commit 358de67

Browse files
authored
Merge pull request #5 from MrZablah/update-config-renamer
[UPDATE] Renamer 5.3.7 and update sample config
2 parents 2a0d4d7 + bd7cd3d commit 358de67

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

config.sample.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -72,28 +72,22 @@ renamer:
7272
- Movies
7373
- TV Shows
7474
- Anime Movies
75-
# Where your ingest movies folder is (The source and destination should not be the same directory)
75+
# Where your ingest movies folder is (THe source and destination should not be the same directory)
7676
source_dir: /path/to/posters/ <--- Lowest priority
77-
# What posters you'd like to override the source dirs with.
78-
# This dir will take priority for assets over source_dir
79-
# To not use any override, leave it blank or remove it from the config
77+
# What posters you'd like to override the souce dir with. This dir will take priority for assets over source_dir
78+
# To not use any override, simply leave it blank or remove it from the config
8079
# Can be a single dir or a list of dirs
8180
source_overrides:
8281
- /path/to/posters/override/ <--- Middle priority
8382
- /path/to/posters/override2/ <--- Highest priority
84-
# Where your posters are going to go.
85-
# In my use case, I use Plex-Meta-Manager.
86-
# This is the /config/assets dir for PMM for me.
83+
# 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.
8784
destination_dir: /path/to/poster/destination
88-
# The thresholds are used to consider what is a "Match",
89-
# As with any automation, there is never a 100% guarantee of accuracy.
90-
# There will be times that script will mess up.
91-
# If, however, you see it messing up more often on things, you can restrict the threshold.
85+
# The thresholds are used to consider what is a "Match"
86+
# As with any automation there is never a 100% guarantee of accuracy.
87+
# There will be times the script will mess up.
88+
# If however you see it messing up more often on things you can restrict the threshold.
9289
# 0 = Anything goes, 100 = Must be exact match
9390
# 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.
94-
# Eg. Hanna vs Anna, One letter difference, and in the case I had the years were the same too.
95-
movies_threshold: 96
96-
series_threshold: 96
9791
collection_threshold: 99
9892
# Decide which radarr instance you will be using for renamer, this is useful if you have,
9993
# for example, A Sonarr/Sonarr-Anime and/or Radarr/Radarr-Anime

modules/renamer.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Description: This script will check for unmatched assets in your Plex library.
44
# It will output the results to a file in the logs folder.
55
# This is a modified version of the original script by Drazzilb:
6-
# Version: 5.3.6
6+
# Version: 5.3.7
77
# you can find the original script here: https://github.com/Drazzilb08/userScripts/blob/master/python-scripts/renamer.py
88
# ===================================================================================================
99

@@ -170,6 +170,11 @@ def match_media(media, source_file_list, type):
170170
alternate_titles = []
171171
normalized_alternate_titles = []
172172
arr_title = item['title']
173+
try:
174+
if item['originalTitle']:
175+
arr_title = item['originalTitle']
176+
except KeyError:
177+
pass
173178
arr_path = os.path.basename(item['path'])
174179
arr_path = year_regex.sub("", arr_path).strip()
175180
normalized_arr_path = normalize_titles(arr_path)
@@ -439,6 +444,7 @@ def normalize_titles(title):
439444
normalized_title = normalized_title.rstrip()
440445
normalized_title = normalized_title.replace('&', 'and')
441446
normalized_title = re.sub(remove_special_chars, '', normalized_title).lower()
447+
normalized_title = normalized_title.replace(' ', '')
442448
return normalized_title
443449

444450

0 commit comments

Comments
 (0)