diff options
author | Kai Sommerfeld <kai.sommerfeld@gmx.com> | 2018-04-18 17:12:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-18 17:12:46 +0200 |
commit | 16abdf86a30d933a1532592c45a48b799f1c430b (patch) | |
tree | 5099e0373116c1d74c3322d8173aca8547f48e2c | |
parent | f4489bffe22487bc906e79130832c14360a42a8a (diff) | |
parent | 36c54a7530dc64ad4d2e34d4fd53b600523defb8 (diff) |
Merge pull request #13786 from ksooo/guiinfo-fix-player-title
[guiinfo] Fix PLAYER_TITLE fallbacks.
-rw-r--r-- | xbmc/guilib/guiinfo/MusicGUIInfo.cpp | 15 | ||||
-rw-r--r-- | xbmc/guilib/guiinfo/VideoGUIInfo.cpp | 15 |
2 files changed, 16 insertions, 14 deletions
diff --git a/xbmc/guilib/guiinfo/MusicGUIInfo.cpp b/xbmc/guilib/guiinfo/MusicGUIInfo.cpp index 262d8988df..98ceb14c66 100644 --- a/xbmc/guilib/guiinfo/MusicGUIInfo.cpp +++ b/xbmc/guilib/guiinfo/MusicGUIInfo.cpp @@ -25,6 +25,7 @@ #include "PartyModeManager.h" #include "PlayListPlayer.h" #include "URL.h" +#include "Util.h" #include "guilib/LocalizeStrings.h" #include "music/MusicInfoLoader.h" #include "music/MusicThumbLoader.h" @@ -95,16 +96,16 @@ bool CMusicGUIInfo::GetLabel(std::string& value, const CFileItem *item, int cont switch (info.m_info) { ///////////////////////////////////////////////////////////////////////////////////////////// - // PLAYER_* + // PLAYER_* / MUSICPLAYER_* / LISTITEM_* ///////////////////////////////////////////////////////////////////////////////////////////// case PLAYER_TITLE: - value = tag->GetTitle(); - return !value.empty(); - - ///////////////////////////////////////////////////////////////////////////////////////////// - // MUSICPLAYER_* / LISTITEM_* - ///////////////////////////////////////////////////////////////////////////////////////////// case MUSICPLAYER_TITLE: + value = tag->GetTitle(); + if (value.empty()) + value = item->GetLabel(); + if (value.empty()) + value = CUtil::GetTitleFromPath(item->GetPath()); + return true; case LISTITEM_TITLE: value = tag->GetTitle(); return !value.empty(); diff --git a/xbmc/guilib/guiinfo/VideoGUIInfo.cpp b/xbmc/guilib/guiinfo/VideoGUIInfo.cpp index cc97ac2dc3..032d965e6d 100644 --- a/xbmc/guilib/guiinfo/VideoGUIInfo.cpp +++ b/xbmc/guilib/guiinfo/VideoGUIInfo.cpp @@ -26,6 +26,7 @@ #include "FileItem.h" #include "ServiceBroker.h" #include "URL.h" +#include "Util.h" #include "cores/DataCacheCore.h" #include "cores/VideoPlayer/VideoRenderers/BaseRenderer.h" #include "guilib/GUIComponent.h" @@ -100,16 +101,16 @@ bool CVideoGUIInfo::GetLabel(std::string& value, const CFileItem *item, int cont switch (info.m_info) { ///////////////////////////////////////////////////////////////////////////////////////////// - // PLAYER_* + // PLAYER_* / VIDEOPLAYER_* / LISTITEM_* ///////////////////////////////////////////////////////////////////////////////////////////// case PLAYER_TITLE: - value = tag->m_strTitle; - return !value.empty(); - - ///////////////////////////////////////////////////////////////////////////////////////////// - // VIDEOPLAYER_* / LISTITEM_* - ///////////////////////////////////////////////////////////////////////////////////////////// case VIDEOPLAYER_TITLE: + value = tag->m_strTitle; + if (value.empty()) + value = item->GetLabel(); + if (value.empty()) + value = CUtil::GetTitleFromPath(item->GetPath()); + return true; case LISTITEM_TITLE: value = tag->m_strTitle; return !value.empty(); |