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 adba error handling #4961

Merged
merged 9 commits into from
Sep 4, 2018
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- Fixed episode lookup with conflicting show IDs ([#4933](https://github.com/pymedusa/Medusa/pull/4933))
- Fixed error getting season scene exceptions on show page [#4964](https://github.com/pymedusa/Medusa/pull/4964)
- Fixed testing email notification with TLS ([#4972](https://github.com/pymedusa/Medusa/pull/4972))
- Fixed apiv2 call hanging, when opening an anime show, that has malformed data on anidb (with anidb enabled) ([#4961](https://github.com/pymedusa/Medusa/pull/4961))

-----

Expand Down
9 changes: 6 additions & 3 deletions ext/adba/aniDBlink.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,15 @@ def print_log_dummy(self, data):
def run(self):
while not self._quiting:
try:
data = self.sock.recv(8192).decode(encoding='UTF-8')
data = self.sock.recv(8192).decode('UTF-8')
except socket.timeout:
self._handle_timeouts()
continue
except OSError as e:
logging.exception('Exception: %s', e)
except OSError as error:
logging.exception('Exception: %s', error)
break
except UnicodeDecodeError as error:
logging.exception('Bad response from server: %s', error)
break
logging.debug("NetIO < %r", data)
try:
Expand Down
2 changes: 1 addition & 1 deletion ext/readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## ext
Status | Package | Version / Commit | Usage | Notes
:------: | :-------: | :----------------: | :---- | :----
:: | `adba` | pymedusa/[119b9d3](https://github.com/pymedusa/adba/tree/119b9d30a30feb97bcea5e1dc742c82340300091) | **`medusa`** | -
:: | `adba` | pymedusa/[70bc381](https://github.com/pymedusa/adba/tree/70bc381a75e20e1813c848c1edb7c6f16987397e) | **`medusa`** | -
:: | <code><b>appdirs</b>.py</code> | [1.4.3](https://pypi.org/project/appdirs/1.4.3/) | `subliminal` (cli only), `simpleanidb` | -
:: | `attrs` | [18.1.0](https://pypi.org/project/attrs/18.1.0/) | `imdbpie` | Module: `attr`
:: | `babelfish` | [f403000](https://github.com/Diaoul/babelfish/tree/f403000dd63092cfaaae80be9f309fd85c7f20c9) | **`medusa`**, `guessit`, `knowit`, `subliminal` | -
Expand Down
12 changes: 11 additions & 1 deletion medusa/tv/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
try_int,
)
from medusa.helper.exceptions import (
AnidbAdbaConnectionException,
CantRemoveShowException,
EpisodeDeletedException,
EpisodeNotFoundException,
Expand Down Expand Up @@ -2021,7 +2022,16 @@ def to_json(self, detailed=True):
if self.is_anime:
data['config']['release']['blacklist'] = bw_list.blacklist
data['config']['release']['whitelist'] = bw_list.whitelist
data['config']['release']['allgroups'] = get_release_groups_for_anime(self.name)
try:
data['config']['release']['allgroups'] = get_release_groups_for_anime(self.name)
except AnidbAdbaConnectionException as error:
data['config']['release']['allgroups'] = []
log.warning(
'An anidb adba exception occurred when attempting to get the release groups for the show {show}'
'\nError: {error}',
{'show': self.name, 'error': error}
)

data['config']['release']['ignoredWords'] = self.release_ignore_words
data['config']['release']['requiredWords'] = self.release_required_words

Expand Down