diff options
author | Matthias Kortstiege <mkortstiege@kodi.tv> | 2015-02-16 08:13:07 +0100 |
---|---|---|
committer | Matthias Kortstiege <mkortstiege@kodi.tv> | 2015-02-16 09:54:48 +0100 |
commit | eee7ca74a769ea9b62eff5a7d4b54e7f8d2912c8 (patch) | |
tree | e3a93a3f25dce40a43328ee06ab89bff9c91f0b3 | |
parent | ea414aeaa596b49ef50e912e682cb16e01078b27 (diff) |
[videoinfoscanner] added ability to explicitly skip fast hashing
-rw-r--r-- | xbmc/settings/AdvancedSettings.cpp | 2 | ||||
-rw-r--r-- | xbmc/settings/AdvancedSettings.h | 1 | ||||
-rw-r--r-- | xbmc/video/VideoInfoScanner.cpp | 12 |
3 files changed, 13 insertions, 2 deletions
diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp index 478d72589b..a1b68b5332 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp @@ -281,6 +281,7 @@ void CAdvancedSettings::Initialize() m_iVideoLibraryRecentlyAddedItems = 25; m_bVideoLibraryHideEmptySeries = false; m_bVideoLibraryCleanOnUpdate = false; + m_bVideoLibraryUseFastHash = true; m_bVideoLibraryExportAutoThumbs = false; m_bVideoLibraryImportWatchedState = false; m_bVideoLibraryImportResumePoint = false; @@ -764,6 +765,7 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file) XMLUtils::GetInt(pElement, "recentlyaddeditems", m_iVideoLibraryRecentlyAddedItems, 1, INT_MAX); XMLUtils::GetBoolean(pElement, "hideemptyseries", m_bVideoLibraryHideEmptySeries); XMLUtils::GetBoolean(pElement, "cleanonupdate", m_bVideoLibraryCleanOnUpdate); + XMLUtils::GetBoolean(pElement, "usefasthash", m_bVideoLibraryUseFastHash); XMLUtils::GetString(pElement, "itemseparator", m_videoItemSeparator); XMLUtils::GetBoolean(pElement, "exportautothumbs", m_bVideoLibraryExportAutoThumbs); XMLUtils::GetBoolean(pElement, "importwatchedstate", m_bVideoLibraryImportWatchedState); diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h index ca995e3735..ed91aba5f0 100644 --- a/xbmc/settings/AdvancedSettings.h +++ b/xbmc/settings/AdvancedSettings.h @@ -279,6 +279,7 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler int m_iVideoLibraryRecentlyAddedItems; bool m_bVideoLibraryHideEmptySeries; bool m_bVideoLibraryCleanOnUpdate; + bool m_bVideoLibraryUseFastHash; bool m_bVideoLibraryExportAutoThumbs; bool m_bVideoLibraryImportWatchedState; bool m_bVideoLibraryImportResumePoint; diff --git a/xbmc/video/VideoInfoScanner.cpp b/xbmc/video/VideoInfoScanner.cpp index 6d77da0867..5605b89650 100644 --- a/xbmc/video/VideoInfoScanner.cpp +++ b/xbmc/video/VideoInfoScanner.cpp @@ -317,7 +317,10 @@ namespace VIDEO m_handle->SetTitle(StringUtils::Format(g_localizeStrings.Get(str).c_str(), info->Name().c_str())); } - CStdString fastHash = GetFastHash(strDirectory, regexps); + CStdString fastHash; + if (g_advancedSettings.m_bVideoLibraryUseFastHash) + fastHash = GetFastHash(strDirectory, regexps); + if (m_database.GetPathHash(strDirectory, dbHash) && !fastHash.empty() && fastHash == dbHash) { // fast hashes match - no need to process anything hash = fastHash; @@ -729,7 +732,9 @@ namespace VIDEO m_pathsToScan.erase(it); CStdString hash, dbHash; - hash = GetRecursiveFastHash(item->GetPath(), regexps); + if (g_advancedSettings.m_bVideoLibraryUseFastHash) + hash = GetRecursiveFastHash(item->GetPath(), regexps); + if (m_database.GetPathHash(item->GetPath(), dbHash) && !hash.empty() && dbHash == hash) { // fast hashes match - no need to process anything @@ -1776,6 +1781,9 @@ namespace VIDEO bool CVideoInfoScanner::CanFastHash(const CFileItemList &items, const vector<string> &excludes) const { + if (!g_advancedSettings.m_bVideoLibraryUseFastHash) + return false; + for (int i = 0; i < items.Size(); ++i) { if (items[i]->m_bIsFolder && !CUtil::ExcludeFileOrFolder(items[i]->GetPath(), excludes)) |