diff --git a/src/args.py b/src/args.py index 720be719..48629cdb 100644 --- a/src/args.py +++ b/src/args.py @@ -46,7 +46,6 @@ def parse(self, args, meta): parser.add_argument('--no-edition', dest='no_edition', action='store_true', required=False, help="Remove Edition from title") parser.add_argument('--dual-audio', dest='dual_audio', action='store_true', required=False, help="Add Dual-Audio to the title") parser.add_argument('-ns', '--no-seed', action='store_true', required=False, help="Do not add torrent to the client") - parser.add_argument('-year', '--year', dest='manual_year', nargs='?', required=False, help="Year", type=int, default=0) parser.add_argument('-ptp', '--ptp', nargs='*', required=False, help="PTP torrent id/permalink", type=str) parser.add_argument('-blu', '--blu', nargs='*', required=False, help="BLU torrent id/link", type=str) parser.add_argument('-aither', '--aither', nargs='*', required=False, help="Aither torrent id/link", type=str) diff --git a/src/clients.py b/src/clients.py index 08f0bbab..c6e1521a 100644 --- a/src/clients.py +++ b/src/clients.py @@ -334,8 +334,8 @@ async def qbittorrent(self, path, torrent, local_path, remote_path, client, is_d path = os.path.dirname(path) # Ensure remote path replacement and normalization - if path.startswith(local_path) and local_path.lower() != remote_path.lower(): - path = path.replace(local_path, remote_path, 1) + if local_path.lower() in path.lower() and local_path.lower() != remote_path.lower(): + path = path.replace(local_path, remote_path) path = path.replace(os.sep, '/') # Ensure trailing slash for qBittorrent @@ -362,15 +362,13 @@ async def qbittorrent(self, path, torrent, local_path, remote_path, client, is_d auto_management = False am_config = client.get('automatic_management_paths', '') if isinstance(am_config, list): - auto_management = any( - os.path.normpath(each).lower() in os.path.normpath(path).lower() - for each in am_config - ) - elif am_config.strip(): - auto_management = os.path.normpath(am_config).lower() in os.path.normpath(path).lower() - - # Set qBittorrent category and content layout - qbt_category = meta.get("qbit_cat", client.get("qbit_cat")) + for each in am_config: + if os.path.normpath(each).lower() in os.path.normpath(path).lower(): + auto_management = True + else: + if os.path.normpath(am_config).lower() in os.path.normpath(path).lower() and am_config.strip() != "": + auto_management = True + qbt_category = client.get("qbit_cat") if not meta.get("qbit_cat") else meta.get('qbit_cat') content_layout = client.get('content_layout', 'Original') # Add the torrent