Skip to content
This repository
Browse code

Merge pull request #3254 from koying/fixcleaninet

FIX: Do not remove internet files from video db only because they come from a disappeared source
  • Loading branch information...
commit a141474c2cd38144001b1ba72e9ccb84e22e1f62 2 parents 753f414 + a256e53
jmarshallnz authored September 26, 2013

Showing 1 changed file with 3 additions and 16 deletions. Show diff stats Hide diff stats

  1. 19  xbmc/video/VideoDatabase.cpp
19  xbmc/video/VideoDatabase.cpp
@@ -7969,9 +7969,6 @@ void CVideoDatabase::CleanDatabase(CGUIDialogProgressBarHandle* handle, const se
7969 7969
     int total = m_pDS->num_rows();
7970 7970
     int current = 0;
7971 7971
 
7972  
-    bool bIsSource;
7973  
-    VECSOURCES *pShares = CMediaSourceSettings::Get().GetSources("video");
7974  
-
7975 7972
     while (!m_pDS->eof())
7976 7973
     {
7977 7974
       CStdString path = m_pDS->fv("path.strPath").get_asString();
@@ -7983,19 +7980,9 @@ void CVideoDatabase::CleanDatabase(CGUIDialogProgressBarHandle* handle, const se
7983 7980
       if (URIUtils::IsStack(fullPath))
7984 7981
         fullPath = CStackDirectory::GetFirstStackedFile(fullPath);
7985 7982
 
7986  
-      // check if we have a internet related file that is part of a media source
7987  
-      if (URIUtils::IsInternetStream(fullPath, true) && CUtil::GetMatchingSource(fullPath, *pShares, bIsSource) > -1)
7988  
-      {
7989  
-        if (!CFile::Exists(fullPath, false))
7990  
-          filesToDelete += m_pDS->fv("files.idFile").get_asString() + ",";
7991  
-      }
7992  
-      else
7993  
-      {
7994  
-        // remove optical, internet related and non-existing files
7995  
-        // note: this will also remove entries from previously existing media sources
7996  
-        if (URIUtils::IsOnDVD(fullPath) || URIUtils::IsInternetStream(fullPath, true) || !CFile::Exists(fullPath, false))
7997  
-          filesToDelete += m_pDS->fv("files.idFile").get_asString() + ",";
7998  
-      }
  7983
+      // remove optical, non-existing files
  7984
+      if (URIUtils::IsOnDVD(fullPath) || !CFile::Exists(fullPath, false))
  7985
+        filesToDelete += m_pDS->fv("files.idFile").get_asString() + ",";
7999 7986
 
8000 7987
       if (!handle)
8001 7988
       {

0 notes on commit a141474

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