Skip to content

Commit

Permalink
Merge pull request #4345 from cg110/OptimizeIsSamePath
Browse files Browse the repository at this point in the history
Speedup FileItem::IsSamePath
  • Loading branch information
jmarshallnz authored and Jonathan Marshall committed Mar 11, 2014
1 parent a91fae6 commit dac84ca
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions xbmc/FileItem.cpp
Expand Up @@ -1185,14 +1185,12 @@ bool CFileItem::IsHD() const

bool CFileItem::IsMusicDb() const
{
CURL url(m_strPath);
return url.GetProtocol().Equals("musicdb");
return URIUtils::IsMusicDb(m_strPath);
}

bool CFileItem::IsVideoDb() const
{
CURL url(m_strPath);
return url.GetProtocol().Equals("videodb");
return URIUtils::IsVideoDb(m_strPath);
}

bool CFileItem::IsVirtualDirectoryRoot() const
Expand Down Expand Up @@ -1432,6 +1430,12 @@ bool CFileItem::IsSamePath(const CFileItem *item) const
return (item->GetProperty("item_start") == GetProperty("item_start"));
return true;
}
if (HasVideoInfoTag() && item->HasVideoInfoTag())
{
if (m_videoInfoTag->m_iDbId != -1 && item->m_videoInfoTag->m_iDbId != -1)
return ((m_videoInfoTag->m_iDbId == item->m_videoInfoTag->m_iDbId) &&
(m_videoInfoTag->m_type == item->m_videoInfoTag->m_type));
}
if (IsMusicDb() && HasMusicInfoTag())
{
CFileItem dbItem(m_musicInfoTag->GetURL(), false);
Expand Down

0 comments on commit dac84ca

Please sign in to comment.