diff --git a/config.sample.yml b/config.sample.yml index 380f442..0ffda76 100644 --- a/config.sample.yml +++ b/config.sample.yml @@ -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 diff --git a/modules/renamer.py b/modules/renamer.py index 3eeea6f..c0107f3 100644 --- a/modules/renamer.py +++ b/modules/renamer.py @@ -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 # =================================================================================================== @@ -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) @@ -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