aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCrystalP <crystalp@kodi.tv>2024-07-07 10:46:33 -0400
committerGitHub <noreply@github.com>2024-07-07 10:46:33 -0400
commit37fb5f6abb812e17586ab9027401c157850d0a87 (patch)
treefe79994373b70071dfc5f50d4e47b7f9476b3096
parent7572e2764cbdd5f686bb96fad06789e92958ae3e (diff)
parent80660eb3f39d57dd95ebf0428883226b61957154 (diff)
Merge pull request #25232 from CrystalP/assettypechange
[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{};