diff --git a/src/packages/settings/src/components/cardSettings.tsx b/src/packages/settings/src/components/cardSettings.tsx index 938814d7..03bc0c0b 100644 --- a/src/packages/settings/src/components/cardSettings.tsx +++ b/src/packages/settings/src/components/cardSettings.tsx @@ -159,6 +159,7 @@ export function CardSettings() { return !info?.permission_catalogue?.includes("upload_banner_image") && permissions.includes("upload_avatar_image"); }; const bannerHosts = connected.filter(mayUpload); + const videoBannerHosts = bannerHosts.filter((h) => serverDetailsList[h]?.server_info?.video_profiles === true); const [bannerPreview, setBannerPreview] = useState(); const [pendingBanner, setPendingBanner] = useState(); const [editing, setEditing] = useState(false); @@ -195,7 +196,10 @@ export function CardSettings() { setBannerBusy(true); const results = pendingBanner === undefined ? [] - : await Promise.allSettled(bannerHosts.map((h) => sendBanner(h, pendingBanner))); + // A video only goes where it is taken; the other servers keep the banner they have. + : await Promise.allSettled( + (pendingBanner?.type.startsWith("video/") ? videoBannerHosts : bannerHosts).map((h) => sendBanner(h, pendingBanner)), + ); setBannerBusy(false); const failed = results.filter((r): r is PromiseRejectedResult => r.status === "rejected"); if (results.length > 0 && failed.length === results.length) { @@ -277,6 +281,13 @@ export function CardSettings() { : `A picture across the top of your card, on the ${bannerHosts.length} of your servers that let you upload. The others show your pattern.` } > + + {videoBannerHosts.length === 0 + ? "Pictures only: none of your servers takes a video banner." + : videoBannerHosts.length < bannerHosts.length + ? `A video banner goes to the ${videoBannerHosts.length} of your servers that take one. The others keep the banner they have.` + : "A picture or a short video. A video plays silently, up to ten seconds."} +
+ {media && ( +
+ Uploads + + {media.checked + ? "New pictures and videos are checked and written out again in a sandbox before anyone sees them." + : "This server can't check uploads in a sandbox, so it shrinks pictures itself and can't take videos. Hosting from the Gryt desktop app, or with Docker, does both."} + +
+ { + setVideoProfiles(v); + if (!saveIfChanged({ videoProfiles: v })) setVideoProfiles(!v); + }} + disabled={!canEdit || !media.video} + /> + Let members use video avatars and banners +
+ + {media.video + ? "Each video becomes a silent clip of up to ten seconds, at the size of the card." + : "Not available here: it needs the same sandbox."} + +
+ )} +
Limits (optional)