2013-07-15, 12:16
Just noticed a change in last gotham during some tests.
It seems that now neither the title nor the label are filled when playing a random file via JSON.
Before label was filled with the filename (without path) and seems a good thing since the label is a mandatory item.
Edit :
After some debugging I'm lost on what seems multiple strange things, so don't know if they are errors or if normal and so where I should patch.
In CPlayerOperations::GetItem
When playing a video file the second else block will also be called is this intended ?
In CVideoLibrary::FillFileItem
Since the file is started from JSON for first time it's not yet in any database so
Will return false and the label is never set.
Then on the last part I'm not sure to understand, you test if the label is empty then set it, then you set if the label is present and set it again ?
Not sure what part should be patched and with what So waiting for more details
It seems that now neither the title nor the label are filled when playing a random file via JSON.
Before label was filled with the filename (without path) and seems a good thing since the label is a mandatory item.
Edit :
After some debugging I'm lost on what seems multiple strange things, so don't know if they are errors or if normal and so where I should patch.
In CPlayerOperations::GetItem
Code:
else if (player == Video)
{
if (!CVideoLibrary::FillFileItem(g_application.CurrentFile(), fileItem, parameterObject))
{
const CVideoInfoTag *currentVideoTag = g_infoManager.GetCurrentMovieTag();
if (currentVideoTag != NULL)
fileItem = CFileItemPtr(new CFileItem(*currentVideoTag));
fileItem->SetPath(g_application.CurrentFileItem().GetPath());
}
}
else
{
if (!CAudioLibrary::FillFileItem(g_application.CurrentFile(), fileItem, parameterObject))
{
const MUSIC_INFO::CMusicInfoTag *currentMusicTag = g_infoManager.GetCurrentSongTag();
if (currentMusicTag != NULL)
fileItem = CFileItemPtr(new CFileItem(*currentMusicTag));
fileItem->SetPath(g_application.CurrentFileItem().GetPath());
}
}
When playing a video file the second else block will also be called is this intended ?
In CVideoLibrary::FillFileItem
Code:
CVideoDatabase videodatabase;
if (strFilename.empty() || !videodatabase.Open())
return false;
CVideoInfoTag details;
if (!videodatabase.LoadVideoInfo(strFilename, details))
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;
Since the file is started from JSON for first time it's not yet in any database so
Code:
if (!videodatabase.LoadVideoInfo(strFilename, details))
return false;
Will return false and the label is never set.
Then on the last part I'm not sure to understand, you test if the label is empty then set it, then you set if the label is present and set it again ?
Not sure what part should be patched and with what So waiting for more details