Permalink
Browse files

Merge pull request #5026 from mkortstiege/fileid

[videodatabase] use fileid from videoinfotag when available
  • Loading branch information...
2 parents ce76240 + 4dd964a commit f06f0cf0efd6a3fb5cf98f453f0a017d468f1537 @mkortstiege mkortstiege committed Jul 14, 2014
Showing with 12 additions and 2 deletions.
  1. +12 −2 xbmc/video/VideoDatabase.cpp
@@ -864,7 +864,12 @@ int CVideoDatabase::AddFile(const CStdString& strFileNameAndPath)
int CVideoDatabase::AddFile(const CFileItem& item)
{
if (item.IsVideoDb() && item.HasVideoInfoTag())
- return AddFile(item.GetVideoInfoTag()->m_strFileNameAndPath);
+ {
+ if (item.GetVideoInfoTag()->m_iFileId != -1)
+ return item.GetVideoInfoTag()->m_iFileId;
+ else
+ return AddFile(item.GetVideoInfoTag()->m_strFileNameAndPath);
+ }
return AddFile(item.GetPath());
}
@@ -1072,7 +1077,12 @@ int CVideoDatabase::GetFileId(const CStdString& strFilenameAndPath)
int CVideoDatabase::GetFileId(const CFileItem &item)
{
if (item.IsVideoDb() && item.HasVideoInfoTag())
- return GetFileId(item.GetVideoInfoTag()->m_strFileNameAndPath);
+ {
+ if (item.GetVideoInfoTag()->m_iFileId != -1)
+ return item.GetVideoInfoTag()->m_iFileId;
+ else
+ return GetFileId(item.GetVideoInfoTag()->m_strFileNameAndPath);
+ }
return GetFileId(item.GetPath());
}

0 comments on commit f06f0cf

Please sign in to comment.