Skip to content

Commit 1fb1317

Browse files
Update AI Overhaul plugin for 0.9.1 (#647)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent e7aea56 commit 1fb1317

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

plugins/AIOverhaul/AIOverhaul.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: AIOverhaul
22
description: AI Overhaul for Stash with a full plugin engine included to install and manage asynchronous stash plugins for AI or other purposes.
3-
version: 0.9.0
3+
version: 0.9.1
44
url: https://discourse.stashapp.cc/t/aioverhaul/4847
55
ui:
66
javascript:

plugins/AIOverhaul/BackendBase.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ defaultBackendBase;
77
const PLUGIN_NAME = 'AIOverhaul';
88
// Local default to keep the UI functional before plugin config loads.
99
const DEFAULT_BACKEND_BASE = 'http://localhost:4153';
10+
const STORAGE_KEY = 'ai_backend_base_url';
1011
const CONFIG_QUERY = `query AIOverhaulPluginConfig($ids: [ID!]) {
1112
configuration {
1213
plugins(include: $ids)
@@ -138,6 +139,15 @@ function applyPluginConfig(base, captureEvents, sharedKey) {
138139
const value = normalized || '';
139140
try {
140141
window.AI_BACKEND_URL = value;
142+
try {
143+
if (value) {
144+
sessionStorage.setItem(STORAGE_KEY, value);
145+
}
146+
else {
147+
sessionStorage.removeItem(STORAGE_KEY);
148+
}
149+
}
150+
catch { }
141151
window.dispatchEvent(new CustomEvent('AIBackendBaseUpdated', { detail: value }));
142152
}
143153
catch { }
@@ -202,6 +212,16 @@ function defaultBackendBase() {
202212
loadPluginConfig();
203213
}
204214
catch { }
215+
try {
216+
const stored = sessionStorage.getItem(STORAGE_KEY);
217+
if (stored && typeof stored === 'string') {
218+
const normalized = normalizeBase(stored);
219+
if (normalized !== null && normalized !== undefined) {
220+
return normalized;
221+
}
222+
}
223+
}
224+
catch { }
205225
if (typeof window.AI_BACKEND_URL === 'string') {
206226
const explicit = normalizeBase(window.AI_BACKEND_URL);
207227
if (explicit !== null && explicit !== undefined) {

plugins/AIOverhaul/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
https://discourse.stashapp.cc/t/aioverhaul/4847
44

55
# For details around this plugin and using and configuring it, see the official documentation here:
6-
https://github.com/skier233/Stash-AIServer/wiki/AI-Overhaul-Installation-Instructions
6+
https://github.com/skier233/Stash-AIServer/wiki/AI-Overhaul-Installation-Instructions

0 commit comments

Comments
 (0)