feat(catalogue): refresh is a button, not a schedule
The daily job is gone. A refresh only matters at one moment — you are picking a provider and want to know its models are current — and at that moment a button answers the question, where a nightly pass can only have already answered it, invisibly, or not. It also bought a standing obligation: something hitting a vendor from every install forever whether anyone opens Atelier or not. So the add dialog is now the curated file made visible. Provider comes from the catalogue, models come from that provider's entry in it, and two buttons re-read it from the vendor: one for the provider in front of you, one for all of them. `POST /providers/catalogue/refresh?provider=` is the only trigger there is. The dialog also says how old the answer is — "as shipped" until a refresh has ever run, which is worth showing, because it means the models listed are exactly what the plugin was released with. A provider with no refresher answers 400 rather than a silent success: from a button, "nothing happened" and "nothing could happen" look identical.
This commit is contained in:
@@ -4,6 +4,7 @@ import type { Provider } from '../db';
|
||||
import { decrypt } from '../crypto';
|
||||
import { ADAPTERS, adapterByName } from './index';
|
||||
import { getCatalogue } from '../catalogue/store';
|
||||
import { refreshableProviders } from '../catalogue/refresh';
|
||||
import type { ImageAdapter } from './types';
|
||||
|
||||
/**
|
||||
@@ -146,7 +147,9 @@ export const adapterCatalogue = async () => {
|
||||
default_model: provider.defaultModel ?? adapter.defaultModel,
|
||||
env_var: provider.envVar || envVarFor(provider.name),
|
||||
supports_edit: typeof adapter.edit === 'function',
|
||||
/** When this provider's models were last refreshed; null while only the shipped file has been read. */
|
||||
updated_at: catalogue.updatedAt ?? null,
|
||||
refreshable: refreshableProviders().includes(provider.name),
|
||||
},
|
||||
];
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user