Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/AIOverhaul/AIOverhaul.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: AIOverhaul
description: AI Overhaul for Stash with a full plugin engine included to install and manage asynchronous stash plugins for AI or other purposes.
version: 0.9.0
version: 0.9.1
url: https://discourse.stashapp.cc/t/aioverhaul/4847
ui:
javascript:
Expand Down
20 changes: 20 additions & 0 deletions plugins/AIOverhaul/BackendBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ defaultBackendBase;
const PLUGIN_NAME = 'AIOverhaul';
// Local default to keep the UI functional before plugin config loads.
const DEFAULT_BACKEND_BASE = 'http://localhost:4153';
const STORAGE_KEY = 'ai_backend_base_url';
const CONFIG_QUERY = `query AIOverhaulPluginConfig($ids: [ID!]) {
configuration {
plugins(include: $ids)
Expand Down Expand Up @@ -138,6 +139,15 @@ function applyPluginConfig(base, captureEvents, sharedKey) {
const value = normalized || '';
try {
window.AI_BACKEND_URL = value;
try {
if (value) {
sessionStorage.setItem(STORAGE_KEY, value);
}
else {
sessionStorage.removeItem(STORAGE_KEY);
}
}
catch { }
window.dispatchEvent(new CustomEvent('AIBackendBaseUpdated', { detail: value }));
}
catch { }
Expand Down Expand Up @@ -202,6 +212,16 @@ function defaultBackendBase() {
loadPluginConfig();
}
catch { }
try {
const stored = sessionStorage.getItem(STORAGE_KEY);
if (stored && typeof stored === 'string') {
const normalized = normalizeBase(stored);
if (normalized !== null && normalized !== undefined) {
return normalized;
}
}
}
catch { }
if (typeof window.AI_BACKEND_URL === 'string') {
const explicit = normalizeBase(window.AI_BACKEND_URL);
if (explicit !== null && explicit !== undefined) {
Expand Down
2 changes: 1 addition & 1 deletion plugins/AIOverhaul/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
https://discourse.stashapp.cc/t/aioverhaul/4847

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