Skip to content

Commit

Permalink
Merge pull request #17340 from ronie/uniqueID
Browse files Browse the repository at this point in the history
[guilib] add listitem.uniqueid() infolabel
  • Loading branch information
ronie committed Mar 17, 2020
2 parents 6280808 + 1a95c1f commit 80475cb
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
24 changes: 22 additions & 2 deletions xbmc/GUIInfoManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3092,6 +3092,15 @@ const infomap musicplayer[] = {{ "title", MUSICPLAYER_TITLE },
/// @skinning_v17 **[New Infolabel]** \link VideoPlayer_DBID `VideoPlayer.DBID`\endlink
/// <p>
/// }
/// \table_row3{ <b>`VideoPlayer.UniqueID(name)`</b>,
/// \anchor VideoPlayer_UniqueID
/// _string_,
/// @return The scraped metadata id of current movie\, if it's in the database.
/// @param name - the name of the metadata provider.
/// <p><hr>
/// @skinning_v19 **[New Infolabel]** \link VideoPlayer_UniqueID `VideoPlayer.UniqueID(name)`\endlink
/// <p>
/// }
/// \table_end
///
/// -----------------------------------------------------------------------------
Expand Down Expand Up @@ -3161,7 +3170,8 @@ const infomap videoplayer[] = {{ "title", VIDEOPLAYER_TITLE },
{ "canresumelivetv", VIDEOPLAYER_CAN_RESUME_LIVE_TV },
{ "imdbnumber", VIDEOPLAYER_IMDBNUMBER },
{ "episodename", VIDEOPLAYER_EPISODENAME },
{ "dbid", VIDEOPLAYER_DBID }
{ "dbid", VIDEOPLAYER_DBID },
{ "uniqueid", VIDEOPLAYER_UNIQUEID },
};

/// \page modules__infolabels_boolean_conditions
Expand Down Expand Up @@ -5851,6 +5861,14 @@ const infomap container_str[] = {{ "property", CONTAINER_PROPERTY },
/// @return The BPM of a song.
/// <p><hr>
/// @skinning_v19 **[New Infolabel]** \link ListItem_BPM `ListItem.BPM`\endlink
/// \table_row3{ <b>`ListItem.UniqueID(name)`</b>,
/// \anchor ListItem_UniqueID
/// _string_,
/// @return The scraped metadata id of the currently selected item in a container\,
/// for use in dialogvideoinfo.xml.
/// @param name - the name of the metadata provider.
/// <p><hr>
/// @skinning_v19 **[New Infolabel]** \link ListItem_UniqueID `ListItem.UniqueID(name)`\endlink
/// <p>
/// }
/// \table_end
Expand Down Expand Up @@ -6052,6 +6070,7 @@ const infomap listitem_labels[]= {{ "thumb", LISTITEM_THUMB },
{ "releasedate", LISTITEM_RELEASEDATE },
{ "originaldate", LISTITEM_ORIGINALDATE },
{ "bpm", LISTITEM_BPM },
{ "uniqueid", LISTITEM_UNIQUEID },
};

/// \page modules__infolabels_boolean_conditions
Expand Down Expand Up @@ -9361,7 +9380,8 @@ int CGUIInfoManager::TranslateListItem(const Property& cat, const Property& prop
prop.name == "art" ||
prop.name == "rating" ||
prop.name == "votes" ||
prop.name == "ratingandvotes")
prop.name == "ratingandvotes" ||
prop.name == "uniqueid")
{
data3 = prop.param();
}
Expand Down
2 changes: 2 additions & 0 deletions xbmc/guilib/guiinfo/GUIInfoLabels.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@
#define VIDEOPLAYER_EPISODENAME 318
#define VIDEOPLAYER_USER_RATING 319
#define VIDEOPLAYER_DBID 320
#define VIDEOPLAYER_UNIQUEID 321

#define RETROPLAYER_VIDEO_FILTER 330
#define RETROPLAYER_STRETCH_MODE 331
Expand Down Expand Up @@ -899,6 +900,7 @@
#define LISTITEM_RELEASEDATE (LISTITEM_START + 193)
#define LISTITEM_ORIGINALDATE (LISTITEM_START + 194)
#define LISTITEM_BPM (LISTITEM_START + 195)
#define LISTITEM_UNIQUEID (LISTITEM_START + 196)

#define LISTITEM_END (LISTITEM_START + 2500)

Expand Down
5 changes: 5 additions & 0 deletions xbmc/guilib/guiinfo/VideoGUIInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ bool CVideoGUIInfo::GetLabel(std::string& value, const CFileItem *item, int cont
return true;
}
break;
case VIDEOPLAYER_UNIQUEID:
case LISTITEM_UNIQUEID:
if (!info.GetData3().empty())
value = tag->GetUniqueID(info.GetData3());
return true;
case VIDEOPLAYER_RATING:
case LISTITEM_RATING:
{
Expand Down

0 comments on commit 80475cb

Please sign in to comment.