aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Kortstiege <mkortstiege@users.noreply.github.com>2014-07-14 13:07:55 +0200
committerMatthias Kortstiege <mkortstiege@users.noreply.github.com>2014-07-14 13:07:55 +0200
commitf06f0cf0efd6a3fb5cf98f453f0a017d468f1537 (patch)
treec83693860c44543a6af92b46b68f2d615d17776d
parentce762408da28ea42851250c40b5691f105a3a4b9 (diff)
parent4dd964a91f9d82851b6defcf20682edefff883f8 (diff)
Merge pull request #5026 from mkortstiege/fileid
[videodatabase] use fileid from videoinfotag when available
-rw-r--r--xbmc/video/VideoDatabase.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp
index d198f9a8b7..55036e0ff6 100644
--- a/xbmc/video/VideoDatabase.cpp
+++ b/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());
}