Add media server selection to Nostr settings
CI / Lint (pull_request) Successful in 1m3s
CI / Test (pull_request) Successful in 1m16s
Release Drafter / Update release notes draft (pull_request) Successful in 5s

Also, hide the fallback option when there's no server to fall back to
This commit is contained in:
2026-08-21 11:27:03 -06:00
parent cdeb4f5d8c
commit 2746ec035d
5 changed files with 110 additions and 23 deletions
+5 -4
View File
@@ -24,14 +24,15 @@ export default class BlossomService extends Service {
@service settings;
get servers() {
const servers = this.nostrData.blossomServers;
const allServers = servers.length ? servers : [DEFAULT_BLOSSOM_SERVER];
const discovered = this.nostrData.blossomServers;
const mainServer = this.settings.nostrMediaServer || DEFAULT_BLOSSOM_SERVER;
const fallbacks = discovered.filter((server) => server !== mainServer);
if (!this.settings.nostrPhotoFallbackUploads) {
return [allServers[0]];
return [mainServer];
}
return allServers;
return [mainServer, ...fallbacks];
}
async _getAuthHeader(action, hash, serverUrl) {