From c8942da247b080f373134fc65c447b5f4f0bfc33 Mon Sep 17 00:00:00 2001 From: damontecres <154766448+damontecres@users.noreply.github.com> Date: Thu, 1 Aug 2024 05:48:12 -0400 Subject: [PATCH] Add companion plugin for StashAppAndroidTV (#381) --- .../stashAppAndroidTvCompanion.py | 31 +++++++++++++++++++ .../stashAppAndroidTvCompanion.yml | 18 +++++++++++ 2 files changed, 49 insertions(+) create mode 100644 plugins/stashAppAndroidTvCompanion/stashAppAndroidTvCompanion.py create mode 100644 plugins/stashAppAndroidTvCompanion/stashAppAndroidTvCompanion.yml diff --git a/plugins/stashAppAndroidTvCompanion/stashAppAndroidTvCompanion.py b/plugins/stashAppAndroidTvCompanion/stashAppAndroidTvCompanion.py new file mode 100644 index 00000000..d28440dd --- /dev/null +++ b/plugins/stashAppAndroidTvCompanion/stashAppAndroidTvCompanion.py @@ -0,0 +1,31 @@ +import sys +import json +import stashapi.log as log + + +def do_logcat(args): + if "logcat" not in args: + log.error("logcat not found in args") + return + logs = args["logcat"] + log.info(logs) + +def do_crash_report(args): + if "crash_report" not in args: + log.error("report not found in args") + return + report = args["crash_report"] + log.error(report) + +json_input = json.loads(sys.stdin.read()) + +args = json_input["args"] +if "mode" in args: + mode = args["mode"] + if mode == "logcat": + do_logcat(args) + elif mode == "crash_report": + do_crash_report(args) + else: + log.warning("Unknown mode: " + mode) + diff --git a/plugins/stashAppAndroidTvCompanion/stashAppAndroidTvCompanion.yml b/plugins/stashAppAndroidTvCompanion/stashAppAndroidTvCompanion.yml new file mode 100644 index 00000000..bdb5f9d5 --- /dev/null +++ b/plugins/stashAppAndroidTvCompanion/stashAppAndroidTvCompanion.yml @@ -0,0 +1,18 @@ +name: StashAppAndroidTV Companion +description: A companion plugin for StashAppAndroidTV +version: 0.0.1 +url: https://github.com/damontecres/StashAppAndroidTV-Companion + +exec: + - python + - "{pluginDir}/stashAppAndroidTvCompanion.py" +interface: raw +tasks: + - name: logcat + description: Send android app's logcat logs + defaultArgs: + mode: logcat + - name: crash_report + description: Send android app's crash report + defaultArgs: + mode: crash_report