From 651e6857797dba684c4cb124cf82605f78d8e002 Mon Sep 17 00:00:00 2001
From: Nic Wolfe <nic@wolfeden.ca>
Date: Thu, 6 Sep 2012 00:01:28 -0600
Subject: [PATCH] Fix another problem with the database migration

---
 sickbeard/databases/mainDB.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sickbeard/databases/mainDB.py b/sickbeard/databases/mainDB.py
index a629618eb..18403275c 100644
--- a/sickbeard/databases/mainDB.py
+++ b/sickbeard/databases/mainDB.py
@@ -434,7 +434,7 @@ class AddSizeAndSceneNameFields(FixAirByDateSetting):
         logger.log(u"Adding file size to all episodes in DB, please be patient")
         for cur_ep in ep_results:
             # if there is no size yet then populate it for us
-            if not int(cur_ep["file_size"]) and ek.ek(os.path.isfile, cur_ep["location"]):
+            if not cur_ep["file_size"] or (not int(cur_ep["file_size"]) and ek.ek(os.path.isfile, cur_ep["location"])):
                 cur_size = ek.ek(os.path.getsize, cur_ep["location"])
                 self.connection.action("UPDATE tv_episodes SET file_size = ? WHERE episode_id = ?", [cur_size, int(cur_ep["episode_id"])])
 
-- 
GitLab