Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

Commit

Permalink
fixed: CFileItem::IsPlayList should check mimetype if available aswell
Browse files Browse the repository at this point in the history
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@30653 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
  • Loading branch information
elupus committed May 28, 2010
1 parent 390dede commit 2f22b97
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion xbmc/FileItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ bool CFileItem::IsSmartPlayList() const

bool CFileItem::IsPlayList() const
{
return CPlayListFactory::IsPlaylist(m_strPath);
return CPlayListFactory::IsPlaylist(*this);
}

bool CFileItem::IsPythonScript() const
Expand Down
25 changes: 25 additions & 0 deletions xbmc/PlayListFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,31 @@ CPlayList* CPlayListFactory::Create(const CFileItem& item)

}

bool CPlayListFactory::IsPlaylist(const CFileItem& item)
{
CStdString strMimeType = item.GetMimeType();
strMimeType.ToLower();

/* These are abit uncertain
if(strMimeType == "video/x-ms-asf"
|| strMimeType == "video/x-ms-asx"
|| strMimeType == "video/x-ms-wmv"
|| strMimeType == "video/x-ms-wma"
|| strMimeType == "video/x-ms-wfs"
|| strMimeType == "video/x-ms-wvx"
|| strMimeType == "video/x-ms-wax"
|| strMimeType == "video/x-ms-asf")
return true;
*/

if(strMimeType == "audio/x-pn-realaudio"
|| strMimeType == "playlist"
|| strMimeType == "audio/x-mpegurl")
return true;

return IsPlaylist(item.m_strPath);
}

bool CPlayListFactory::IsPlaylist(const CStdString& filename)
{
CStdString extension = CUtil::GetExtension(filename);
Expand Down
1 change: 1 addition & 0 deletions xbmc/PlayListFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ namespace PLAYLIST
static CPlayList* Create(const CStdString& filename);
static CPlayList* Create(const CFileItem& item);
static bool IsPlaylist(const CStdString& filename);
static bool IsPlaylist(const CFileItem& item);
};
}

0 comments on commit 2f22b97

Please sign in to comment.