diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po index 12e87bc6df413..7824d0521850e 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -800,6 +800,7 @@ msgstr "" #: xbmc/pvr/windows/GUIViewStatePVR.cpp #: addons/skin.estuary/xml/Variables.xml #: addons/skin.estuary/xml/View_51_Poster.xml +#: addons/skin.estuary/xml/DialogPVRInfo.xml #: addons/skin.estuary/xml/DialogVideoInfo.xml msgctxt "#180" msgid "Duration" @@ -1259,6 +1260,7 @@ msgstr "" #: xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.cpp #: xbmc/pvr/windows/GUIWIndowPVRGuide.cpp #: xbmc/pvr/PVRContextMenus.cpp +#: addons/skin.estuary/xml/DialogPVRInfo.xml #: addons/skin.estuary/xml/Variables.xml msgctxt "#264" msgid "Record" @@ -2593,6 +2595,7 @@ msgid "Name" msgstr "" #. generic "date" label used in different places +#: addons/skin.estuary/xml/DialogPVRInfo.xml #: addons/skin.estuary/xml/Variables.xml #: xbmc/pvr/windows/GUIViewStatePVR.cpp msgctxt "#552" @@ -2671,6 +2674,7 @@ msgstr "" #: xbmc/playlists/SmartPlaylist.cpp #: xbmc/music/MusicUtils.cpp #: xbmc/video/dialogs/GUIDialogVideoInfo.cpp +#: addons/skin.estuary/xml/DialogPVRInfo.xml #: addons/skin.estuary/xml/DialogVideoInfo.xml #: addons/skin.estuary/xml/DialogFullScreenInfo.xml msgctxt "#563" @@ -2703,6 +2707,7 @@ msgstr "" #. generic "last played" label used in different places #: addons/skin.estuary/xml/Includes_MusicInfo.xml +#: addons/skin.estuary/xml/DialogPVRInfo.xml #: xbmc/dialogs/GUIDialogMediaFilter.cpp #: xbmc/playlists/SmartPlaylist.cpp #: xbmc/pvr/windows/GUIViewStatePVR.cpp @@ -2752,6 +2757,7 @@ msgctxt "#575" msgid "In progress" msgstr "" +#: addons/skin.estuary/xml/DialogPVRInfo.xml msgctxt "#576" msgid "Times played" msgstr "" @@ -9721,6 +9727,7 @@ msgid "or use phrases to find an exact match, like \"The wizard of Oz\"." msgstr "" #. Label of a context menu entry to find similar programs (matching a given epg event) +#: addons/skin.estuary/xml/DialogPVRInfo.xml #: xbmc/pvr/PVRContextMenuItem.cpp msgctxt "#19003" msgid "Find similar" @@ -9898,6 +9905,7 @@ msgstr "" #. generic 'channel' label used in different places #: addons/skin.estuary/xml/DialogFullScreenInfo.xml +#: addons/skin.estuary/xml/DialogPVRInfo.xml #: xbmc/filesystem/PluginDirectory.cpp #: xbmc/pvr/channels/PVRChannel.cpp #: xbmc/pvr/guilib/PVRGUIActionsPlayback.cpp @@ -12495,6 +12503,7 @@ msgid "Channel guide" msgstr "" #. Label for context menu entries, dialog heading, button to start playing a recording +#: addons/skin.estuary/xml/DialogPVRInfo.xml #: xbmc/pvr/PVRContextMenus.cpp #: xbmc/pvr/guilib/PVRGUIActionsPlayback.cpp msgctxt "#19687" @@ -15726,6 +15735,7 @@ msgctxt "#22030" msgid "Font" msgstr "" +#: addons/skin.estuary/xml/DialogPVRInfo.xml #: system/settings/settings.xml msgctxt "#22031" msgid "Size" diff --git a/addons/skin.estuary/xml/DialogPVRInfo.xml b/addons/skin.estuary/xml/DialogPVRInfo.xml index f66419cc39e8b..313bd199a415a 100644 --- a/addons/skin.estuary/xml/DialogPVRInfo.xml +++ b/addons/skin.estuary/xml/DialogPVRInfo.xml @@ -1,126 +1,372 @@ - 9000 + 5000 SetProperty(infobackground,$ESCINFO[ListItem.Art(fanart)],home) ClearProperty(infobackground,home) - - WindowOpen - WindowClose - Conditional - Window.isActive(fullscreenvideo) - ColoredBackgroundImages - 50% 1080 50% 1920 - + + 150 + 66 OpenClose_Left - 114 - 236 - 461 - 461 - keep - $INFO[ListItem.Icon] + + + -16 + -16 + 566 + 718 + stretch + dialogs/dialog-bg.png + + + 14 + 505 + 655 + center + keep + $INFO[ListItem.ChannelLogo] + !String.IsEmpty(ListItem.ChannelLogo) + String.IsEmpty(ListItem.Art(thumb)) + String.IsEmpty(ListItem.EpgEventIcon) + + + 14 + 505 + 655 + center + keep + $INFO[ListItem.EpgEventIcon] + String.IsEmpty(ListItem.ChannelLogo) + String.IsEmpty(ListItem.Art(thumb)) + !String.IsEmpty(ListItem.EpgEventIcon) + + + 14 + 505 + 655 + keep + center + $INFO[ListItem.Art(thumb)] + String.IsEmpty(ListItem.ChannelLogo) + !String.IsEmpty(ListItem.Art(thumb)) + String.IsEmpty(ListItem.EpgEventIcon) + + + 14 + 14 + 505 + 315 + keep + $INFO[ListItem.ChannelLogo] + !String.IsEmpty(ListItem.ChannelLogo) + [!String.IsEmpty(ListItem.Art(thumb)) | !String.IsEmpty(ListItem.EpgEventIcon)] + + + 14 + 360 + 505 + 315 + keep + $INFO[ListItem.EpgEventIcon] + !String.IsEmpty(ListItem.ChannelLogo) + String.IsEmpty(ListItem.Art(thumb)) + !String.IsEmpty(ListItem.EpgEventIcon) + + + 14 + 360 + 505 + 315 + keep + $INFO[ListItem.Art(thumb)] + !String.IsEmpty(ListItem.ChannelLogo) + !String.IsEmpty(ListItem.Art(thumb)) + String.IsEmpty(ListItem.EpgEventIcon) + + - 230 - 50 OpenClose_Right - - 600 - -18 - 1170 - 509 - - 61 - 61 - 9000 - 9000 - SetProperty(TextViewer_Header,$LOCALIZE[207],home) - SetProperty(TextViewer_Text,$ESCINFO[ListItem.Plot],home) - ActivateWindow(1102) + 600 + -30 + + 164 + + 774 + 718 + 40 + 20 + bottom + + SetProperty(TextViewer_Header,$LOCALIZE[207],home) + SetProperty(TextViewer_Text,$ESCINFO[ListItem.Plot],home) + ActivateWindow(1102) + 5000 + 4000 + 4000 + 5000 + dialogs/dialog-bg.png + Integer.IsGreater(Container(4000).NumItems,0) + + + 755 + 512 + 718 + bottom + dialogs/dialog-bg.png + Integer.IsGreater(Container(4000).NumItems,0) + + + 1265 + 718 + 40 + 20 + bottom + + SetProperty(TextViewer_Header,$LOCALIZE[207],home) + SetProperty(TextViewer_Text,$ESCINFO[ListItem.Plot],home) + ActivateWindow(1102) + 50 + 4000 + 4000 + 5000 + dialogs/dialog-bg.png + !Integer.IsGreater(Container(4000).NumItems,0) + + + 40 + 25 + 690 + 660 + + Skin.HasSetting(AutoScroll) + Integer.IsGreater(Container(4000).NumItems,0) + + + 40 + 25 + 1185 + 660 + + Skin.HasSetting(AutoScroll) + !Integer.IsGreater(Container(4000).NumItems,0) + - - 660 - 20 - 1050 - 425 - justify - - Skin.HasSetting(AutoScroll) + + vertical + 775 + 185 + 677 + -8 + 5000 + 5000 + 140 + 140 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - 150 - 600 - 1520 - 160 - 10 + + + OpenClose_Right + 90 + 864 + 1740 + 400 + + 5000 + 5000 + 140 + 140 + -18 center horizontal - 5 - 9000 - 9000 - 61 - 61 + 200 - - - - + - - - + + + + + + + + + + + + + + + + + + + + + - + + WindowOpen + WindowClose + 50% + 1920 + 0 + 70 + MediaFlags + + Control.HasFocus(138) + VisibleChange + 10 + 0 + + 4 + 17 + 36 + 36 + lists/played-total.png + + + 74 + 800 + 44 + text_shadow + + + + TouchBackButton diff --git a/xbmc/GUIInfoManager.cpp b/xbmc/GUIInfoManager.cpp index 160f80ef5194a..108d1829a7e66 100644 --- a/xbmc/GUIInfoManager.cpp +++ b/xbmc/GUIInfoManager.cpp @@ -2493,6 +2493,16 @@ const infomap musicpartymode[] = {{ "enabled", MUSICPM_ENABLED }, /// @return The genre(s) of current song. ///

/// } +/// \table_row3{ `MusicPlayer.Genre(separator)`, +/// \anchor MusicPlayer_Genre_separator +/// _string_, +/// @return A list of genres of current song\, separated by given separator\, or if no +/// separator was given separated by the advanced settings value \“itemseparator\” for music. +/// Possible values for separator: comma\, pipe\, slash\, cr\, dash\, colon\, semicolon\, fullstop +///


+/// @skinning_v22 **[New Infolabel]** \link MusicPlayer_Genre_separator `MusicPlayer.Genre(separator)`\endlink +///

+/// } /// \table_row3{ `MusicPlayer.offset(number).Genre`, /// \anchor MusicPlayer_OffSet_Genre /// _string_, @@ -3162,6 +3172,16 @@ const infomap musicplayer[] = {{ "title", MUSICPLAYER_TITLE }, /// @return The genre(s) of current movie\, if it's in the database. ///

/// } +/// \table_row3{ `VideoPlayer.Genre(separator)`, +/// \anchor VideoPlayer_Genre_separator +/// _string_, +/// @return A list of genres of current movie\, separated by given separator\, or if no +/// separator was given separated by the advanced settings value \“itemseparator\” for videos. +/// Possible values for separator: comma\, pipe\, slash\, cr\, dash\, colon\, semicolon\, fullstop +///


+/// @skinning_v22 **[New Infolabel]** \link VideoPlayer_Genre_separator `VideoPlayer.Genre(separator)`\endlink +///

+/// } /// \table_row3{ `VideoPlayer.offset(number).Genre`, /// \anchor VideoPlayer_Offset_Genre /// _string_, @@ -3187,6 +3207,17 @@ const infomap musicplayer[] = {{ "title", MUSICPLAYER_TITLE }, /// also supports EPG. ///

/// } +/// \table_row3{ `VideoPlayer.Director(separator)`, +/// \anchor VideoPlayer_Director_separator +/// _string_, +/// @return A list of directors of the currently playing video\, separated by given separator\, +/// or if no separator was given separated by the advanced settings value \“itemseparator\” for +/// video items. +/// Possible values for separator: comma\, pipe\, slash\, cr\, dash\, colon\, semicolon\, fullstop +///


+/// @skinning_v22 **[New Infolabel]** \link VideoPlayer_Director_separator `VideoPlayer.Director(separator)`\endlink +///

+/// } /// \table_row3{ `VideoPlayer.offset(number).Director`, /// \anchor VideoPlayer_Offset_Director /// _string_, @@ -3488,6 +3519,16 @@ const infomap musicplayer[] = {{ "title", MUSICPLAYER_TITLE }, /// also supports EPG. ///

/// } +/// \table_row3{ `VideoPlayer.Cast(separator)`, +/// \anchor VideoPlayer_Cast_separator +/// _string_, +/// @return A list of cast members of the currently playing video\, separated by given +/// separator\, or if no separator was given separated by carriage returns. +/// Possible values for separator: comma\, pipe\, slash\, cr\, dash\, colon\, semicolon\, fullstop +///


+/// @skinning_v22 **[New Infolabel]** \link VideoPlayer_Cast_separator `VideoPlayer.Cast(separator)`\endlink +///

+/// } /// \table_row3{ `VideoPlayer.CastAndRole`, /// \anchor VideoPlayer_CastAndRole /// _string_, @@ -3495,6 +3536,16 @@ const infomap musicplayer[] = {{ "title", MUSICPLAYER_TITLE }, /// returns. Every cast/role combination is formatted 'cast' as 'role' where 'as' is localised. ///

/// } +/// \table_row3{ `VideoPlayer.CastAndRole(separator)`, +/// \anchor VideoPlayer_CastAndRole_separator +/// _string_, +/// @return A list of cast members and roles of the currently playing video\, pairs separated by +/// given separator\, or if no separator was given separated by carriage returns. +/// Possible values for separator: comma\, pipe\, slash\, cr\, dash\, colon\, semicolon\, fullstop +///


+/// @skinning_v22 **[New Infolabel]** \link VideoPlayer_CastAndRole_separator `VideoPlayer.CastAndRole(separator)`\endlink +///

+/// } /// \table_row3{ `VideoPlayer.Album`, /// \anchor VideoPlayer_Album /// _string_, @@ -3570,6 +3621,17 @@ const infomap musicplayer[] = {{ "title", MUSICPLAYER_TITLE }, /// also supports EPG. ///

/// } +/// \table_row3{ `VideoPlayer.Writer(separator)`, +/// \anchor VideoPlayer_Writer_separator +/// _string_, +/// @return A list of writers of the currently playing video\, separated by given separator\, +/// or if no separator was given separated by the advanced settings value \“itemseparator\” for +/// video items. +/// Possible values for separator: comma\, pipe\, slash\, cr\, dash\, colon\, semicolon\, fullstop +///


+/// @skinning_v22 **[New Infolabel]** \link VideoPlayer_Writer_separator `VideoPlayer.Writer(separator)`\endlink +///

+/// } /// \table_row3{ `VideoPlayer.offset(number).Writer`, /// \anchor VideoPlayer_Offset_Writer /// _string_, @@ -3835,6 +3897,17 @@ const infomap musicplayer[] = {{ "title", MUSICPLAYER_TITLE }, /// @return The genre of the programme that will be played next (PVR). ///

/// } +/// \table_row3{ `VideoPlayer.NextGenre(separator)`, +/// \anchor VideoPlayer_NextGenre_separator +/// _string_, +/// @return A list of genres of the programme that will be played next (PVR)\, separated by +/// given separator\, or if no separator was given separated by the advanced settings value +/// \“itemseparator\” for videos. +/// Possible values for separator: comma\, pipe\, slash\, cr\, dash\, colon\, semicolon\, fullstop +///


+/// @skinning_v22 **[New Infolabel]** \link VideoPlayer_NextGenre_separator `VideoPlayer.NextGenre(separator)`\endlink +///

+/// } /// \table_row3{ `VideoPlayer.NextPlot`, /// \anchor VideoPlayer_NextPlot /// _string_, @@ -5107,6 +5180,16 @@ const infomap container_str[] = {{ "property", CONTAINER_PROPERTY }, /// container. ///

/// } +/// \table_row3{ `ListItem.Genre(separator)`, +/// \anchor ListItem_Genre_separator +/// _string_, +/// @return A list of genres\, separated by given separator\, or if no separator was given +/// separated by the advanced settings value \“itemseparator\” for videos or music. +/// Possible values for separator: comma\, pipe\, slash\, cr\, dash\, colon\, semicolon\, fullstop +///


+/// @skinning_v22 **[New Infolabel]** \link ListItem_Genre_separator `ListItem.Genre(separator)`\endlink +///

+/// } /// \table_row3{ `ListItem.Contributors`, /// \anchor ListItem_Contributors /// _string_, @@ -5132,6 +5215,16 @@ const infomap container_str[] = {{ "property", CONTAINER_PROPERTY }, /// also supports EPG. ///

/// } +/// \table_row3{ `ListItem.Director(separator)`, +/// \anchor ListItem_Director_separator +/// _string_, +/// @return A list of directors\, separated by given separator\, or if no separator was given +/// separated by the advanced settings value \“itemseparator\” for video items. +/// Possible values for separator: comma\, pipe\, slash\, cr\, dash\, colon\, semicolon\, fullstop +///


+/// @skinning_v22 **[New Infolabel]** \link ListItem_Director_separator `ListItem.Director(separator)`\endlink +///

+/// } /// \table_row3{ `ListItem.Country`, /// \anchor ListItem_Country /// _string_, @@ -5967,6 +6060,16 @@ const infomap container_str[] = {{ "property", CONTAINER_PROPERTY }, /// also supports EPG. ///

/// } +/// \table_row3{ `ListItem.Cast(separator)`, +/// \anchor ListItem_Cast_separator +/// _string_, +/// @return A list of cast members\, separated by given separator\, or if no separator was +/// given separated by carriage returns. +/// Possible values for separator: comma\, pipe\, slash\, cr\, dash\, colon\, semicolon\, fullstop +///


+/// @skinning_v22 **[New Infolabel]** \link ListItem_Cast_separator `ListItem.Cast(separator)`\endlink +///

+/// } /// \table_row3{ `ListItem.CastAndRole`, /// \anchor ListItem_CastAndRole /// _string_, @@ -5974,6 +6077,16 @@ const infomap container_str[] = {{ "property", CONTAINER_PROPERTY }, /// returns. Every cast/role combination is formatted 'cast' as 'role' where 'as' is localised. ///

/// } +/// \table_row3{ `ListItem.CastAndRole(separator)`, +/// \anchor ListItem_CastAndRole_separator +/// _string_, +/// @return A list of cast members and roles\, separated by given separator\, or if no separator +/// was given separated by carriage returns. +/// Possible values for separator: comma\, pipe\, slash\, cr\, dash\, colon\, semicolon\, fullstop +///


+/// @skinning_v22 **[New Infolabel]** \link ListItem_CastAndRole_separator `ListItem.CastAndRole(separator)`\endlink +///

+/// } /// \table_row3{ `ListItem.Studio`, /// \anchor ListItem_Studio /// _string_, @@ -6003,6 +6116,16 @@ const infomap container_str[] = {{ "property", CONTAINER_PROPERTY }, /// also supports EPG. ///

/// } +/// \table_row3{ `ListItem.Writer(separator)`, +/// \anchor ListItem_Writer_separator +/// _string_, +/// @return A list of writers\, separated by given separator\, or if no separator was given +/// separated by the advanced settings value \“itemseparator\” for video items. +/// Possible values for separator: comma\, pipe\, slash\, cr\, dash\, colon\, semicolon\, fullstop +///


+/// @skinning_v22 **[New Infolabel]** \link ListItem_Writer_separator `ListItem.Writer(separator)`\endlink +///

+/// } /// \table_row3{ `ListItem.Tag`, /// \anchor ListItem_Tag /// _string_, @@ -6316,6 +6439,17 @@ const infomap container_str[] = {{ "property", CONTAINER_PROPERTY }, /// @return The genre of the next item (PVR). ///

/// } +/// \table_row3{ `ListItem.NextGenre(separator)`, +/// \anchor ListItem_NextGenre_separator +/// _string_, +/// @return A list of genres of the the next item (PVR)\, separated by given separator\, or if +/// no separator was given separated by the advanced settings value \“itemseparator\” for +/// videos. +/// Possible values for separator: comma\, pipe\, slash\, cr\, dash\, colon\, semicolon\, fullstop +///


+/// @skinning_v22 **[New Infolabel]** \link ListItem_NextGenre_separator `ListItem.NextGenre(separator)`\endlink +///

+/// } /// \table_row3{ `ListItem.NextPlot`, /// \anchor ListItem_NextPlot /// _string_, @@ -10220,6 +10354,34 @@ int CGUIInfoManager::TranslateSingleString(const std::string &strCondition) return TranslateSingleString(strCondition, listItemDependent); } +namespace +{ +std::string TranslateListSeparator(const std::string& param) +{ + if (StringUtils::EqualsNoCase(param, "comma")) + return ","; + else if (StringUtils::EqualsNoCase(param, "pipe")) + return "|"; + else if (StringUtils::EqualsNoCase(param, "slash")) + return "/"; + else if (StringUtils::EqualsNoCase(param, "cr")) + return "\n"; + else if (StringUtils::EqualsNoCase(param, "dash")) + return "-"; + else if (StringUtils::EqualsNoCase(param, "colon")) + return ":"; + else if (StringUtils::EqualsNoCase(param, "semicolon")) + return ";"; + else if (StringUtils::EqualsNoCase(param, "fullstop")) + return "."; + else + { + CLog::Log(LOGERROR, "unhandled separator param {}", param); + return {}; + } +} +} // unnamed namespace + int CGUIInfoManager::TranslateSingleString(const std::string &strCondition, bool &listItemDependent) { /* We need to disable caching in INFO::InfoBool::Get if either of the following are true: @@ -10525,7 +10687,13 @@ int CGUIInfoManager::TranslateSingleString(const std::string &strCondition, bool return AddMultiInfo(CGUIInfo(player_time.val, TranslateTimeFormat(prop.param()))); } if (prop.name == "content" && prop.num_params()) + { return AddMultiInfo(CGUIInfo(MUSICPLAYER_CONTENT, prop.param(), 0)); + } + else if (prop.name == "genre" && prop.num_params() > 0) + { + return AddMultiInfo(CGUIInfo(MUSICPLAYER_GENRE, TranslateListSeparator(prop.param()), 0)); + } else if (prop.name == "property") { if (StringUtils::EqualsNoCase(prop.param(), "fanart_image")) @@ -10557,6 +10725,33 @@ int CGUIInfoManager::TranslateSingleString(const std::string &strCondition, bool { return AddMultiInfo(CGUIInfo(VIDEOPLAYER_ART, prop.param(), 0)); } + if (prop.name == "cast" && prop.num_params() > 0) + { + return AddMultiInfo(CGUIInfo(VIDEOPLAYER_CAST, TranslateListSeparator(prop.param()), 0)); + } + if (prop.name == "castandrole" && prop.num_params() > 0) + { + return AddMultiInfo( + CGUIInfo(VIDEOPLAYER_CAST_AND_ROLE, TranslateListSeparator(prop.param()), 0)); + } + if (prop.name == "writer" && prop.num_params() > 0) + { + return AddMultiInfo(CGUIInfo(VIDEOPLAYER_WRITER, TranslateListSeparator(prop.param()), 0)); + } + if (prop.name == "director" && prop.num_params() > 0) + { + return AddMultiInfo( + CGUIInfo(VIDEOPLAYER_DIRECTOR, TranslateListSeparator(prop.param()), 0)); + } + if (prop.name == "genre" && prop.num_params() > 0) + { + return AddMultiInfo(CGUIInfo(VIDEOPLAYER_GENRE, TranslateListSeparator(prop.param()), 0)); + } + if (prop.name == "nextgenre" && prop.num_params() > 0) + { + return AddMultiInfo( + CGUIInfo(VIDEOPLAYER_NEXT_GENRE, TranslateListSeparator(prop.param()), 0)); + } return TranslateVideoPlayerString(prop.name); } else if (cat.name == "retroplayer") @@ -10885,6 +11080,11 @@ int CGUIInfoManager::TranslateListItem(const Property& cat, const Property& prop { data3 = prop.param(); } + else if (prop.name == "cast" || prop.name == "castandrole" || prop.name == "director" || + prop.name == "writer" || prop.name == "genre" || prop.name == "nextgenre") + { + data3 = TranslateListSeparator(prop.param()); + } else if (prop.name == "duration" || prop.name == "nextduration") { data4 = TranslateTimeFormat(prop.param()); diff --git a/xbmc/guilib/guiinfo/MusicGUIInfo.cpp b/xbmc/guilib/guiinfo/MusicGUIInfo.cpp index 79bd4b13b7161..54ce7ab508e9c 100644 --- a/xbmc/guilib/guiinfo/MusicGUIInfo.cpp +++ b/xbmc/guilib/guiinfo/MusicGUIInfo.cpp @@ -188,8 +188,14 @@ bool CMusicGUIInfo::GetLabel(std::string& value, const CFileItem *item, int cont return true; case MUSICPLAYER_GENRE: case LISTITEM_GENRE: - value = StringUtils::Join(tag->GetGenre(), CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_musicItemSeparator); + { + const std::string sep{info.GetData3().empty() ? CServiceBroker::GetSettingsComponent() + ->GetAdvancedSettings() + ->m_musicItemSeparator + : info.GetData3()}; + value = StringUtils::Join(tag->GetGenre(), sep); return true; + } case MUSICPLAYER_LYRICS: value = tag->GetLyrics(); return true; diff --git a/xbmc/guilib/guiinfo/VideoGUIInfo.cpp b/xbmc/guilib/guiinfo/VideoGUIInfo.cpp index 5fd1e3cb9bede..c91715b5ea1a7 100644 --- a/xbmc/guilib/guiinfo/VideoGUIInfo.cpp +++ b/xbmc/guilib/guiinfo/VideoGUIInfo.cpp @@ -143,12 +143,24 @@ bool CVideoGUIInfo::GetLabel(std::string& value, const CFileItem *item, int cont return true; case VIDEOPLAYER_GENRE: case LISTITEM_GENRE: - value = StringUtils::Join(tag->m_genre, CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_videoItemSeparator); + { + const std::string sep{info.GetData3().empty() ? CServiceBroker::GetSettingsComponent() + ->GetAdvancedSettings() + ->m_videoItemSeparator + : info.GetData3()}; + value = StringUtils::Join(tag->m_genre, sep); return true; + } case VIDEOPLAYER_DIRECTOR: case LISTITEM_DIRECTOR: - value = StringUtils::Join(tag->m_director, CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_videoItemSeparator); + { + const std::string sep{info.GetData3().empty() ? CServiceBroker::GetSettingsComponent() + ->GetAdvancedSettings() + ->m_videoItemSeparator + : info.GetData3()}; + value = StringUtils::Join(tag->m_director, sep); return true; + } case VIDEOPLAYER_IMDBNUMBER: case LISTITEM_IMDBNUMBER: value = tag->GetUniqueID(); @@ -300,11 +312,11 @@ bool CVideoGUIInfo::GetLabel(std::string& value, const CFileItem *item, int cont break; case VIDEOPLAYER_CAST: case LISTITEM_CAST: - value = tag->GetCast(); + value = tag->GetCast(info.GetData3()); return true; case VIDEOPLAYER_CAST_AND_ROLE: case LISTITEM_CAST_AND_ROLE: - value = tag->GetCast(true); + value = tag->GetCast(info.GetData3(), true); return true; case VIDEOPLAYER_ARTIST: case LISTITEM_ARTIST: @@ -316,8 +328,14 @@ bool CVideoGUIInfo::GetLabel(std::string& value, const CFileItem *item, int cont return true; case VIDEOPLAYER_WRITER: case LISTITEM_WRITER: - value = StringUtils::Join(tag->m_writingCredits, CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_videoItemSeparator); + { + const std::string sep{info.GetData3().empty() ? CServiceBroker::GetSettingsComponent() + ->GetAdvancedSettings() + ->m_videoItemSeparator + : info.GetData3()}; + value = StringUtils::Join(tag->m_writingCredits, sep); return true; + } case VIDEOPLAYER_TAGLINE: case LISTITEM_TAGLINE: value = tag->m_strTagLine; diff --git a/xbmc/interfaces/legacy/InfoTagVideo.cpp b/xbmc/interfaces/legacy/InfoTagVideo.cpp index f81d3f69579ec..aa9834064ca1c 100644 --- a/xbmc/interfaces/legacy/InfoTagVideo.cpp +++ b/xbmc/interfaces/legacy/InfoTagVideo.cpp @@ -219,7 +219,7 @@ namespace XBMCAddon String InfoTagVideo::getCast() { - return infoTag->GetCast(true); + return infoTag->GetCast("\n", true); } std::vector InfoTagVideo::getActors() diff --git a/xbmc/pvr/epg/EpgInfoTag.cpp b/xbmc/pvr/epg/EpgInfoTag.cpp index 3abdc77bc095d..4b3419e72d341 100644 --- a/xbmc/pvr/epg/EpgInfoTag.cpp +++ b/xbmc/pvr/epg/EpgInfoTag.cpp @@ -361,34 +361,38 @@ unsigned int CPVREpgInfoTag::GetDuration() const } } -const std::string CPVREpgInfoTag::GetCastLabel() const +const std::string CPVREpgInfoTag::GetCastLabel(const std::string& separator) const { // Note: see CVideoInfoTag::GetCast for reference implementation. - std::string strLabel; - for (const auto& castEntry : m_cast) - strLabel += StringUtils::Format("{}\n", castEntry); - - return StringUtils::TrimRight(strLabel, "\n"); + const std::string sep{separator.empty() ? "\n" : separator}; + return StringUtils::Join(m_cast, sep); } -const std::string CPVREpgInfoTag::GetDirectorsLabel() const +const std::string CPVREpgInfoTag::GetDirectorsLabel(const std::string& separator) const { - return StringUtils::Join( - m_directors, - CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_videoItemSeparator); + const std::string sep{ + separator.empty() + ? CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_videoItemSeparator + : separator}; + return StringUtils::Join(m_directors, sep); } -const std::string CPVREpgInfoTag::GetWritersLabel() const +const std::string CPVREpgInfoTag::GetWritersLabel(const std::string& separator) const { - return StringUtils::Join( - m_writers, - CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_videoItemSeparator); + const std::string sep{ + separator.empty() + ? CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_videoItemSeparator + : separator}; + return StringUtils::Join(m_writers, sep); } -const std::string CPVREpgInfoTag::GetGenresLabel() const +const std::string CPVREpgInfoTag::GetGenresLabel(const std::string& separator) const { - return StringUtils::Join( - Genre(), CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_videoItemSeparator); + const std::string sep{ + separator.empty() + ? CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_videoItemSeparator + : separator}; + return StringUtils::Join(Genre(), sep); } int CPVREpgInfoTag::Year() const diff --git a/xbmc/pvr/epg/EpgInfoTag.h b/xbmc/pvr/epg/EpgInfoTag.h index b5c70988ecbc1..aa1b7270a5ee1 100644 --- a/xbmc/pvr/epg/EpgInfoTag.h +++ b/xbmc/pvr/epg/EpgInfoTag.h @@ -238,28 +238,32 @@ class CPVREpgInfoTag final : public ISerializable, const std::vector& Writers() const { return m_writers; } /*! - * @brief Get the cast of this event as formatted string. + * @brief Get the cast members of this event as formatted string. + * @param separator The separator for the different cast members, default value if empty. * @return The cast label. */ - const std::string GetCastLabel() const; + const std::string GetCastLabel(const std::string& separator) const; /*! * @brief Get the director(s) of this event as formatted string. + * @param separator The separator for the different directors, default value if empty. * @return The directors label. */ - const std::string GetDirectorsLabel() const; + const std::string GetDirectorsLabel(const std::string& separator) const; /*! * @brief Get the writer(s) of this event as formatted string. + * @param separator The separator for the different writers, default value if empty. * @return The writers label. */ - const std::string GetWritersLabel() const; + const std::string GetWritersLabel(const std::string& separator) const; /*! * @brief Get the genre(s) of this event as formatted string. + * @param separator The separator for the different genres, default value if empty. * @return The genres label. */ - const std::string GetGenresLabel() const; + const std::string GetGenresLabel(const std::string& separator) const; /*! * @brief Get the year of this event. diff --git a/xbmc/pvr/guilib/guiinfo/PVRGUIInfo.cpp b/xbmc/pvr/guilib/guiinfo/PVRGUIInfo.cpp index d20ad906a9f7d..363cb72e4e354 100644 --- a/xbmc/pvr/guilib/guiinfo/PVRGUIInfo.cpp +++ b/xbmc/pvr/guilib/guiinfo/PVRGUIInfo.cpp @@ -736,7 +736,7 @@ bool CPVRGUIInfo::GetListItemAndPlayerLabel(const CFileItem* item, case LISTITEM_GENRE: case VIDEOPLAYER_NEXT_GENRE: case LISTITEM_NEXT_GENRE: - strValue = epgTag->GetGenresLabel(); + strValue = epgTag->GetGenresLabel(info.GetData3()); return true; case VIDEOPLAYER_PLOT: case LISTITEM_PLOT: @@ -831,15 +831,15 @@ bool CPVRGUIInfo::GetListItemAndPlayerLabel(const CFileItem* item, return true; case VIDEOPLAYER_CAST: case LISTITEM_CAST: - strValue = epgTag->GetCastLabel(); + strValue = epgTag->GetCastLabel(info.GetData3()); return true; case VIDEOPLAYER_DIRECTOR: case LISTITEM_DIRECTOR: - strValue = epgTag->GetDirectorsLabel(); + strValue = epgTag->GetDirectorsLabel(info.GetData3()); return true; case VIDEOPLAYER_WRITER: case LISTITEM_WRITER: - strValue = epgTag->GetWritersLabel(); + strValue = epgTag->GetWritersLabel(info.GetData3()); return true; case LISTITEM_EPG_EVENT_ICON: strValue = epgTag->IconPath(); diff --git a/xbmc/video/VideoInfoTag.cpp b/xbmc/video/VideoInfoTag.cpp index f2cb7202f6214..e3c6809b1028f 100644 --- a/xbmc/video/VideoInfoTag.cpp +++ b/xbmc/video/VideoInfoTag.cpp @@ -982,20 +982,22 @@ bool CVideoInfoTag::HasUniqueID() const return !m_uniqueIDs.empty(); } -const std::string CVideoInfoTag::GetCast(bool bIncludeRole /*= false*/) const +const std::string CVideoInfoTag::GetCast(const std::string& separator, + bool bIncludeRole /*= false*/) const { + const std::string sep{separator.empty() ? "\n" : separator}; std::string strLabel; for (iCast it = m_cast.begin(); it != m_cast.end(); ++it) { std::string character; if (it->strRole.empty() || !bIncludeRole) - character = StringUtils::Format("{}\n", it->strName); + character = StringUtils::Format("{}{}", it->strName, sep); else - character = - StringUtils::Format("{} {} {}\n", it->strName, g_localizeStrings.Get(20347), it->strRole); + character = StringUtils::Format("{} {} {}{}", it->strName, g_localizeStrings.Get(20347), + it->strRole, sep); strLabel += character; } - return StringUtils::TrimRight(strLabel, "\n"); + return StringUtils::TrimRight(strLabel, sep.c_str()); } void CVideoInfoTag::ParseNative(const TiXmlElement* movie, bool prioritise) diff --git a/xbmc/video/VideoInfoTag.h b/xbmc/video/VideoInfoTag.h index adf3535d726ee..56d41270ef229 100644 --- a/xbmc/video/VideoInfoTag.h +++ b/xbmc/video/VideoInfoTag.h @@ -88,7 +88,7 @@ class CVideoInfoTag : public IArchivable, public ISerializable, public ISortable bool HasPremiered() const; const CDateTime& GetPremiered() const; const CDateTime& GetFirstAired() const; - const std::string GetCast(bool bIncludeRole = false) const; + const std::string GetCast(const std::string& separator, bool bIncludeRole = false) const; bool HasStreamDetails() const; bool IsEmpty() const;