Skip to content

Commit

Permalink
[build] Upgrade search fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Feramance committed Nov 15, 2023
1 parent a11f487 commit 1195b9b
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 51 deletions.
28 changes: 10 additions & 18 deletions qBitrr/arss.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,26 +673,20 @@ def _get_oversee_requests_all(self) -> dict[str, set]:
data["TmdbId"].add(tmdbId)
self._temp_overseer_request_cache = data
except requests.exceptions.ConnectionError:
return self._extracted_from__get_oversee_requests_all_85(
"Couldn't connect to Overseerr"
)
self.logger.warning("Couldn't connect to Overseerr")
self._temp_overseer_request_cache = defaultdict(set)
return self._temp_overseer_request_cache
except requests.exceptions.ReadTimeout:
return self._extracted_from__get_oversee_requests_all_85(
"Connection to Overseerr timed out"
)
self.logger.warning("Connection to Overseerr timed out")
self._temp_overseer_request_cache = defaultdict(set)
return self._temp_overseer_request_cache
except Exception as e:
self.logger.exception(e, exc_info=sys.exc_info())
self._temp_overseer_request_cache = defaultdict(set)
return self._temp_overseer_request_cache
else:
return self._temp_overseer_request_cache

# TODO Rename this here and in `_get_oversee_requests_all`
def _extracted_from__get_oversee_requests_all_85(self, arg0):
self.logger.warning(arg0)
self._temp_overseer_request_cache = defaultdict(set)
return self._temp_overseer_request_cache

def _get_overseerr_requests_count(self) -> int:
self._get_oversee_requests_all()
if self.type == "sonarr":
Expand Down Expand Up @@ -1161,6 +1155,10 @@ def db_maybe_reset_entry_searched_state(self):
self.loop_completed = False

def db_reset__series_searched_state(self):
if self.version.major == 3:
self.model_arr_series_file: SeriesModel
elif self.version.major == 4:
self.model_arr_series_file: SeriesModelv4
self.series_file_model: SeriesFilesModel
self.model_file: EpisodeFilesModel
if (
Expand Down Expand Up @@ -1303,19 +1301,13 @@ def db_get_files_movies(
else:
condition &= self.model_file.MovieFileId == 0
condition &= self.model_file.Searched == False
else:
condition &= self.model_file.MovieFileId == 0
condition &= self.model_file.Searched == False
else:
if not self.do_upgrade_search:
if self.quality_unmet_search:
condition = self.model_file.QualityMet == False
else:
condition = self.model_file.MovieFileId == 0
condition &= self.model_file.Searched == False
else:
condition = self.model_file.MovieFileId == 0
condition &= self.model_file.Searched == False
for entry in (
self.model_file.select()
.where(condition)
Expand Down
7 changes: 4 additions & 3 deletions qBitrr2.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: qBitrr2
Version: 3.7.10b2
Version: 3.7.16
Summary: "A simple Python script to talk to qBittorrent and Arr's"
Home-page: https://github.com/Feramance/qBitrr
Author: Feramance
Expand Down Expand Up @@ -115,7 +115,7 @@ A simple script to monitor [qBit](https://github.com/qbittorrent/qBittorrent) an

Some things to know before using it.

- qBittorrent 4.5.x
- qBittorrent >= 4.5.x
- [Sonarr](https://github.com/Sonarr/Sonarr) and [Radarr](https://github.com/Radarr/Radarr) both setup to add tags to all downloads.
- qBit set to create sub-folders for tag.

Expand Down Expand Up @@ -215,6 +215,7 @@ services:
- sonarr-1080p
- sonarr-anime
- overseerr
- ombi
```

##### Important mentions for docker
Expand All @@ -229,4 +230,4 @@ Please do not hesitate to open an issue for feature requests or any suggestions

## Reporting an Issue

When reporting an issue, please ensure that log files are enabled while running qBitrr and attach them to the issue. Thank you
When reporting an issue, please ensure that log files are enabled while running qBitrr and attach them to the issue. Thank you.
18 changes: 8 additions & 10 deletions requirements.all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ certifi==2023.7.22
# via requests
cfgv==3.4.0
# via pre-commit
charset-normalizer==3.3.1
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via
Expand All @@ -47,13 +47,13 @@ environ-config==23.2.0
# via qBitrr2 (setup.py)
ffmpeg-python==0.2.0
# via qBitrr2 (setup.py)
filelock==3.12.4
filelock==3.13.1
# via virtualenv
future==0.18.3
# via ffmpeg-python
humanfriendly==10.0
# via coloredlogs
identify==2.5.30
identify==2.5.31
# via pre-commit
idna==3.4
# via requests
Expand All @@ -69,9 +69,9 @@ jaraco-context==4.3.0
# via jaraco-docker
jaraco-docker==2.0
# via qBitrr2 (setup.py)
jaraco-functools==3.9.0
jaraco-functools==4.0.0
# via jaraco-docker
keyring==24.2.0
keyring==24.3.0
# via twine
more-itertools==10.1.0
# via
Expand Down Expand Up @@ -171,20 +171,18 @@ twine==3.7.1
# via qBitrr2 (setup.py)
types-requests==2.31.0.10
# via pyarr
typing-extensions==4.8.0
# via jaraco-functools
ujson==5.4.0
# via qBitrr2 (setup.py)
upgrade-pip==0.1.4
# via qBitrr2 (setup.py)
urllib3==2.0.7
urllib3==2.1.0
# via
# qbittorrent-api
# requests
# types-requests
virtualenv==20.24.5
virtualenv==20.24.6
# via pre-commit
wheel==0.41.2
wheel==0.41.3
# via pip-tools
zipp==3.17.0
# via importlib-metadata
Expand Down
18 changes: 8 additions & 10 deletions requirements.dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ certifi==2023.7.22
# via requests
cfgv==3.4.0
# via pre-commit
charset-normalizer==3.3.1
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via
Expand All @@ -47,13 +47,13 @@ environ-config==23.2.0
# via qBitrr2 (setup.py)
ffmpeg-python==0.2.0
# via qBitrr2 (setup.py)
filelock==3.12.4
filelock==3.13.1
# via virtualenv
future==0.18.3
# via ffmpeg-python
humanfriendly==10.0
# via coloredlogs
identify==2.5.30
identify==2.5.31
# via pre-commit
idna==3.4
# via requests
Expand All @@ -69,9 +69,9 @@ jaraco-context==4.3.0
# via jaraco-docker
jaraco-docker==2.0
# via qBitrr2 (setup.py)
jaraco-functools==3.9.0
jaraco-functools==4.0.0
# via jaraco-docker
keyring==24.2.0
keyring==24.3.0
# via twine
more-itertools==10.1.0
# via
Expand Down Expand Up @@ -171,20 +171,18 @@ twine==3.7.1
# via qBitrr2 (setup.py)
types-requests==2.31.0.10
# via pyarr
typing-extensions==4.8.0
# via jaraco-functools
ujson==5.4.0
# via qBitrr2 (setup.py)
upgrade-pip==0.1.4
# via qBitrr2 (setup.py)
urllib3==2.0.7
urllib3==2.1.0
# via
# qbittorrent-api
# requests
# types-requests
virtualenv==20.24.5
virtualenv==20.24.6
# via pre-commit
wheel==0.41.2
wheel==0.41.3
# via pip-tools
zipp==3.17.0
# via importlib-metadata
Expand Down
8 changes: 3 additions & 5 deletions requirements.fast.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cachetools==4.2.4
# via qBitrr2 (setup.py)
certifi==2023.7.22
# via requests
charset-normalizer==3.3.1
charset-normalizer==3.3.2
# via requests
colorama==0.4.4
# via qBitrr2 (setup.py)
Expand All @@ -34,7 +34,7 @@ jaraco-context==4.3.0
# via jaraco-docker
jaraco-docker==2.0
# via qBitrr2 (setup.py)
jaraco-functools==3.9.0
jaraco-functools==4.0.0
# via jaraco-docker
more-itertools==10.1.0
# via jaraco-functools
Expand Down Expand Up @@ -75,11 +75,9 @@ tomlkit==0.7.2
# via qBitrr2 (setup.py)
types-requests==2.31.0.10
# via pyarr
typing-extensions==4.8.0
# via jaraco-functools
ujson==5.4.0
# via qBitrr2 (setup.py)
urllib3==2.0.7
urllib3==2.1.0
# via
# qbittorrent-api
# requests
Expand Down
8 changes: 3 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cachetools==4.2.4
# via qBitrr2 (setup.py)
certifi==2023.7.22
# via requests
charset-normalizer==3.3.1
charset-normalizer==3.3.2
# via requests
colorama==0.4.4
# via qBitrr2 (setup.py)
Expand All @@ -34,7 +34,7 @@ jaraco-context==4.3.0
# via jaraco-docker
jaraco-docker==2.0
# via qBitrr2 (setup.py)
jaraco-functools==3.9.0
jaraco-functools==4.0.0
# via jaraco-docker
more-itertools==10.1.0
# via jaraco-functools
Expand Down Expand Up @@ -75,9 +75,7 @@ tomlkit==0.7.2
# via qBitrr2 (setup.py)
types-requests==2.31.0.10
# via pyarr
typing-extensions==4.8.0
# via jaraco-functools
urllib3==2.0.7
urllib3==2.1.0
# via
# qbittorrent-api
# requests
Expand Down

0 comments on commit 1195b9b

Please sign in to comment.