-
Notifications
You must be signed in to change notification settings - Fork 276
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
Fix adba error handling #4961
Conversation
This comment has been minimized.
This comment has been minimized.
Required because an exception can be raised when trying to get the release groups for an anime show.
833ea41
to
bc3c45e
Compare
medusa/tv/series.py
Outdated
data['config']['release']['allgroups'] = get_release_groups_for_anime(self.name) | ||
except AnidbAdbaConnectionException: | ||
log.warning('An anidb adba exception occurred when attempting to get the release groups for the show {show}', | ||
{'show': self.name}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking maybe return an empty list here if failed.
data['config']['release']['allgroups'] = []
medusa/tv/series.py
Outdated
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to log the error here? (as a debug log maybe)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought a warning is fitting. Then the user at least knows why its not getting any release groups when they are available in anidb.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
Return empty list in case of an exceptin.
aah I need to update adba again of course. I'll add the changelog. |
medusa/tv/series.py
Outdated
data['config']['release']['allgroups'] = [] | ||
log.debug( | ||
'An anidb adba exception occurred when attempting to get the release groups for the show {show}', | ||
{'show': self.name} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well it's not really what I meant,
I suggested you add the actual error to the log...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooh so make warning and add error?
ext/readme.md
Outdated
@@ -1,7 +1,7 @@ | |||
## ext | |||
Status | Package | Version / Commit | Usage | Notes | |||
:------: | :-------: | :----------------: | :---- | :---- | |||
:: | `adba` | pymedusa/[119b9d3](https://github.com/pymedusa/adba/tree/119b9d30a30feb97bcea5e1dc742c82340300091) | **`medusa`** | - | |||
:: | `adba` | pymedusa/[119b9d3](https://github.com/pymedusa/adba/tree/70bc381a75e20e1813c848c1edb7c6f16987397e) | **`medusa`** | - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- pymedusa/[119b9d3](https://github.com/pymedusa/adba/tree/70bc381a75e20e1813c848c1edb7c6f16987397e)
+ pymedusa/[70bc381](https://github.com/pymedusa/adba/tree/70bc381a75e20e1813c848c1edb7c6f16987397e)
Maybe I should just change the link to say pymedusa/[commit]
(literally) instead, it would be easier to update...
@sharkykh better? |
We might have to revisit it later - as |
Yeah thats in line with what i said before. That we should move this to a dedicated call. |
The show
How not to summon a demon lord
fails to get release group info from anidb.This is an anidb issue. As they are sending a bad response.
The problem was that 1. the adba lib, can't properly handle the UnicodeDecodeException.
And 2. the to_json of the Series class, was not handling the previously raised exception.
Note it still blocks the apiv2 tornado thread (which we currently only have 1) for a while. But after a few minutes it's given free again. The release groups retrieved (none), are cached in anidb.dbm, so you'll not have this error often (at least until cache expires).
Still need to have a proper solution for this.