Skip to content

Commit

Permalink
[runtime] if the runtime is empty, use the stream details duration fo…
Browse files Browse the repository at this point in the history
…r it when found. closes xbmc#13482
  • Loading branch information
Jonathan Marshall committed Nov 26, 2012
1 parent 73a9b08 commit 8087191
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions xbmc/video/VideoDatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2365,6 +2365,21 @@ void CVideoDatabase::SetStreamDetailsForFileId(const CStreamDetails& details, in
details.GetSubtitleLanguage(i).c_str()));
}

// update the runtime information, if empty
if (details.GetVideoDuration())
{
vector< pair<string, int> > tables;
tables.push_back(make_pair("movie", VIDEODB_ID_RUNTIME));
tables.push_back(make_pair("episode", VIDEODB_ID_EPISODE_RUNTIME));
tables.push_back(make_pair("musicvideo", VIDEODB_ID_MUSICVIDEO_RUNTIME));
for (vector< pair<string, int> >::iterator i = tables.begin(); i != tables.end(); ++i)
{
CStdString sql = PrepareSQL("update %s set c%02d=%d where idFile=%d and c%02d=''",
i->first.c_str(), i->second, details.GetVideoDuration(), idFile, i->second);
m_pDS->exec(sql);
}
}

CommitTransaction();
}
catch (...)
Expand Down

0 comments on commit 8087191

Please sign in to comment.