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

Commit

Permalink
[UPDATE] renamer.py 6.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
MrZablah committed Dec 14, 2023
1 parent 643e587 commit 5c8b33c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 5 additions & 4 deletions modules/renamer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# you can find the original script here: https://github.com/Drazzilb08/userScripts/blob/master/python-scripts/renamer.py
# ===================================================================================================

script_version = "6.3.2"
script_version = "6.3.3"

from fuzzywuzzy import fuzz
from fuzzywuzzy import process
Expand Down Expand Up @@ -377,7 +377,7 @@ def rename_file(matched_media, destination_dir, dry_run, action_type, print_only
discord_messages.extend(discord_message)
if not asset_folders:
for i in discord_messages:
discord_messages = [i.split('.')[0] for i in discord_messages]
discord_messages = [os.path.splitext(i)[0] for i in discord_messages]
return messages, discord_messages


Expand Down Expand Up @@ -587,13 +587,14 @@ def process_instance(instance_type, instance_name, url, api, final_output, asset
collections += library.collections()
except BadRequest:
logger.error(f"Error: {library_name} does not exist in {instance_name}")
collection_names = [collection.title for collection in collections if collection.smart != True]
# collection_names = [collection.title for collection in collections if collection.smart != True]
collection_names = [collection.title for collection in collections]
logger.debug(json.dumps(collection_names, indent=4))
else:
message = f"Error: No library names specified for {instance_name}"
final_output.append(message)
return final_output, None
# get friendly name of plex server
# get freindlyname of plex server
server_name = app.friendlyName
data = [
[f"Plex Server: {server_name}"],
Expand Down
4 changes: 3 additions & 1 deletion utility/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ def load_config(self):
self.discord = config['discord']
except KeyError:
self.discord = {}
self.script_data = config.get(f'{self.script_name}', {})
self.script_data = config.get(f'{self.script_name}', None)
if self.script_data is None:
raise ValueError(f"Script data for '{self.script_name}' not found in the config.")

# Load config into instance variables
self.global_data = config['global']
Expand Down

0 comments on commit 5c8b33c

Please sign in to comment.