-
-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add companion plugin for StashAppAndroidTV (#381)
- Loading branch information
1 parent
5b506a8
commit c8942da
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
plugins/stashAppAndroidTvCompanion/stashAppAndroidTvCompanion.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
|
18 changes: 18 additions & 0 deletions
18
plugins/stashAppAndroidTvCompanion/stashAppAndroidTvCompanion.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |