Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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 jmarshallnz authored
Showing with 9 additions and 2 deletions.
  1. +9 −2 xbmc/video/VideoDatabase.cpp
View
11 xbmc/video/VideoDatabase.cpp
@@ -7793,7 +7793,7 @@ void CVideoDatabase::CleanDatabase(CGUIDialogProgressBarHandle* handle, const se
}
CLog::Log(LOGDEBUG, "%s: Cleaning paths that don't exist and have content set...", __FUNCTION__);
- sql = "select * from path where strContent != ''";
+ sql = "select * from path where not (strContent='' and strSettings='' and strHash='' and exclude!=1)";
m_pDS->query(sql.c_str());
CStdString strIds;
while (!m_pDS->eof())
@@ -7891,7 +7891,14 @@ void CVideoDatabase::CleanDatabase(CGUIDialogProgressBarHandle* handle, const se
}
CLog::Log(LOGDEBUG, "%s: Cleaning path table", __FUNCTION__);
- sql = "delete from path where idPath not in (select distinct idPath from files) and idPath not in (select distinct idPath from tvshowlinkpath) and strContent=''";
+ sql.Format("delete from path where strContent='' and strSettings='' and strHash='' and exclude!=1 "
+ "and idPath not in (select distinct idPath from files) "
+ "and idPath not in (select distinct idPath from tvshowlinkpath) "
+ "and idPath not in (select distinct c%02d from movie) "
+ "and idPath not in (select distinct c%02d from tvshow) "
+ "and idPath not in (select distinct c%02d from episode) "
+ "and idPath not in (select distinct c%02d from musicvideo)"
+ , VIDEODB_ID_PARENTPATHID, VIDEODB_ID_TV_PARENTPATHID, VIDEODB_ID_EPISODE_PARENTPATHID, VIDEODB_ID_MUSICVIDEO_PARENTPATHID );
m_pDS->exec(sql.c_str());
CLog::Log(LOGDEBUG, "%s: Cleaning genre table", __FUNCTION__);
Please sign in to comment.
Something went wrong with that request. Please try again.