From f0ce11572f63e3f02ea2a6b5753fc96cc69a6fc6 Mon Sep 17 00:00:00 2001 From: bobokun Date: Fri, 20 May 2022 17:19:12 -0400 Subject: [PATCH 1/8] 3.2.4 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 06eda28..9b7a431 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.2.3 \ No newline at end of file +3.2.4 \ No newline at end of file From edbeec5e2a37083ccebb5381ba5e69494136c2ab Mon Sep 17 00:00:00 2001 From: bobokun Date: Fri, 20 May 2022 17:19:41 -0400 Subject: [PATCH 2/8] potential fix for windows --- modules/qbittorrent.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/qbittorrent.py b/modules/qbittorrent.py index 70cb4f8..5fbc479 100644 --- a/modules/qbittorrent.py +++ b/modules/qbittorrent.py @@ -766,6 +766,9 @@ class Qbt: torrent_list = self.get_torrents({'sort': 'added_on'}) for torrent in alive_it(torrent_list): for file in torrent.files: + fullpath = os.path.join(torrent.save_path, file.name) + # Replace fullpath with \\ if qbm is runnig in docker (linux) but qbt is on windows + fullpath = fullpath.replace(r'/', '\\') if ':\\' in fullpath else fullpath torrent_files.append(os.path.join(torrent.save_path, file.name)) orphaned_files = set(root_files) - set(torrent_files) From 7712dff9bfbe8984b80c253dbf8ecb5fbe855ae9 Mon Sep 17 00:00:00 2001 From: bobokun Date: Fri, 20 May 2022 17:36:45 -0400 Subject: [PATCH 3/8] Fixes windows path error #127 --- modules/config.py | 20 ++++++++++---------- modules/qbittorrent.py | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/config.py b/modules/config.py index e596fa8..1fa6acd 100644 --- a/modules/config.py +++ b/modules/config.py @@ -203,7 +203,7 @@ class Config: self.cross_seed_dir = self.util.check_for_attribute(self.data, "cross_seed", parent="directory", default_is_none=True) if self.recyclebin['enabled']: if "recycle_bin" in self.data["directory"] and self.data["directory"]["recycle_bin"] is not None: - default_recycle = os.path.join(self.remote_dir, os.path.basename(self.data['directory']['recycle_bin'].rstrip('/'))) + default_recycle = os.path.join(self.remote_dir, os.path.basename(self.data['directory']['recycle_bin'].rstrip(os.sep))) else: default_recycle = os.path.join(self.remote_dir, '.RecycleBin') if self.recyclebin['split_by_category']: @@ -229,7 +229,7 @@ class Config: self.orphaned = {} self.orphaned['exclude_patterns'] = self.util.check_for_attribute(self.data, "exclude_patterns", parent="orphaned", var_type="list", default_is_none=True, do_print=False) if self.recyclebin['enabled']: - exclude_recycle = f"**/{os.path.basename(self.recycle_dir.rstrip('/'))}/*" + exclude_recycle = f"**{os.sep}{os.path.basename(self.recycle_dir.rstrip(os.sep))}{os.sep}*" self.orphaned['exclude_patterns'].append(exclude_recycle) if exclude_recycle not in self.orphaned['exclude_patterns'] else self.orphaned['exclude_patterns'] # Connect to Qbittorrent @@ -257,7 +257,7 @@ class Config: tracker['url'] = None if not urls: return tracker try: - tracker['url'] = util.trunc_val(urls[0], '/') + tracker['url'] = util.trunc_val(urls[0], os.sep) except IndexError as e: tracker['url'] = None logger.debug(f"Tracker Url:{urls}") @@ -268,8 +268,8 @@ class Config: for url in urls: if tag_url in url: try: - tracker['url'] = util.trunc_val(url, '/') - default_tag = tracker['url'].split('/')[2].split(':')[0] + tracker['url'] = util.trunc_val(url, os.sep) + default_tag = tracker['url'].split(os.sep)[2].split(':')[0] except IndexError as e: logger.debug(f"Tracker Url:{url}") logger.debug(e) @@ -296,7 +296,7 @@ class Config: tracker['notifiarr'] = self.util.check_for_attribute(self.data, "notifiarr", parent="tracker", subparent=tag_url, default_is_none=True, do_print=False, save=False) return (tracker) if tracker['url']: - default_tag = tracker['url'].split('/')[2].split(':')[0] + default_tag = tracker['url'].split(os.sep)[2].split(':')[0] tracker['tag'] = self.util.check_for_attribute(self.data, "tag", parent="tracker", subparent=default_tag, default=default_tag, var_type="list") if isinstance(tracker['tag'], str): tracker['tag'] = [tracker['tag']] try: @@ -320,7 +320,7 @@ class Config: break if not category: - default_cat = path.split('/')[-2] + default_cat = path.split(os.sep)[-2] category = str(default_cat) self.util.check_for_attribute(self.data, default_cat, parent="cat", default=path) self.data['cat'][str(default_cat)] = path @@ -341,7 +341,7 @@ class Config: if self.recyclebin['split_by_category']: if "cat" in self.data and self.data["cat"] is not None: save_path = list(self.data["cat"].values()) - cleaned_save_path = [os.path.join(s.replace(self.root_dir, self.remote_dir), os.path.basename(self.recycle_dir.rstrip('/'))) for s in save_path] + cleaned_save_path = [os.path.join(s.replace(self.root_dir, self.remote_dir), os.path.basename(self.recycle_dir.rstrip(os.sep))) for s in save_path] recycle_path = [self.recycle_dir] for dir in cleaned_save_path: if os.path.exists(dir): recycle_path.append(dir) @@ -359,7 +359,7 @@ class Config: util.separator(f"Emptying Recycle Bin (Files > {self.recyclebin['empty_after_x_days']} days)", space=True, border=True) prevfolder = '' for file in recycle_files: - folder = re.search(f".*{os.path.basename(self.recycle_dir.rstrip('/'))}", file).group(0) + folder = re.search(f".*{os.path.basename(self.recycle_dir.rstrip(os.sep))}", file).group(0) if folder != prevfolder: body += util.separator(f"Searching: {folder}", space=False, border=False) fileStats = os.stat(file) filename = os.path.basename(file) @@ -372,7 +372,7 @@ class Config: files += [str(filename)] size_bytes += os.path.getsize(file) if not dry_run: os.remove(file) - prevfolder = re.search(f".*{os.path.basename(self.recycle_dir.rstrip('/'))}", file).group(0) + prevfolder = re.search(f".*{os.path.basename(self.recycle_dir.rstrip(os.sep))}", file).group(0) if num_del > 0: if not dry_run: for path in recycle_path: diff --git a/modules/qbittorrent.py b/modules/qbittorrent.py index 5fbc479..6af9b50 100644 --- a/modules/qbittorrent.py +++ b/modules/qbittorrent.py @@ -835,7 +835,7 @@ class Qbt: return if self.config.recyclebin['split_by_category']: - recycle_path = os.path.join(save_path, os.path.basename(self.config.recycle_dir.rstrip('/'))) + recycle_path = os.path.join(save_path, os.path.basename(self.config.recycle_dir.rstrip(os.sep))) else: recycle_path = self.config.recycle_dir # Create recycle bin if not exists From d1947e44dc676fc3cafbc3e1fedb4b9ac12b69df Mon Sep 17 00:00:00 2001 From: bobokun Date: Fri, 20 May 2022 18:15:20 -0400 Subject: [PATCH 4/8] minor fix --- modules/qbittorrent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/qbittorrent.py b/modules/qbittorrent.py index 6af9b50..4b9a33b 100644 --- a/modules/qbittorrent.py +++ b/modules/qbittorrent.py @@ -769,7 +769,7 @@ class Qbt: fullpath = os.path.join(torrent.save_path, file.name) # Replace fullpath with \\ if qbm is runnig in docker (linux) but qbt is on windows fullpath = fullpath.replace(r'/', '\\') if ':\\' in fullpath else fullpath - torrent_files.append(os.path.join(torrent.save_path, file.name)) + torrent_files.append(fullpath) orphaned_files = set(root_files) - set(torrent_files) orphaned_files = sorted(orphaned_files) From f9600e83fc8a0f10ef7cd30e0f17416acbc5bab3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Jun 2022 00:44:00 +0000 Subject: [PATCH 5/8] Bump requests from 2.27.1 to 2.28.0 Bumps [requests](https://github.com/psf/requests) from 2.27.1 to 2.28.0. - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md) - [Commits](https://github.com/psf/requests/compare/v2.27.1...v2.28.0) --- updated-dependencies: - dependency-name: requests dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 4f8fae9..cdf3c02 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,4 @@ qbittorrent-api>=2022.5.32 schedule==1.1.0 retrying==1.3.3 alive_progress==2.4.1 -requests==2.27.1 +requests==2.28.0 From 397698a80245402e0993772448d921530bf12604 Mon Sep 17 00:00:00 2001 From: bobokun Date: Thu, 16 Jun 2022 08:43:52 -0400 Subject: [PATCH 6/8] Fixes #136 Check ignore list when del unregistered torrents --- modules/qbittorrent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/qbittorrent.py b/modules/qbittorrent.py index 4b9a33b..afbb2ac 100644 --- a/modules/qbittorrent.py +++ b/modules/qbittorrent.py @@ -564,7 +564,7 @@ class Qbt: del_unregistered() break tag_tracker_error() - if list_in_text(msg_up, unreg_msgs) and x.status == 4: + if list_in_text(msg_up, unreg_msgs) and not list_in_text(msg_up, ignore_msgs) and x.status == 4: del_unregistered() break except NotFound404Error: From be6bfe86173cee4ead6080f6ca47e58b21262c86 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 Jun 2022 00:40:37 +0000 Subject: [PATCH 7/8] Bump requests from 2.28.0 to 2.28.1 Bumps [requests](https://github.com/psf/requests) from 2.28.0 to 2.28.1. - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md) - [Commits](https://github.com/psf/requests/compare/v2.28.0...v2.28.1) --- updated-dependencies: - dependency-name: requests dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index cdf3c02..02c1dc0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,4 @@ qbittorrent-api>=2022.5.32 schedule==1.1.0 retrying==1.3.3 alive_progress==2.4.1 -requests==2.28.0 +requests==2.28.1 From bb70bf14ea1c1bedaa543dcf620f583be73507a2 Mon Sep 17 00:00:00 2001 From: bobokun Date: Sat, 13 Aug 2022 10:15:45 -0400 Subject: [PATCH 8/8] update requirements --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index cdf3c02..1ec9fdb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ ruamel.yaml==0.17.21 -qbittorrent-api>=2022.5.32 +qbittorrent-api>=2022.8.34 schedule==1.1.0 retrying==1.3.3 alive_progress==2.4.1