aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xbmc/video/dialogs/GUIDialogVideoManager.cpp19
-rw-r--r--xbmc/video/dialogs/GUIDialogVideoManager.h1
2 files changed, 20 insertions, 0 deletions
diff --git a/xbmc/video/dialogs/GUIDialogVideoManager.cpp b/xbmc/video/dialogs/GUIDialogVideoManager.cpp
index 344d338d72..6d01ddc22b 100644
--- a/xbmc/video/dialogs/GUIDialogVideoManager.cpp
+++ b/xbmc/video/dialogs/GUIDialogVideoManager.cpp
@@ -305,6 +305,7 @@ void CGUIDialogVideoManager::Remove()
// refresh data and controls
Refresh();
+ RefreshSelectedVideoAsset();
UpdateControls();
}
@@ -466,3 +467,21 @@ void CGUIDialogVideoManager::AppendItemFolderToFileBrowserSources(
sources.emplace_back(itemSource);
}
}
+
+void CGUIDialogVideoManager::RefreshSelectedVideoAsset()
+{
+ if (!m_selectedVideoAsset || !m_selectedVideoAsset->HasVideoInfoTag() ||
+ !m_videoAssetsList->Size())
+ {
+ m_selectedVideoAsset = std::make_shared<CFileItem>();
+ return;
+ }
+
+ const int dbId{m_selectedVideoAsset->GetVideoInfoTag()->m_iDbId};
+ const auto it{std::find_if(m_videoAssetsList->cbegin(), m_videoAssetsList->cend(),
+ [dbId](const auto& entry)
+ { return entry->GetVideoInfoTag()->m_iDbId == dbId; })};
+
+ if (it == m_videoAssetsList->cend())
+ m_selectedVideoAsset = m_videoAssetsList->Get(0);
+}
diff --git a/xbmc/video/dialogs/GUIDialogVideoManager.h b/xbmc/video/dialogs/GUIDialogVideoManager.h
index 6248c76c10..b4b043df0a 100644
--- a/xbmc/video/dialogs/GUIDialogVideoManager.h
+++ b/xbmc/video/dialogs/GUIDialogVideoManager.h
@@ -56,6 +56,7 @@ protected:
VideoAssetType assetType,
const std::string& defaultName);
void AppendItemFolderToFileBrowserSources(std::vector<CMediaSource>& sources);
+ void RefreshSelectedVideoAsset();
CVideoDatabase m_database;
std::shared_ptr<CFileItem> m_videoAsset;