Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix file write encoding errors #203

Open
wants to merge 16 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion extra-scripts/backup_appdata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ create_backup() {
# Create the backup file name
backup_file="$(realpath -s "$destination_dir")/$(date +%F)@$now/$container_name"
# Go to the source directory
# Check if source_dir is a directory, if not, strip the filename
if [ ! -d "$source_dir" ]; then
source_dir=$(dirname "$source_dir")
fi
cd "$source_dir"/.. || return
# Get the name of the source directory
source_dir=$(basename "$source_dir")
Expand Down Expand Up @@ -980,4 +984,4 @@ main() {
fi
}

main
main
1 change: 0 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ def main():
old_schedule = None
running_scripts = {}
waiting_message_shown = False
scripts_schedules=load_schedule()
if len(sys.argv) > 1:
for input_name in sys.argv[1:]:
if input_name in list_of_bash_scripts or input_name in list_of_python_scripts:
Expand Down
9 changes: 5 additions & 4 deletions modules/bash_scripts.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import shlex
import json
import pathlib
import shlex
import sys
from util.config import Config

from util.call_script import *
from util.discord import get_discord_data, discord_check
from util.utility import create_bar
from util.logger import setup_logger
import pathlib
from util.utility import create_bar


def set_cmd_args(settings, bash_script_file, logger, script_name):
"""
Expand Down
9 changes: 3 additions & 6 deletions modules/border_replacerr.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,14 @@
# License: MIT License
# =================================================================================

import os
import json
import re
import logging
import filecmp
import logging
import shutil
import sys

from util.utility import *
from util.scheduler import check_schedule
from util.logger import setup_logger
from util.scheduler import check_schedule
from util.utility import *

try:
from tqdm import tqdm
Expand Down
5 changes: 1 addition & 4 deletions modules/health_checkarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,11 @@
# License: MIT License
# ===================================================================================================

import json
import re
import sys

from util.arrpy import StARR
from util.utility import *
from util.discord import discord
from util.logger import setup_logger
from util.utility import *

try:
from tqdm import tqdm
Expand Down
10 changes: 4 additions & 6 deletions modules/labelarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@
# License: MIT License
# ======================================================================================

import json
import time
import sys
import time

from util.discord import discord, discord_check
from util.arrpy import StARR
from util.utility import *
from util.discord import discord, discord_check
from util.logger import setup_logger
import re
from util.utility import *

try:
from plexapi.server import PlexServer
from plexapi.exceptions import BadRequest
Expand Down
5 changes: 1 addition & 4 deletions modules/nohl.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@
# License: MIT License
# ===================================================================================================

import os
import re
import sys
import json

from util.arrpy import StARR
from util.discord import discord, discord_check
from util.utility import *
from util.logger import setup_logger
from util.utility import *

try:
from tqdm import tqdm
Expand Down
6 changes: 1 addition & 5 deletions modules/poster_cleanarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,12 @@
# License: MIT License
# ===========================================================================================================

import os
import re
import json
import logging
import shutil
import sys

from util.utility import *
from util.arrpy import StARR
from util.logger import setup_logger
from util.utility import *

try:
from plexapi.server import PlexServer
Expand Down
14 changes: 7 additions & 7 deletions modules/poster_renamerr.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,16 @@
# License: MIT License
# ===================================================================================================

import os
import sys
import re
import json
import filecmp
import json
import shutil
import sys
import time

from util.utility import *
from util.discord import discord, discord_check
from util.arrpy import StARR
from util.discord import discord, discord_check
from util.logger import setup_logger
from util.utility import *

try:
from plexapi.server import PlexServer
Expand Down Expand Up @@ -58,10 +56,12 @@ def get_assets_files(source_dirs, logger):

# Iterate through each source directory
for source_dir in source_dirs:
logger.debug(f"Getting asset files for: {source_dir}")
new_assets = categorize_files(source_dir)
if new_assets:
# Merge new_assets with final_assets
for new in new_assets:
logger.debug(f"Processing asset: {new}")
found_match = False
for final in final_assets:
if final['normalized_title'] == new['normalized_title'] and final['year'] == new['year']:
Expand Down Expand Up @@ -601,7 +601,7 @@ def main(config):
from modules.sync_gdrive import main as gdrive_main
from util.config import Config
gdrive_config = Config("sync_gdrive")
gdrive_main(gdrive_config, logger)
gdrive_main(gdrive_config)
logger.info(f"Finished running sync_gdrive")
else:
logger.debug(f"Sync posters is disabled. Skipping...")
Expand Down
4 changes: 1 addition & 3 deletions modules/renameinatorr.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,14 @@
# Requirements: requests, pyyaml
# License: MIT License
# ===================================================================================================

import json
import re
import sys
import time

from util.arrpy import StARR
from util.utility import *
from util.discord import discord, discord_check
from util.logger import setup_logger
from util.utility import *

try:
from tqdm import tqdm
Expand Down
Loading