From 3221b3a56711f54be8183e675a245f3137957655 Mon Sep 17 00:00:00 2001 From: Rikko Date: Sun, 22 Jan 2023 15:34:19 +0530 Subject: [PATCH 1/2] Allow invisible models --- plugins/utilities.json | 16 +++++++++++++++- plugins/utilities/allow_invisible_models.py | 15 +++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 plugins/utilities/allow_invisible_models.py diff --git a/plugins/utilities.json b/plugins/utilities.json index ad3ad27..3dde59e 100644 --- a/plugins/utilities.json +++ b/plugins/utilities.json @@ -651,6 +651,20 @@ "md5sum": "cc1738b0326c9679453bdf1489ded483" } } + }, + "allow_invisible_models": { + "description": "Changing model to None will make it invisible instead of raising an exception.", + "external_url": "", + "authors": [ + { + "name": "Rikko", + "email": "rikkolovescats@proton.me", + "discord": "Rikko#7383" + } + ], + "versions": { + "1.0.0": null + } } } -} \ No newline at end of file +} diff --git a/plugins/utilities/allow_invisible_models.py b/plugins/utilities/allow_invisible_models.py new file mode 100644 index 0000000..b2d1403 --- /dev/null +++ b/plugins/utilities/allow_invisible_models.py @@ -0,0 +1,15 @@ +# ba_meta require api 7 +import ba + +original_getmodel = ba.getmodel + + +def get_model_gracefully(model): + if model is not None: + return original_getmodel(model) + + +# ba_meta export plugin +class Main(ba.Plugin): + def on_app_running(self): + ba.getmodel = get_model_gracefully From 7e8e61d07730f1ac93d4cd8568846b0fa96cc6cf Mon Sep 17 00:00:00 2001 From: rikkolovescats Date: Sun, 22 Jan 2023 10:05:08 +0000 Subject: [PATCH 2/2] [ci] apply-version-metadata --- plugins/utilities.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/utilities.json b/plugins/utilities.json index 3dde59e..c1a86a6 100644 --- a/plugins/utilities.json +++ b/plugins/utilities.json @@ -663,8 +663,13 @@ } ], "versions": { - "1.0.0": null + "1.0.0": { + "api_version": 7, + "commit_sha": "3221b3a", + "released_on": "22-01-2023", + "md5sum": "24913c665d05c3056c8ba390fe88155e" + } } } } -} +} \ No newline at end of file