From 4b855de16f093ade275fc6e1dbc8c79cfc0682ed Mon Sep 17 00:00:00 2001
From: Fernando <fernandog@users.noreply.github.com>
Date: Sat, 12 Dec 2015 10:33:32 -0200
Subject: [PATCH] Fix archived status episodes not showing missed subs

If ep with archived status has location in DB, video filename still exists.

Logs shows subs are missing but they didn't show in 'manage missed subtitles'
---
 sickbeard/webserve.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py
index 82bd3dcca..5d9a5c247 100644
--- a/sickbeard/webserve.py
+++ b/sickbeard/webserve.py
@@ -2969,7 +2969,7 @@ class Manage(Home, WebRoot):
     def showSubtitleMissed(indexer_id, whichSubs):
         myDB = db.DBConnection()
         cur_show_results = myDB.select(
-            "SELECT season, episode, name, subtitles FROM tv_episodes WHERE showid = ? AND season != 0 AND status LIKE '%4'",
+            "SELECT season, episode, name, subtitles FROM tv_episodes WHERE showid = ? AND season != 0 AND (status LIKE '%4' OR status LIKE '%6') and location != ''",
             [int(indexer_id)])
 
         result = {}
@@ -3008,8 +3008,8 @@ class Manage(Home, WebRoot):
         status_results = myDB.select(
             "SELECT show_name, tv_shows.indexer_id as indexer_id, tv_episodes.subtitles subtitles " +
             "FROM tv_episodes, tv_shows " +
-            "WHERE tv_shows.subtitles = 1 AND tv_episodes.status LIKE '%4' AND tv_episodes.season != 0 " +
-            "AND tv_episodes.showid = tv_shows.indexer_id ORDER BY show_name")
+            "WHERE tv_shows.subtitles = 1 AND (tv_episodes.status LIKE '%4' OR tv_episodes.status LIKE '%6') AND tv_episodes.season != 0 " +
+            "AND tv_episodes.location != '' AND tv_episodes.showid = tv_shows.indexer_id ORDER BY show_name")
 
         ep_counts = {}
         show_names = {}
@@ -3056,7 +3056,7 @@ class Manage(Home, WebRoot):
             if 'all' in to_download[cur_indexer_id]:
                 myDB = db.DBConnection()
                 all_eps_results = myDB.select(
-                    "SELECT season, episode FROM tv_episodes WHERE status LIKE '%4' AND season != 0 AND showid = ?",
+                    "SELECT season, episode FROM tv_episodes WHERE (status LIKE '%4' OR status LIKE '%6') AND season != 0 AND showid = ? AND location != ''",
                     [cur_indexer_id])
                 to_download[cur_indexer_id] = [str(x["season"]) + 'x' + str(x["episode"]) for x in all_eps_results]
 
-- 
GitLab