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

Normalize show status while loading from indexer #2609

Merged
merged 4 commits into from
Apr 20, 2017

Conversation

fernandog
Copy link
Contributor

medariox
medariox previously approved these changes Apr 19, 2017
@medariox medariox dismissed their stale review April 19, 2017 17:47

Waiting for p0ps

'in production': 'Continuing',
'pilot': 'Continuing',
'cancelled': 'Ended',
'': 'Unknown',
Copy link
Contributor

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.

def normalize_status(series_status):
"""Return a normalized status given current indexer status."""
if not series_status:
return 'Unknown'
Copy link
Contributor

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.

Copy link
Contributor Author

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?

@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'
Copy link
Contributor

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?

@p0psicles p0psicles merged commit 9faea6a into develop Apr 20, 2017
@p0psicles p0psicles deleted the feature/normalize_show_status branch April 20, 2017 06:15
@medariox
Copy link
Contributor

This causes all TheTVDB shows to be set to Unknown (try a force update). @fernandog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants