diff options
author | Martijn Kaijser <martijn@xbmc.org> | 2015-02-17 11:32:51 +0100 |
---|---|---|
committer | Martijn Kaijser <martijn@xbmc.org> | 2015-02-17 11:32:51 +0100 |
commit | 2259d0b4941a6df7a3334071aa50d0fb15ec84e3 (patch) | |
tree | 0864926e0927c36104ba7233c5c6fdda29d8fe90 | |
parent | 38dee6d1bd794c3cd6614aac7081db3dee77d285 (diff) | |
parent | eee7ca74a769ea9b62eff5a7d4b54e7f8d2912c8 (diff) |
Merge pull request #6465 from mkortstiege/helix_opt_fasthash14.2b1-Helix
[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)) |