Skip to content

Commit

Permalink
jsonrpc: fix empty label for files indexed but not in the library
Browse files Browse the repository at this point in the history
  • Loading branch information
Montellese committed Sep 16, 2012
1 parent 885075a commit e520d1d
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions xbmc/interfaces/json-rpc/FileOperations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,24 @@ bool CFileOperations::FillFileItem(const CFileItemPtr &originalItem, CFileItem &
else if (media.Equals("music"))
status = CAudioLibrary::FillFileItem(strFilename, item);

if (!status)
if (status && item.GetLabel().empty())
{
CStdString label = originalItem->GetLabel();
if (label.empty())
{
bool isDir = CDirectory::Exists(strFilename);
label = CUtil::GetTitleFromPath(strFilename, isDir);
if (label.empty())
label = URIUtils::GetFileName(strFilename);
}

item.SetLabel(label);
}
else if (!status)
{
bool isDir = CDirectory::Exists(strFilename);
if (originalItem->GetLabel().empty())
{
bool isDir = CDirectory::Exists(strFilename);
CStdString label = CUtil::GetTitleFromPath(strFilename, isDir);
if (label.empty())
return false;
Expand Down

0 comments on commit e520d1d

Please sign in to comment.