From: <ar...@us...> - 2011-07-07 20:00:43
|
Revision: 30917 http://xbmc4xbox.svn.sourceforge.net/xbmc4xbox/?rev=30917&view=rev Author: arnova Date: 2011-07-07 20:00:36 +0000 (Thu, 07 Jul 2011) Log Message: ----------- merged: xbmc mainline - 962e67a329a97eedab4317b274a8a7083a3de7a7 - changed: have upnp view states update based on container ontent - 239ccf2ed8eea371dfd3e9631debe839a792101a - changed: provide fanart as resource over upnp and use it as a client - 15d786a7c0a5f742aab430dd57156c0bae073c88 - ensure SORT_ORDER_NONE is set only if the sort method is SORT_METHOD_NONE Modified Paths: -------------- trunk/xbmc/FileSystem/UPnPDirectory.cpp trunk/xbmc/GUIViewState.cpp Modified: trunk/xbmc/FileSystem/UPnPDirectory.cpp =================================================================== --- trunk/xbmc/FileSystem/UPnPDirectory.cpp 2011-07-07 15:31:46 UTC (rev 30916) +++ trunk/xbmc/FileSystem/UPnPDirectory.cpp 2011-07-07 20:00:36 UTC (rev 30917) @@ -61,13 +61,16 @@ const char* Content; }; static const SClassMapping mapping[] = { - { "object.item.videoItem.videoBroadcast", "tvshows" } + { "object.item.videoItem.videoBroadcast", "episodes" } , { "object.item.videoItem.musicVideoClip", "musicvideos" } , { "object.item.videoItem" , "movies" } - , { "object.item.audioItem.musicTrack" , "music" } - , { "object.item.audioItem" , "music" } + , { "object.item.audioItem.musicTrack" , "songs" } + , { "object.item.audioItem" , "songs" } , { "object.item.imageItem.photo" , "photos" } , { "object.item.imageItem" , "photos" } + , { "object.container.album.videoAlbum" , "tvshows" } + , { "object.container.album.musicAlbum" , "albums" } + , { "object.container.album.photoAlbum" , "photos" } , { "object.container.album" , "albums" } , { "object.container.person" , "artists" } , { NULL , NULL } @@ -182,7 +185,7 @@ return false; PLT_MediaObjectList::Iterator entry = list->GetFirstItem(); - if (entry == NULL) + if (entry == 0) return false; PLT_MediaItemResource resource; @@ -384,6 +387,8 @@ } } + NPT_String ObjectClass = (*entry)->m_ObjectClass.type.ToLowercase(); + // keep count of classes classes[(*entry)->m_ObjectClass.type]++; @@ -401,15 +406,28 @@ CStdString id = (char*) (*entry)->m_ObjectID; CUtil::URLEncode(id); pItem->m_strPath += "/"; + + // look for metadata + if( ObjectClass.StartsWith("object.container.album.videoalbum") ) { + pItem->SetLabelPreformated(false); + CUPnP::PopulateTagFromObject(*pItem->GetVideoInfoTag(), *(*entry), NULL); + + } else if( ObjectClass.StartsWith("object.container.album.photoalbum")) { + //CPictureInfoTag* tag = pItem->GetPictureInfoTag(); + + } else if( ObjectClass.StartsWith("object.container.album") ) { + pItem->SetLabelPreformated(false); + CUPnP::PopulateTagFromObject(*pItem->GetMusicInfoTag(), *(*entry), NULL); + } + } else { // set a general content type - CStdString type = (const char*)(*entry)->m_ObjectClass.type.Left(21); - if (type.Equals("object.item.videoitem")) + if (ObjectClass.StartsWith("object.item.videoitem")) pItem->SetMimeType("video/octet-stream"); - else if(type.Equals("object.item.audioitem")) + else if(ObjectClass.StartsWith("object.item.audioitem")) pItem->SetMimeType("audio/octet-stream"); - else if(type.Equals("object.item.imageitem")) + else if(ObjectClass.StartsWith("object.item.imageitem")) pItem->SetMimeType("image/octet-stream"); if ((*entry)->m_Resources.GetItemCount()) { @@ -421,13 +439,15 @@ } // look for metadata - if( (*entry)->m_ObjectClass.type.CompareN("object.item.videoitem", 21,true) == 0 ) { + if( ObjectClass.StartsWith("object.item.videoitem") ) { pItem->SetLabelPreformated(false); CUPnP::PopulateTagFromObject(*pItem->GetVideoInfoTag(), *(*entry), &resource); - } else if( (*entry)->m_ObjectClass.type.CompareN("object.item.audioitem", 21,true) == 0 ) { + + } else if( ObjectClass.StartsWith("object.item.audioitem") ) { pItem->SetLabelPreformated(false); CUPnP::PopulateTagFromObject(*pItem->GetMusicInfoTag(), *(*entry), &resource); - } else if( (*entry)->m_ObjectClass.type.CompareN("object.item.imageitem", 21,true) == 0 ) { + + } else if( ObjectClass.StartsWith("object.item.imageitem") ) { //CPictureInfoTag* tag = pItem->GetPictureInfoTag(); } } @@ -447,6 +467,14 @@ else if((*entry)->m_Description.icon_uri.GetLength()) pItem->SetThumbnailImage((const char*) (*entry)->m_Description.icon_uri); + PLT_ProtocolInfo fanart_mask("xbmc.org", "*", "fanart", "*"); + for(unsigned i = 0; i < (*entry)->m_Resources.GetItemCount(); ++i) { + PLT_MediaItemResource& res = (*entry)->m_Resources[i]; + if(res.m_ProtocolInfo.Match(fanart_mask)) { + pItem->SetProperty("fanart_image", (const char*)res.m_Uri); + break; + } + } items.Add(pItem); ++entry; Modified: trunk/xbmc/GUIViewState.cpp =================================================================== --- trunk/xbmc/GUIViewState.cpp 2011-07-07 15:31:46 UTC (rev 30916) +++ trunk/xbmc/GUIViewState.cpp 2011-07-07 20:00:36 UTC (rev 30917) @@ -60,7 +60,7 @@ if (url.GetProtocol()=="musicsearch") return new CGUIViewStateMusicSearch(items); - if (items.IsSmartPlayList()) + if (items.IsSmartPlayList() || url.GetProtocol() == "upnp") { if (items.GetContent() == "songs") return new CGUIViewStateMusicSmartPlaylist(items); @@ -359,6 +359,8 @@ { if (GetSortMethod() == SORT_METHOD_NONE) m_sortOrder = SORT_ORDER_NONE; + else if (sortOrder == SORT_ORDER_NONE) + m_sortOrder = SORT_ORDER_ASC; else m_sortOrder = sortOrder; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |