aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett Brown <themagnificentmrb@gmail.com>2020-02-08 18:26:52 -0800
committerGitHub <noreply@github.com>2020-02-08 18:26:52 -0800
commit38cead250c7a514dc068d5375844118e2c088cd4 (patch)
tree821a99268d6d523ffe2e0ed232126984826f6b36
parent2c4bcdbfa5e8957c74d25396fc726952fabecf82 (diff)
parent87351fd60390e93cf5a4020aeb1066cc6497ec70 (diff)
Merge pull request #17303 from garbear/backport-disk-zip-games
[Backport] Games: Fix launching disk images and zip files
-rw-r--r--system/playercorefactory.xml2
-rw-r--r--xbmc/FileItem.h8
-rw-r--r--xbmc/cores/playercorefactory/PlayerSelectionRule.cpp3
-rw-r--r--xbmc/cores/playercorefactory/PlayerSelectionRule.h1
-rw-r--r--xbmc/games/windows/GUIWindowGames.cpp7
5 files changed, 16 insertions, 5 deletions
diff --git a/system/playercorefactory.xml b/system/playercorefactory.xml
index be6b7219ab..bb57a08e6c 100644
--- a/system/playercorefactory.xml
+++ b/system/playercorefactory.xml
@@ -26,7 +26,7 @@
<!-- DVDs -->
<rule name="dvd" dvd="true" player="VideoPlayer" />
- <rule name="dvdimage" dvdimage="true" player="VideoPlayer" />
+ <rule name="dvdimage" dvdimage="true" game="false" player="VideoPlayer" />
<!-- Only VideoPlayer can handle these normally -->
<rule name="sdp/asf" filetypes="sdp|asf" player="VideoPlayer" />
diff --git a/xbmc/FileItem.h b/xbmc/FileItem.h
index 75f57db659..63ba0bf698 100644
--- a/xbmc/FileItem.h
+++ b/xbmc/FileItem.h
@@ -749,12 +749,12 @@ public:
void ClearSortState();
- VECFILEITEMS::const_iterator begin() { return m_items.cbegin(); }
- VECFILEITEMS::const_iterator end() { return m_items.cend(); }
+ VECFILEITEMS::iterator begin() { return m_items.begin(); }
+ VECFILEITEMS::iterator end() { return m_items.end(); }
VECFILEITEMS::const_iterator begin() const { return m_items.begin(); }
VECFILEITEMS::const_iterator end() const { return m_items.end(); }
- VECFILEITEMS::const_iterator cbegin() const { return m_items.begin(); }
- VECFILEITEMS::const_iterator cend() const { return m_items.end(); }
+ VECFILEITEMS::const_iterator cbegin() const { return m_items.cbegin(); }
+ VECFILEITEMS::const_iterator cend() const { return m_items.cend(); }
private:
void Sort(FILEITEMLISTCOMPARISONFUNC func);
void FillSortFields(FILEITEMFILLFUNC func);
diff --git a/xbmc/cores/playercorefactory/PlayerSelectionRule.cpp b/xbmc/cores/playercorefactory/PlayerSelectionRule.cpp
index 59e641638b..439a69a8cf 100644
--- a/xbmc/cores/playercorefactory/PlayerSelectionRule.cpp
+++ b/xbmc/cores/playercorefactory/PlayerSelectionRule.cpp
@@ -45,6 +45,7 @@ void CPlayerSelectionRule::Initialize(TiXmlElement* pRule)
m_tRemote = GetTristate(pRule->Attribute("remote"));
m_tAudio = GetTristate(pRule->Attribute("audio"));
m_tVideo = GetTristate(pRule->Attribute("video"));
+ m_tGame = GetTristate(pRule->Attribute("game"));
m_tBD = GetTristate(pRule->Attribute("bd"));
m_tDVD = GetTristate(pRule->Attribute("dvd"));
@@ -110,6 +111,8 @@ void CPlayerSelectionRule::GetPlayers(const CFileItem& item, std::vector<std::st
return;
if (m_tVideo >= 0 && (m_tVideo > 0) != item.IsVideo())
return;
+ if (m_tGame >= 0 && (m_tGame > 0) != item.IsGame())
+ return;
if (m_tInternetStream >= 0 && (m_tInternetStream > 0) != item.IsInternetStream())
return;
if (m_tRemote >= 0 && (m_tRemote > 0) != item.IsRemote())
diff --git a/xbmc/cores/playercorefactory/PlayerSelectionRule.h b/xbmc/cores/playercorefactory/PlayerSelectionRule.h
index bdc65927ac..991631e1df 100644
--- a/xbmc/cores/playercorefactory/PlayerSelectionRule.h
+++ b/xbmc/cores/playercorefactory/PlayerSelectionRule.h
@@ -35,6 +35,7 @@ private:
int m_tAudio;
int m_tVideo;
+ int m_tGame;
int m_tInternetStream;
int m_tRemote;
diff --git a/xbmc/games/windows/GUIWindowGames.cpp b/xbmc/games/windows/GUIWindowGames.cpp
index 355442386f..4721a940ac 100644
--- a/xbmc/games/windows/GUIWindowGames.cpp
+++ b/xbmc/games/windows/GUIWindowGames.cpp
@@ -264,6 +264,13 @@ bool CGUIWindowGames::GetDirectory(const std::string &strDirectory, CFileItemLis
if (!content.empty())
items.SetContent(content);
+ // Ensure a game info tag is created so that files are recognized as games
+ for (const CFileItemPtr& item : items)
+ {
+ if (!item->m_bIsFolder)
+ item->GetGameInfoTag();
+ }
+
return true;
}