Skip to content
This repository
Browse code

Merge pull request #1732 from dragonflight/FIXcleanLibrary

FIX: Video metadata disappears from files mode view after Clean Library
  • Loading branch information...
commit 17e59e0f3a2beb4ae2832d3d5f21656bb4cd3765 2 parents 0cec1e4 + 2a5d32c
jmarshallnz authored November 16, 2012

Showing 1 changed file with 9 additions and 2 deletions. Show diff stats Hide diff stats

  1. 11  xbmc/video/VideoDatabase.cpp
11  xbmc/video/VideoDatabase.cpp
@@ -7793,7 +7793,7 @@ void CVideoDatabase::CleanDatabase(CGUIDialogProgressBarHandle* handle, const se
7793 7793
     }
7794 7794
 
7795 7795
     CLog::Log(LOGDEBUG, "%s: Cleaning paths that don't exist and have content set...", __FUNCTION__);
7796  
-    sql = "select * from path where strContent != ''";
  7796
+    sql = "select * from path where not (strContent='' and strSettings='' and strHash='' and exclude!=1)";
7797 7797
     m_pDS->query(sql.c_str());
7798 7798
     CStdString strIds;
7799 7799
     while (!m_pDS->eof())
@@ -7891,7 +7891,14 @@ void CVideoDatabase::CleanDatabase(CGUIDialogProgressBarHandle* handle, const se
7891 7891
     }
7892 7892
 
7893 7893
     CLog::Log(LOGDEBUG, "%s: Cleaning path table", __FUNCTION__);
7894  
-    sql = "delete from path where idPath not in (select distinct idPath from files) and idPath not in (select distinct idPath from tvshowlinkpath) and strContent=''";
  7894
+    sql.Format("delete from path where strContent='' and strSettings='' and strHash='' and exclude!=1 "
  7895
+                                  "and idPath not in (select distinct idPath from files) "
  7896
+                                  "and idPath not in (select distinct idPath from tvshowlinkpath) "
  7897
+                                  "and idPath not in (select distinct c%02d from movie) "
  7898
+                                  "and idPath not in (select distinct c%02d from tvshow) "
  7899
+                                  "and idPath not in (select distinct c%02d from episode) "
  7900
+                                  "and idPath not in (select distinct c%02d from musicvideo)"
  7901
+                , VIDEODB_ID_PARENTPATHID, VIDEODB_ID_TV_PARENTPATHID, VIDEODB_ID_EPISODE_PARENTPATHID, VIDEODB_ID_MUSICVIDEO_PARENTPATHID );
7895 7902
     m_pDS->exec(sql.c_str());
7896 7903
 
7897 7904
     CLog::Log(LOGDEBUG, "%s: Cleaning genre table", __FUNCTION__);

0 notes on commit 17e59e0

Please sign in to comment.
Something went wrong with that request. Please try again.