From ec48a71b9e375a395c97688a7c2b9d82f355b795 Mon Sep 17 00:00:00 2001
From: TSRBerry <20988865+TSRBerry@users.noreply.github.com>
Date: Sun, 28 May 2023 10:36:54 +0200
Subject: [PATCH] Add exception for homebrew applications (#54)

---
 robocop_ng/cogs/logfilereader.py           | 3 ++-
 robocop_ng/helpers/ryujinx_log_analyser.py | 4 ++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/robocop_ng/cogs/logfilereader.py b/robocop_ng/cogs/logfilereader.py
index eddb925..6c2dbe6 100644
--- a/robocop_ng/cogs/logfilereader.py
+++ b/robocop_ng/cogs/logfilereader.py
@@ -64,7 +64,8 @@ class LogFileReader(Cog):
     @staticmethod
     def is_log_valid(log_file: str) -> bool:
         app_info = LogAnalyser.get_app_info(log_file)
-        if app_info is None:
+        is_homebrew = LogAnalyser.is_homebrew(log_file)
+        if app_info is None or is_homebrew:
             return True
         game_name, app_id, another_app_id, build_ids, main_ro_section = app_info
         if (
diff --git a/robocop_ng/helpers/ryujinx_log_analyser.py b/robocop_ng/helpers/ryujinx_log_analyser.py
index 3394fa5..de47c4e 100644
--- a/robocop_ng/helpers/ryujinx_log_analyser.py
+++ b/robocop_ng/helpers/ryujinx_log_analyser.py
@@ -35,6 +35,10 @@ class LogAnalyser:
     _settings: dict[str, Optional[str]]
     _notes: list[str]
 
+    @staticmethod
+    def is_homebrew(log_file: str) -> bool:
+        return re.search("LoadApplication: Loading as Homebrew", log_file) is not None
+
     @staticmethod
     def get_main_ro_section(log_file: str) -> Optional[dict[str, str]]:
         ro_section_match = re.search(