Skip to content

Commit

Permalink
Fix watched null values.
Browse files Browse the repository at this point in the history
  • Loading branch information
p0psicles committed Sep 7, 2018
1 parent 0c12371 commit 848c527
Showing 1 changed file with 5 additions and 0 deletions.
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 verry well."""
self.connection.action("UPDATE tv_episodes SET watched = 0 WHERE watched is null;")


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

0 comments on commit 848c527

Please sign in to comment.