alarm/kodi-rpi-git to 21.x.65031.931cf309a6-1

This commit is contained in:
graysky 2024-01-08 08:17:39 -05:00
parent 2f7f92a478
commit 11172b1a47
2 changed files with 1 additions and 136 deletions

View file

@ -1,135 +0,0 @@
Subject: [PATCH] Revert "Merge pull request #24394 from CrystalP/add-itemdir"
This reverts commit c0dccda294fcf15629c680083f1c74ac661c1fac, reversing
changes made to b7b8322e4ba45836345ca5e3cce5b2587cd63f60.
---
xbmc/video/dialogs/GUIDialogVideoManager.cpp | 15 -------------
xbmc/video/dialogs/GUIDialogVideoManager.h | 1 -
.../dialogs/GUIDialogVideoManagerExtras.cpp | 22 +++++++++++++++++--
.../dialogs/GUIDialogVideoManagerExtras.h | 5 +++++
.../dialogs/GUIDialogVideoManagerVersions.cpp | 1 -
5 files changed, 25 insertions(+), 19 deletions(-)
diff --git a/xbmc/video/dialogs/GUIDialogVideoManager.cpp b/xbmc/video/dialogs/GUIDialogVideoManager.cpp
index 6f80a2ad0c..46bbddab54 100644
--- a/xbmc/video/dialogs/GUIDialogVideoManager.cpp
+++ b/xbmc/video/dialogs/GUIDialogVideoManager.cpp
@@ -14,7 +14,6 @@
#include "dialogs/GUIDialogOK.h"
#include "dialogs/GUIDialogSelect.h"
#include "dialogs/GUIDialogYesNo.h"
-#include "filesystem/Directory.h"
#include "guilib/GUIComponent.h"
#include "guilib/GUIKeyboardFactory.h"
#include "guilib/GUIWindowManager.h"
@@ -22,7 +21,6 @@
#include "input/Key.h"
#include "playlists/PlayListTypes.h"
#include "utils/StringUtils.h"
-#include "utils/URIUtils.h"
#include "utils/log.h"
#include "video/VideoManagerTypes.h"
#include "video/VideoThumbLoader.h"
@@ -422,16 +420,3 @@ int CGUIDialogVideoManager::ChooseVideoAsset(const std::shared_ptr<CFileItem>& i
return assetId;
}
-
-void CGUIDialogVideoManager::AppendItemFolderToFileBrowserSources(
- std::vector<CMediaSource>& sources)
-{
- const std::string itemDir{URIUtils::GetParentPath(m_videoAsset->GetDynPath())};
- if (!itemDir.empty() && XFILE::CDirectory::Exists(itemDir))
- {
- CMediaSource itemSource{};
- itemSource.strName = g_localizeStrings.Get(36041); // * Item folder
- itemSource.strPath = itemDir;
- sources.emplace_back(itemSource);
- }
-}
diff --git a/xbmc/video/dialogs/GUIDialogVideoManager.h b/xbmc/video/dialogs/GUIDialogVideoManager.h
index 052de1f38b..e2c2ffebd2 100644
--- a/xbmc/video/dialogs/GUIDialogVideoManager.h
+++ b/xbmc/video/dialogs/GUIDialogVideoManager.h
@@ -51,7 +51,6 @@ protected:
void UpdateControls();
static int ChooseVideoAsset(const std::shared_ptr<CFileItem>& item, VideoAssetType assetType);
- void AppendItemFolderToFileBrowserSources(std::vector<CMediaSource>& sources);
CVideoDatabase m_database;
std::shared_ptr<CFileItem> m_videoAsset;
diff --git a/xbmc/video/dialogs/GUIDialogVideoManagerExtras.cpp b/xbmc/video/dialogs/GUIDialogVideoManagerExtras.cpp
index a9c0090bd5..958e33837f 100644
--- a/xbmc/video/dialogs/GUIDialogVideoManagerExtras.cpp
+++ b/xbmc/video/dialogs/GUIDialogVideoManagerExtras.cpp
@@ -16,6 +16,7 @@
#include "dialogs/GUIDialogFileBrowser.h"
#include "dialogs/GUIDialogOK.h"
#include "dialogs/GUIDialogYesNo.h"
+#include "filesystem/Directory.h"
#include "guilib/GUIComponent.h"
#include "guilib/GUIWindowManager.h"
#include "guilib/LocalizeStrings.h"
@@ -93,9 +94,9 @@ void CGUIDialogVideoManagerExtras::AddVideoExtra()
CServiceBroker::GetMediaManager().GetLocalDrives(sources);
CServiceBroker::GetMediaManager().GetNetworkLocations(sources);
- AppendItemFolderToFileBrowserSources(sources);
- std::string path;
+ std::string path{GetLikelyExtrasPath()};
+
if (CGUIDialogFileBrowser::ShowAndGetFile(
sources, CServiceBroker::GetFileExtensionProvider().GetVideoExtensions(),
g_localizeStrings.Get(40015), path))
@@ -208,3 +209,20 @@ std::string CGUIDialogVideoManagerExtras::GenerateVideoExtra(const std::string&
// trim the string
return StringUtils::Trim(extrasVersion);
}
+
+std::string CGUIDialogVideoManagerExtras::GetLikelyExtrasPath()
+{
+ std::string path{URIUtils::GetDirectory(m_videoAsset->GetDynPath())};
+ CFileItemList items;
+
+ if (!XFILE::CDirectory::GetDirectory(path, items, "", XFILE::DIR_FLAG_DEFAULTS))
+ return path;
+
+ for (const auto& item : items)
+ {
+ if (item->m_bIsFolder && item->IsVideoExtras())
+ return item->GetPath();
+ }
+
+ return path;
+}
diff --git a/xbmc/video/dialogs/GUIDialogVideoManagerExtras.h b/xbmc/video/dialogs/GUIDialogVideoManagerExtras.h
index cbb6d48474..9aa1d9a864 100644
--- a/xbmc/video/dialogs/GUIDialogVideoManagerExtras.h
+++ b/xbmc/video/dialogs/GUIDialogVideoManagerExtras.h
@@ -40,4 +40,9 @@ protected:
private:
void AddVideoExtra();
static std::string GenerateVideoExtra(const std::string& extrasPath);
+ /*!
+ * \brief Return a likely location for extras related to the movie
+ * \return path of the location
+ */
+ std::string GetLikelyExtrasPath();
};
diff --git a/xbmc/video/dialogs/GUIDialogVideoManagerVersions.cpp b/xbmc/video/dialogs/GUIDialogVideoManagerVersions.cpp
index 6fa548ea52..15a06f2514 100644
--- a/xbmc/video/dialogs/GUIDialogVideoManagerVersions.cpp
+++ b/xbmc/video/dialogs/GUIDialogVideoManagerVersions.cpp
@@ -536,7 +536,6 @@ bool CGUIDialogVideoManagerVersions::AddVideoVersionFilePicker()
CServiceBroker::GetMediaManager().GetLocalDrives(sources);
CServiceBroker::GetMediaManager().GetNetworkLocations(sources);
- AppendItemFolderToFileBrowserSources(sources);
std::string path;
if (CGUIDialogFileBrowser::ShowAndGetFile(
--
2.43.0

View file

@ -17,7 +17,7 @@ pkgname=(
# recommend manually setting -DUSE_LTO=OFF to -DUSE_LTO=$(nproc) in build()
_clangbuild=
pkgver=21.x.65018.8107ed0fc4
pkgver=21.x.65031.931cf309a6
pkgrel=1
arch=('aarch64' 'armv7h')
url="https://github.com/graysky2/xbmc/tree/gs-gbm_omega"