diff options
-rw-r--r-- | xbmc/FileItem.cpp | 12 | ||||
-rw-r--r-- | xbmc/interfaces/json-rpc/AudioLibrary.cpp | 5 | ||||
-rw-r--r-- | xbmc/interfaces/json-rpc/PlayerOperations.cpp | 17 | ||||
-rw-r--r-- | xbmc/interfaces/json-rpc/VideoLibrary.cpp | 4 |
4 files changed, 29 insertions, 9 deletions
diff --git a/xbmc/FileItem.cpp b/xbmc/FileItem.cpp index 8b55e92e62..a8fe8ceea2 100644 --- a/xbmc/FileItem.cpp +++ b/xbmc/FileItem.cpp @@ -1468,7 +1468,8 @@ void CFileItem::UpdateInfo(const CFileItem &item, bool replaceLabels /*=true*/) void CFileItem::SetFromVideoInfoTag(const CVideoInfoTag &video) { - SetLabel(video.m_strTitle); + if (!video.m_strTitle.empty()) + SetLabel(video.m_strTitle); if (video.m_strFileNameAndPath.IsEmpty()) { m_strPath = video.m_strPath; @@ -1489,7 +1490,8 @@ void CFileItem::SetFromVideoInfoTag(const CVideoInfoTag &video) void CFileItem::SetFromAlbum(const CAlbum &album) { - SetLabel(album.strAlbum); + if (!album.strAlbum.empty()) + SetLabel(album.strAlbum); m_bIsFolder = true; m_strLabel2 = StringUtils::Join(album.artist, g_advancedSettings.m_musicItemSeparator); GetMusicInfoTag()->SetAlbum(album); @@ -1499,8 +1501,10 @@ void CFileItem::SetFromAlbum(const CAlbum &album) void CFileItem::SetFromSong(const CSong &song) { - SetLabel(song.strTitle); - m_strPath = song.strFileName; + if (!song.strTitle.empty()) + SetLabel(song.strTitle); + if (!song.strFileName.empty()) + m_strPath = song.strFileName; GetMusicInfoTag()->SetSong(song); m_lStartOffset = song.iStartOffset; m_lStartPartNumber = 1; diff --git a/xbmc/interfaces/json-rpc/AudioLibrary.cpp b/xbmc/interfaces/json-rpc/AudioLibrary.cpp index 31f2ef1455..33eb657a52 100644 --- a/xbmc/interfaces/json-rpc/AudioLibrary.cpp +++ b/xbmc/interfaces/json-rpc/AudioLibrary.cpp @@ -591,6 +591,11 @@ bool CAudioLibrary::FillFileItem(const CStdString &strFilename, CFileItemPtr &it return false; } + if (item->GetLabel().empty()) + item->SetLabel(CUtil::GetTitleFromPath(strFilename, false)); + if (item->GetLabel()) + item->SetLabel(URIUtils::GetFileName(strFilename)); + return true; } diff --git a/xbmc/interfaces/json-rpc/PlayerOperations.cpp b/xbmc/interfaces/json-rpc/PlayerOperations.cpp index f1bc3dd079..0bc58d81bd 100644 --- a/xbmc/interfaces/json-rpc/PlayerOperations.cpp +++ b/xbmc/interfaces/json-rpc/PlayerOperations.cpp @@ -140,17 +140,21 @@ JSONRPC_STATUS CPlayerOperations::GetItem(const CStdString &method, ITransportLa if (player == Video) { bool additionalInfo = false; + bool streamdetails = false; for (CVariant::const_iterator_array itr = parameterObject["properties"].begin_array(); itr != parameterObject["properties"].end_array(); itr++) { CStdString fieldValue = itr->asString(); if (fieldValue == "cast" || fieldValue == "set" || fieldValue == "setid" || fieldValue == "showlink" || fieldValue == "resume") additionalInfo = true; + else if (fieldValue == "streamdetails" && !fileItem->GetVideoInfoTag()->m_streamDetails.HasItems()) + streamdetails = true; } - if (additionalInfo) + CVideoDatabase videodatabase; + if ((additionalInfo || streamdetails) && + videodatabase.Open()) { - CVideoDatabase videodatabase; - if (videodatabase.Open()) + if (additionalInfo) { switch (fileItem->GetVideoContentType()) { @@ -171,9 +175,12 @@ JSONRPC_STATUS CPlayerOperations::GetItem(const CStdString &method, ITransportLa default: break; } - - videodatabase.Close(); } + + if (streamdetails) + videodatabase.GetStreamDetails(*(fileItem->GetVideoInfoTag())); + + videodatabase.Close(); } } else if (player == Audio) diff --git a/xbmc/interfaces/json-rpc/VideoLibrary.cpp b/xbmc/interfaces/json-rpc/VideoLibrary.cpp index a1d0e4f000..de3640c0fd 100644 --- a/xbmc/interfaces/json-rpc/VideoLibrary.cpp +++ b/xbmc/interfaces/json-rpc/VideoLibrary.cpp @@ -731,6 +731,10 @@ bool CVideoLibrary::FillFileItem(const CStdString &strFilename, CFileItemPtr &it return false; item->SetFromVideoInfoTag(details); + if (item->GetLabel().empty()) + item->SetLabel(CUtil::GetTitleFromPath(strFilename, false)); + if (item->GetLabel()) + item->SetLabel(URIUtils::GetFileName(strFilename)); return true; } |