Skip to content

Commit

Permalink
Merge pull request xbmc#24025 from ksooo/strm-file-fixes
Browse files Browse the repository at this point in the history
[video][music][interfaces][fileitem] STRM file fixes
  • Loading branch information
ksooo authored Oct 29, 2023
2 parents ac9eade + 33f689f commit c5d20b2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 20 deletions.
4 changes: 4 additions & 0 deletions xbmc/FileItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,10 @@ bool CFileItem::IsFileFolder(EFileFolderType types) const
if(IsInternetStream())
always_type = EFILEFOLDER_TYPE_ONCLICK;

// strm files are not browsable
if (IsType(".strm") && (types & EFILEFOLDER_TYPE_ONBROWSE))
return false;

if(types & always_type)
{
if(IsSmartPlayList()
Expand Down
2 changes: 1 addition & 1 deletion xbmc/music/MusicUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ bool IsItemPlayable(const CFileItem& item)
if (StringUtils::StartsWith(item.GetPath(), StringUtils::Format("{}/music/", path)))
return true;

if (!item.m_bIsFolder)
if (!item.m_bIsFolder && !item.HasMusicInfoTag())
{
// Unknown location. Type cannot be determined for non-folder items.
return false;
Expand Down
2 changes: 1 addition & 1 deletion xbmc/playlists/PlayList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ bool CPlayList::Expand(int position)
for (int i = 0;i<playlist->size();i++)
{
(*playlist)[i]->SetDynPath((*playlist)[i]->GetPath());
(*playlist)[i]->SetPath(item->GetPath());
(*playlist)[i]->SetPath(item->GetDynPath());
(*playlist)[i]->SetStartOffset(item->GetStartOffset());
}

Expand Down
21 changes: 3 additions & 18 deletions xbmc/video/VideoUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,23 +285,8 @@ void CAsyncGetItemsForPlaylist::GetItemsForPlaylist(const std::shared_ptr<CFileI
}
else if (item->IsPlayList())
{
const std::unique_ptr<PLAYLIST::CPlayList> playList(PLAYLIST::CPlayListFactory::Create(*item));
if (!playList)
{
CLog::LogF(LOGERROR, "Failed to create playlist {}", item->GetPath());
return;
}

if (!playList->Load(item->GetPath()))
{
CLog::LogF(LOGERROR, "Failed to load playlist {}", item->GetPath());
return;
}

for (int i = 0; i < playList->size(); ++i)
{
GetItemsForPlaylist((*playList)[i]);
}
// just queue the playlist, it will be expanded on play
m_queuedItems.Add(item);
}
else if (item->IsInternetStream())
{
Expand Down Expand Up @@ -583,7 +568,7 @@ bool IsItemPlayable(const CFileItem& item)
StringUtils::StartsWith(item.GetPath(), StringUtils::Format("{}/mixed/", path)))
return true;

if (!item.m_bIsFolder)
if (!item.m_bIsFolder && !item.HasVideoInfoTag())
{
// Unknown location. Type cannot be determined for non-folder items.
return false;
Expand Down

0 comments on commit c5d20b2

Please sign in to comment.