diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp index 14365350bd9f3..b976e7b261013 100644 --- a/xbmc/video/VideoDatabase.cpp +++ b/xbmc/video/VideoDatabase.cpp @@ -6490,6 +6490,10 @@ void CVideoDatabase::CleanDatabase(IVideoInfoScannerObserver* pObserver, const v int total = m_pDS->num_rows(); int current = 0; + + bool bIsSource; + VECSOURCES *pShares = g_settings.GetSourcesFromType("video"); + while (!m_pDS->eof()) { CStdString path = m_pDS->fv("path.strPath").get_asString(); @@ -6501,10 +6505,6 @@ void CVideoDatabase::CleanDatabase(IVideoInfoScannerObserver* pObserver, const v if (URIUtils::IsStack(fullPath)) fullPath = CStackDirectory::GetFirstStackedFile(fullPath); - // check for deletion - bool bIsSource; - VECSOURCES *pShares = g_settings.GetSourcesFromType("video"); - // check if we have a internet related file that is part of a media source if (URIUtils::IsInternetStream(fullPath, true) && CUtil::GetMatchingSource(fullPath, *pShares, bIsSource) > -1) {