Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PVR][guiinfo] Fix/add support for ListItem.ParentalRating, VideoPlay… #15624

Merged
merged 1 commit into from Feb 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions xbmc/GUIInfoManager.cpp
Expand Up @@ -5620,6 +5620,12 @@ const infomap container_str[] = {{ "property", CONTAINER_PROPERTY },
/// @skinning_v18 **[New Infolabel]** \link ListItem_Property_Game_VideoRotation `ListItem.Property(Game.VideoRotation)`\endlink
/// <p>
/// }
/// \table_row3{ <b>`ListItem.ParentalRating`</b>,
/// \anchor ListItem_ParentalRating
/// _string_,
/// @return The parental rating of the list item (PVR).
/// <p>
/// }
/// \table_end
///
/// -----------------------------------------------------------------------------
Expand Down Expand Up @@ -5805,6 +5811,7 @@ const infomap listitem_labels[]= {{ "thumb", LISTITEM_THUMB },
{ "expirationtime", LISTITEM_EXPIRATION_TIME },
{ "art", LISTITEM_ART },
{ "property", LISTITEM_PROPERTY },
{ "parentalrating", LISTITEM_PARENTAL_RATING }
};

/// \page modules__infolabels_boolean_conditions
Expand Down
2 changes: 1 addition & 1 deletion xbmc/guilib/guiinfo/GUIInfoLabels.h
Expand Up @@ -818,7 +818,7 @@
#define LISTITEM_HASTIMER (LISTITEM_START + 133)
#define LISTITEM_ISRECORDING (LISTITEM_START + 134)
#define LISTITEM_ISENCRYPTED (LISTITEM_START + 135)
#define LISTITEM_PARENTALRATING (LISTITEM_START + 136)
#define LISTITEM_PARENTAL_RATING (LISTITEM_START + 136)
#define LISTITEM_PROGRESS (LISTITEM_START + 137)
#define LISTITEM_HAS_EPG (LISTITEM_START + 138)
#define LISTITEM_VOTES (LISTITEM_START + 139)
Expand Down
14 changes: 13 additions & 1 deletion xbmc/pvr/PVRGUIInfo.cpp
Expand Up @@ -565,20 +565,32 @@ bool CPVRGUIInfo::GetListItemAndPlayerLabel(const CFileItem *item, const CGUIInf
strValue = epgTag->Icon();
return true;
case VIDEOPLAYER_PARENTAL_RATING:
case LISTITEM_PARENTALRATING:
case LISTITEM_PARENTAL_RATING:
if (epgTag->ParentalRating() > 0)
{
strValue = StringUtils::Format("%i", epgTag->ParentalRating());
return true;
}
return false;
case VIDEOPLAYER_PREMIERED:
case LISTITEM_PREMIERED:
if (epgTag->FirstAiredAsLocalTime().IsValid())
{
strValue = epgTag->FirstAiredAsLocalTime().GetAsLocalizedDate(true);
return true;
}
return false;
case VIDEOPLAYER_RATING:
case LISTITEM_RATING:
{
int iStarRating = epgTag->StarRating();
if (iStarRating > 0)
{
strValue = StringUtils::FormatNumber(iStarRating);
return true;
}
return false;
}
}
}

Expand Down