aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlwin Esch <alwin.esch@web.de>2020-02-27 20:51:24 +0100
committerGitHub <noreply@github.com>2020-02-27 20:51:24 +0100
commit87c94a56eb8d9f7bda947ad44c17ef11ee16f5bf (patch)
tree725da0b112a09f84a966ba37da7ddd8d2e61c9d3
parent9d2ee96be3680d6178fa4849fb6f5986a9824ff1 (diff)
parent958c062fae6c94926b59d769b110be1fd8ac836b (diff)
Merge pull request #17407 from AlwinEsch/Leia-fix-vfs-addon-view
[backport][vfs][addons] fix media view from addon given content
-rw-r--r--xbmc/filesystem/FileDirectoryFactory.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/xbmc/filesystem/FileDirectoryFactory.cpp b/xbmc/filesystem/FileDirectoryFactory.cpp
index a3144f60d9..b7fa0ffae7 100644
--- a/xbmc/filesystem/FileDirectoryFactory.cpp
+++ b/xbmc/filesystem/FileDirectoryFactory.cpp
@@ -86,13 +86,21 @@ 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 also wrap.
+ // Needed to fix for e.g. RAR files with only one file inside
+ pItem->m_bIsFolder = URIUtils::HasSlashAtEnd(pItem->GetPath());
+ if (pItem->m_bIsFolder)
+ return wrap;
}
else
+ {
pItem->m_bIsFolder = true;
+ }
delete wrap;
return nullptr;