aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaveTBlake <oak99sky@yahoo.co.uk>2015-12-01 15:52:09 +0000
committerDaveTBlake <oak99sky@yahoo.co.uk>2015-12-01 15:52:09 +0000
commitd379c2aee95c1c968fcd41b847ff9d31549372fc (patch)
tree95a0f64251e0f3df071707158af623271348c493
parent07d86f3aa9e8f9d9d8929c00e5a266e1b96048cc (diff)
Set FileItem from MusicInfoTag rather than create new and lose artwork in CPlayerOperations::GetItem. This now similar to how video handled.
-rw-r--r--xbmc/FileItem.cpp13
-rw-r--r--xbmc/FileItem.h7
-rw-r--r--xbmc/interfaces/json-rpc/PlayerOperations.cpp2
-rw-r--r--xbmc/interfaces/json-rpc/schema/version.txt2
4 files changed, 22 insertions, 2 deletions
diff --git a/xbmc/FileItem.cpp b/xbmc/FileItem.cpp
index d3ea6813da..c5f07acfa3 100644
--- a/xbmc/FileItem.cpp
+++ b/xbmc/FileItem.cpp
@@ -1438,6 +1438,19 @@ void CFileItem::SetFromVideoInfoTag(const CVideoInfoTag &video)
FillInMimeType(false);
}
+void CFileItem::SetFromMusicInfoTag(const MUSIC_INFO::CMusicInfoTag &music)
+{
+ if (!music.GetTitle().empty())
+ SetLabel(music.GetTitle());
+ if (!music.GetURL().empty())
+ m_strPath = music.GetURL();
+ m_bIsFolder = URIUtils::HasSlashAtEnd(m_strPath);
+
+ *GetMusicInfoTag() = music;
+ FillInDefaultIcon();
+ FillInMimeType(false);
+}
+
void CFileItem::SetFromAlbum(const CAlbum &album)
{
if (!album.strAlbum.empty())
diff --git a/xbmc/FileItem.h b/xbmc/FileItem.h
index 159fd677e2..293f979d64 100644
--- a/xbmc/FileItem.h
+++ b/xbmc/FileItem.h
@@ -466,6 +466,13 @@ public:
\param video video details to use and set
*/
void SetFromVideoInfoTag(const CVideoInfoTag &video);
+
+ /*! \brief Sets details using the information from the CMusicInfoTag object
+ Sets the musicinfotag and uses its information to set the label and path.
+ \param music music details to use and set
+ */
+ void SetFromMusicInfoTag(const MUSIC_INFO::CMusicInfoTag &music);
+
/*! \brief Sets details using the information from the CAlbum object
Sets the album in the music info tag and uses its information to set the
label and album-specific properties.
diff --git a/xbmc/interfaces/json-rpc/PlayerOperations.cpp b/xbmc/interfaces/json-rpc/PlayerOperations.cpp
index b0ee2c8a9b..f30416176d 100644
--- a/xbmc/interfaces/json-rpc/PlayerOperations.cpp
+++ b/xbmc/interfaces/json-rpc/PlayerOperations.cpp
@@ -193,7 +193,7 @@ JSONRPC_STATUS CPlayerOperations::GetItem(const std::string &method, ITransportL
if (currentMusicTag != NULL)
{
std::string originalLabel = fileItem->GetLabel();
- fileItem = CFileItemPtr(new CFileItem(*currentMusicTag));
+ fileItem->SetFromMusicInfoTag(*currentMusicTag);
if (fileItem->GetLabel().empty())
fileItem->SetLabel(originalLabel);
}
diff --git a/xbmc/interfaces/json-rpc/schema/version.txt b/xbmc/interfaces/json-rpc/schema/version.txt
index 45d6fb348d..b02bea9d2b 100644
--- a/xbmc/interfaces/json-rpc/schema/version.txt
+++ b/xbmc/interfaces/json-rpc/schema/version.txt
@@ -1 +1 @@
-6.32.1
+6.32.2