-
Notifications
You must be signed in to change notification settings - Fork 275
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
Normalize show status while loading from indexer #2609
Conversation
medusa/indexers/indexer_config.py
Outdated
'in production': 'Continuing', | ||
'pilot': 'Continuing', | ||
'cancelled': 'Ended', | ||
'': 'Unknown', |
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 don't think you need this. This is redundant now.
medusa/tv/series.py
Outdated
def normalize_status(series_status): | ||
"""Return a normalized status given current indexer status.""" | ||
if not series_status: | ||
return 'Unknown' |
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.
Or we use this as default unknown status. Or we put it in the STATUS_MAP. So this could be a little bit more DRY.
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.
But if series_status is None I can't make it lower() as i do in the next line
So what to do?
medusa/tv/series.py
Outdated
@staticmethod | ||
def normalize_status(series_status): | ||
"""Return a normalized status given current indexer status.""" | ||
return STATUS_MAP.get(series_status.lower()) if series_status else 'Unknown' |
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.
This will return None if the status is not in the map. Are you sure this is wanted?
This causes all TheTVDB shows to be set to Unknown (try a force update). @fernandog |
@medariox @p0psicles