Skip to content

Commit

Permalink
[vfs][addons] fix media view from addon given content
Browse files Browse the repository at this point in the history
Before was by opening of e.g. RAR file(s) the view on Videos, Music...
not shown.

Change only related to VFS addons in CFileDirectoryFactory, all
other formats not affected.

Inside compressed files seems a m_bIsFolder of CFile as true not to
handle the source from addon.

This change is tested with old and reworked vfs.rar addon, vfs.sftp
and vfs.libarchive. There it has worked correct, further (as note)
becomes in reworked vfs.rar the directory support of rar files brought
back.
  • Loading branch information
AlwinEsch committed Jan 3, 2020
1 parent 31d84c7 commit c14d5ae
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions xbmc/filesystem/FileDirectoryFactory.cpp
Expand Up @@ -86,13 +86,22 @@ IFileDirectory* CFileDirectoryFactory::Create(const CURL& url, CFileItem* pItem,
*pItem = *wrap->m_items[0];
}
else
{ // compressed or more than one file -> create a dir
pItem->SetPath(wrap->m_items.GetPath());
return wrap;
{
// compressed or more than one file -> create a dir
*pItem = wrap->m_items;
}

// Check for folder, if yes return alsp wrap.
// Needed to fix for e.g. RAR files with only one file inside
// if yes ignore the warp and return below a nullptr.
pItem->m_bIsFolder = URIUtils::HasSlashAtEnd(pItem->GetPath());
if (pItem->m_bIsFolder)
return wrap;
}
else
{
pItem->m_bIsFolder = true;
}

delete wrap;
return nullptr;
Expand Down

0 comments on commit c14d5ae

Please sign in to comment.