aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCrystalP <crystalp@kodi.tv>2024-05-18 19:32:48 -0400
committerCrystalP <crystalp@kodi.tv>2024-05-18 19:32:48 -0400
commit80660eb3f39d57dd95ebf0428883226b61957154 (patch)
tree5936a2cb3e05e865b92d52d0f8c04950f36b847c
parent94b12dd1a8da218d7242db71914b72c8be5209fa (diff)
[video] Allow changing the type of a movie asset between version and extra
-rw-r--r--xbmc/video/dialogs/GUIDialogVideoManagerExtras.cpp11
-rw-r--r--xbmc/video/dialogs/GUIDialogVideoManagerVersions.cpp11
2 files changed, 12 insertions, 10 deletions
diff --git a/xbmc/video/dialogs/GUIDialogVideoManagerExtras.cpp b/xbmc/video/dialogs/GUIDialogVideoManagerExtras.cpp
index b96bd85831..da47f8125a 100644
--- a/xbmc/video/dialogs/GUIDialogVideoManagerExtras.cpp
+++ b/xbmc/video/dialogs/GUIDialogVideoManagerExtras.cpp
@@ -131,9 +131,9 @@ bool CGUIDialogVideoManagerExtras::AddVideoExtra()
if (newAsset.m_idFile != -1 && newAsset.m_assetTypeId != -1)
{
- // The video already is an asset of the movie
- if (newAsset.m_idMedia == dbId &&
- newAsset.m_mediaType == m_videoAsset->GetVideoInfoTag()->m_type)
+ // The video already is an extra of the movie
+ if (newAsset.m_idMedia == dbId && newAsset.m_mediaType == mediaType &&
+ newAsset.m_assetType == VideoAssetType::EXTRA)
{
unsigned int msgid{};
@@ -153,9 +153,9 @@ bool CGUIDialogVideoManagerExtras::AddVideoExtra()
return false;
}
- // The video is an asset of another movie
+ // The video is an asset of another movie or different asset type of same movie
- // The video is a version, ask for confirmation
+ // The video is a version, ask for confirmation of the asset type change
if (newAsset.m_assetType == VideoAssetType::VERSION &&
!CGUIDialogYesNo::ShowAndGetInput(CVariant{40015},
StringUtils::Format(g_localizeStrings.Get(40036))))
@@ -171,6 +171,7 @@ bool CGUIDialogVideoManagerExtras::AddVideoExtra()
else
return false;
+ if (newAsset.m_idMedia != dbId && newAsset.m_mediaType == mediaType)
{
unsigned int msgid{};
diff --git a/xbmc/video/dialogs/GUIDialogVideoManagerVersions.cpp b/xbmc/video/dialogs/GUIDialogVideoManagerVersions.cpp
index 32ad392851..49fad7c9ff 100644
--- a/xbmc/video/dialogs/GUIDialogVideoManagerVersions.cpp
+++ b/xbmc/video/dialogs/GUIDialogVideoManagerVersions.cpp
@@ -498,9 +498,9 @@ bool CGUIDialogVideoManagerVersions::AddVideoVersionFilePicker()
// @todo look only for a version identified by idFile instead of retrieving all versions
if (newAsset.m_idFile != -1 && newAsset.m_assetTypeId != -1)
{
- // The video already is an asset of the movie
- if (newAsset.m_idMedia == dbId &&
- newAsset.m_mediaType == m_videoAsset->GetVideoInfoTag()->m_type)
+ // The video already is a version of the movie
+ if (newAsset.m_idMedia == dbId && newAsset.m_mediaType == mediaType &&
+ newAsset.m_assetType == VideoAssetType::VERSION)
{
unsigned int msgid{};
@@ -520,9 +520,9 @@ bool CGUIDialogVideoManagerVersions::AddVideoVersionFilePicker()
return false;
}
- // The video is an asset of another movie
+ // The video is an asset of another movie or different asset type of same movie
- // The video is an extra, ask for confirmation
+ // The video is an extra, ask for confirmation of the asset type change
if (newAsset.m_assetType == VideoAssetType::EXTRA &&
!CGUIDialogYesNo::ShowAndGetInput(CVariant{40014},
StringUtils::Format(g_localizeStrings.Get(40035))))
@@ -538,6 +538,7 @@ bool CGUIDialogVideoManagerVersions::AddVideoVersionFilePicker()
else
return false;
+ if (newAsset.m_idMedia != dbId && newAsset.m_mediaType == mediaType)
{
unsigned int msgid{};