Skip to content

Commit

Permalink
jsonrpc: fix "type" being set to "movie" for non-movie items
Browse files Browse the repository at this point in the history
  • Loading branch information
Montellese committed Sep 26, 2012
1 parent 9afbbb6 commit 69f4aca
Showing 1 changed file with 4 additions and 22 deletions.
26 changes: 4 additions & 22 deletions xbmc/interfaces/json-rpc/FileItemHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,29 +251,11 @@ void CFileItemHandler::HandleFileItem(const char *ID, bool allowFile, const char
else
object["type"] = "song";
}
else if (item->HasVideoInfoTag())
else if (item->HasVideoInfoTag() && !item->GetVideoInfoTag()->m_type.empty())
{
switch (item->GetVideoContentType())
{
case VIDEODB_CONTENT_EPISODES:
object["type"] = "episode";
break;

case VIDEODB_CONTENT_MUSICVIDEOS:
object["type"] = "musicvideo";
break;

case VIDEODB_CONTENT_MOVIES:
object["type"] = "movie";
break;

case VIDEODB_CONTENT_TVSHOWS:
object["type"] = "tvshow";
break;

default:
break;
}
std::string type = item->GetVideoInfoTag()->m_type;
if (type == "movie" || type == "tvshow" || type == "episode" || type == "musicvideo")
object["type"] = type;
}
else if (item->HasPictureInfoTag())
object["type"] = "picture";
Expand Down

0 comments on commit 69f4aca

Please sign in to comment.