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 watched null values. #5132

Merged
merged 11 commits into from
Sep 9, 2018
5 changes: 5 additions & 0 deletions medusa/databases/main_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def check(self):
self.fix_show_nfo_lang()
self.fix_subtitle_reference()
self.clean_null_indexer_mappings()
self.fix_tv_episodes_watched_field()

def clean_null_indexer_mappings(self):
log.debug(u'Checking for null indexer mappings')
Expand Down Expand Up @@ -221,6 +222,10 @@ def fix_subtitles_codes(self):
def fix_show_nfo_lang(self):
self.connection.action("UPDATE tv_shows SET lang = '' WHERE lang = 0 OR lang = '0';")

def fix_tv_episodes_watched_field(self):
"""A mistake was made when we added this field. Migration didn't went very well."""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to swap "went" with "go".

self.connection.action("UPDATE tv_episodes SET watched = 0 WHERE watched is null;")


# ======================
# = Main DB Migrations =
Expand Down