aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCrystalP <crystalp@kodi.tv>2024-02-11 15:49:57 -0500
committerGitHub <noreply@github.com>2024-02-11 15:49:57 -0500
commit72272892955462036e69f9f047ea2b5045ceceff (patch)
tree4ae259368911da14e78997a34ca65e2f819142f2
parent2672248a07cc89d6f23048daed33accca16983a1 (diff)
parenteeaac1b86235b07b12d44261807bb6002848fb9e (diff)
Merge pull request #24695 from CrystalP/infolabels-versions
[guilib] Add Infolabels for versions
-rw-r--r--xbmc/GUIInfoManager.cpp18
-rw-r--r--xbmc/guilib/guiinfo/GUIInfoLabels.h2
-rw-r--r--xbmc/guilib/guiinfo/VideoGUIInfo.cpp16
3 files changed, 29 insertions, 7 deletions
diff --git a/xbmc/GUIInfoManager.cpp b/xbmc/GUIInfoManager.cpp
index cc47a0ffa3..d8dcaf22d6 100644
--- a/xbmc/GUIInfoManager.cpp
+++ b/xbmc/GUIInfoManager.cpp
@@ -2959,6 +2959,13 @@ const infomap musicplayer[] = {{ "title", MUSICPLAYER_TITLE },
/// library or from a plugin (eg director/plot etc.)
/// <p>
/// }
+/// \table_row3{ <b>`VideoPlayer.HasVideoVersions`</b>,
+/// \anchor VideoPlayer_HasVideoVersions
+/// _boolean_,
+/// @return **True** when the played item has multiple video versions.
+/// <p><hr>
+/// @skinning_v21 **[New Infolabel]** \link VideoPlayer_HasVideoVersions `VideoPlayer.HasVideoVersions`\endlink
+/// }
/// \table_row3{ <b>`VideoPlayer.Content(parameter)`</b>,
/// \anchor VideoPlayer_Content
/// _boolean_,
@@ -3925,6 +3932,13 @@ const infomap musicplayer[] = {{ "title", MUSICPLAYER_TITLE },
/// @skinning_v20 **[New Infolabel]** \link VideoPlayer_HdrType `VideoPlayer.HdrType`\endlink
/// <p>
/// }
+/// \table_row3{ <b>`VideoPlayer.VideoVersionName`</b>,
+/// \anchor VideoPlayer_VideoVersionName
+/// _string_,
+/// @return String containing the version name of the currently playing video (movie) - empty if not a movie, version name is not set or not a version
+/// <p><hr>
+/// @skinning_v21 **[New Infolabel]** \link VideoPlayer_VideoVersionName `VideoPlayer.VideoVersionName`\endlink
+/// }
/// \table_end
///
/// -----------------------------------------------------------------------------
@@ -4001,6 +4015,8 @@ const infomap videoplayer[] = {{ "title", VIDEOPLAYER_TITLE },
{ "audiostreamcount", VIDEOPLAYER_AUDIOSTREAMCOUNT },
{ "hdrtype", VIDEOPLAYER_HDR_TYPE },
{ "art", VIDEOPLAYER_ART},
+ { "videoversionname", VIDEOPLAYER_VIDEOVERSION_NAME},
+ { "hasvideoversions", VIDEOPLAYER_HAS_VIDEOVERSIONS}
};
// clang-format on
@@ -6944,7 +6960,7 @@ const infomap container_str[] = {{ "property", CONTAINER_PROPERTY },
/// \table_row3{ <b>`ListItem.VideoVersionName`</b>,
/// \anchor ListItem_VideoVersionName
/// _string_,
-/// @return String containing the name of the version of a video - empty if no version available
+/// @return String containing the name of the version of a video - empty for extras or if no version available
/// <p><hr>
/// @skinning_v21 **[New Infolabel]** \link ListItem_VideoVersionName `ListItem.VideoVersionName`\endlink
/// }
diff --git a/xbmc/guilib/guiinfo/GUIInfoLabels.h b/xbmc/guilib/guiinfo/GUIInfoLabels.h
index 7437bab269..8c17ce2a49 100644
--- a/xbmc/guilib/guiinfo/GUIInfoLabels.h
+++ b/xbmc/guilib/guiinfo/GUIInfoLabels.h
@@ -277,6 +277,7 @@
#define VIDEOPLAYER_CAST_AND_ROLE 293
#define VIDEOPLAYER_UNIQUEID 294
#define VIDEOPLAYER_AUDIOSTREAMCOUNT 295
+#define VIDEOPLAYER_VIDEOVERSION_NAME 296
// Videoplayer infobools
#define VIDEOPLAYER_HASSUBTITLES 300
@@ -290,6 +291,7 @@
#define VIDEOPLAYER_HAS_INFO 308
#define VIDEOPLAYER_HASTELETEXT 309
#define VIDEOPLAYER_IS_STEREOSCOPIC 310
+#define VIDEOPLAYER_HAS_VIDEOVERSIONS 311
// PVR infolabels
#define VIDEOPLAYER_EVENT 313
diff --git a/xbmc/guilib/guiinfo/VideoGUIInfo.cpp b/xbmc/guilib/guiinfo/VideoGUIInfo.cpp
index 2697539521..29e387fd57 100644
--- a/xbmc/guilib/guiinfo/VideoGUIInfo.cpp
+++ b/xbmc/guilib/guiinfo/VideoGUIInfo.cpp
@@ -319,6 +319,12 @@ bool CVideoGUIInfo::GetLabel(std::string& value, const CFileItem *item, int cont
case LISTITEM_TAGLINE:
value = tag->m_strTagLine;
return true;
+ case VIDEOPLAYER_VIDEOVERSION_NAME:
+ case LISTITEM_VIDEOVERSION_NAME:
+ value = tag->GetAssetInfo().GetType() == VideoAssetType::VERSION
+ ? tag->GetAssetInfo().GetTitle()
+ : "";
+ return true;
case VIDEOPLAYER_LASTPLAYED:
case LISTITEM_LASTPLAYED:
{
@@ -521,9 +527,6 @@ bool CVideoGUIInfo::GetLabel(std::string& value, const CFileItem *item, int cont
case LISTITEM_VIDEO_HDR_TYPE:
value = tag->m_streamDetails.GetVideoHdrType();
return true;
- case LISTITEM_VIDEOVERSION_NAME:
- value = tag->GetAssetInfo().GetTitle();
- return true;
case LISTITEM_LABEL:
{
//! @todo get rid of "videos with versions as folder" hack!
@@ -778,6 +781,10 @@ bool CVideoGUIInfo::GetBool(bool& value, const CGUIListItem *gitem, int contextW
case VIDEOPLAYER_HAS_INFO:
value = !tag->IsEmpty();
return true;
+ case VIDEOPLAYER_HAS_VIDEOVERSIONS:
+ case LISTITEM_HASVIDEOVERSIONS:
+ value = tag->HasVideoVersions();
+ return true;
/////////////////////////////////////////////////////////////////////////////////////////////
// LISTITEM_*
@@ -785,9 +792,6 @@ bool CVideoGUIInfo::GetBool(bool& value, const CGUIListItem *gitem, int contextW
case LISTITEM_IS_COLLECTION:
value = tag->m_type == MediaTypeVideoCollection;
return true;
- case LISTITEM_HASVIDEOVERSIONS:
- value = tag->HasVideoVersions();
- return true;
case LISTITEM_ISVIDEOEXTRA:
value = (tag->GetAssetInfo().GetType() == VideoAssetType::EXTRA);
return true;