From d0592cf22947c14bc2ef6046e8c14f9ab3db1c26 Mon Sep 17 00:00:00 2001
From: Nic Wolfe <nic@wolfeden.ca>
Date: Thu, 6 Sep 2012 21:35:41 -0600
Subject: [PATCH] Fix a problem during the upgrade when files are missing

---
 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 e66640530..63e03dff9 100644
--- a/sickbeard/databases/mainDB.py
+++ b/sickbeard/databases/mainDB.py
@@ -437,7 +437,7 @@ class AddSizeAndSceneNameFields(FixAirByDateSetting):
                 continue
             
             # if there is no size yet then populate it for us
-            if not cur_ep["file_size"] or (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