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

Commit 5c8b33c

Browse files
committed
[UPDATE] renamer.py 6.3.3
1 parent 643e587 commit 5c8b33c

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

modules/renamer.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# you can find the original script here: https://github.com/Drazzilb08/userScripts/blob/master/python-scripts/renamer.py
77
# ===================================================================================================
88

9-
script_version = "6.3.2"
9+
script_version = "6.3.3"
1010

1111
from fuzzywuzzy import fuzz
1212
from fuzzywuzzy import process
@@ -377,7 +377,7 @@ def rename_file(matched_media, destination_dir, dry_run, action_type, print_only
377377
discord_messages.extend(discord_message)
378378
if not asset_folders:
379379
for i in discord_messages:
380-
discord_messages = [i.split('.')[0] for i in discord_messages]
380+
discord_messages = [os.path.splitext(i)[0] for i in discord_messages]
381381
return messages, discord_messages
382382

383383

@@ -587,13 +587,14 @@ def process_instance(instance_type, instance_name, url, api, final_output, asset
587587
collections += library.collections()
588588
except BadRequest:
589589
logger.error(f"Error: {library_name} does not exist in {instance_name}")
590-
collection_names = [collection.title for collection in collections if collection.smart != True]
590+
# collection_names = [collection.title for collection in collections if collection.smart != True]
591+
collection_names = [collection.title for collection in collections]
591592
logger.debug(json.dumps(collection_names, indent=4))
592593
else:
593594
message = f"Error: No library names specified for {instance_name}"
594595
final_output.append(message)
595596
return final_output, None
596-
# get friendly name of plex server
597+
# get freindlyname of plex server
597598
server_name = app.friendlyName
598599
data = [
599600
[f"Plex Server: {server_name}"],

utility/config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ def load_config(self):
2121
self.discord = config['discord']
2222
except KeyError:
2323
self.discord = {}
24-
self.script_data = config.get(f'{self.script_name}', {})
24+
self.script_data = config.get(f'{self.script_name}', None)
25+
if self.script_data is None:
26+
raise ValueError(f"Script data for '{self.script_name}' not found in the config.")
2527

2628
# Load config into instance variables
2729
self.global_data = config['global']

0 commit comments

Comments
 (0)