From 5fbe41ef4c9cdd69ae21af1a8772690ecc1a2662 Mon Sep 17 00:00:00 2001 From: hiidz <33335872+hiidz@users.noreply.github.com> Date: Fri, 23 Oct 2026 11:40:42 +0800 Subject: [PATCH 1/2] feat(vault): stop storing and pushing a folder's hero video --- docs/api/openapi.yaml | 6 ++- docs/data-model.md | 2 +- internal/api/community_test.go | 6 +-- internal/vault/community_media.go | 1 - internal/vault/community_media_test.go | 30 +++++++------- internal/vault/folder_appearance_test.go | 50 ++++++++++++++++++++---- internal/vault/folders.go | 6 ++- internal/vault/models.go | 10 +++-- internal/vault/pushpayload.go | 2 - internal/vault/pushpayload_test.go | 6 ++- internal/vault/validation.go | 3 +- 11 files changed, 80 insertions(+), 42 deletions(-) diff --git a/docs/api/openapi.yaml b/docs/api/openapi.yaml index 8939fa7..06c0190 100644 --- a/docs/api/openapi.yaml +++ b/docs/api/openapi.yaml @@ -1520,7 +1520,7 @@ components: description: The folder's title, or the collection's for its backdrop. field: type: string - enum: [backdrop_image_url, cover_image_url, focus_gif_url, hero_backdrop_url, hero_video_url, title_logo_url] + enum: [backdrop_image_url, cover_image_url, focus_gif_url, hero_backdrop_url, title_logo_url] url: { type: string } site: type: string @@ -1642,7 +1642,9 @@ components: focus_gif_url: { type: string, maxLength: 2048 } focus_gif_enabled: { type: boolean } hero_backdrop_url: { type: string, maxLength: 2048 } - hero_video_url: { type: string, maxLength: 2048 } + hero_video_url: + type: string + description: Always empty. A value sent is ignored and never stored or pushed. title_logo_url: { type: string, maxLength: 2048 } FolderRef: diff --git a/docs/data-model.md b/docs/data-model.md index 8cbd7cb..81d0f5a 100644 --- a/docs/data-model.md +++ b/docs/data-model.md @@ -120,7 +120,7 @@ erDiagram string focus_gif_url bool focus_gif_enabled "defaults to 1, matching Nuvio" string hero_backdrop_url - string hero_video_url + string hero_video_url "always empty, kept so stored snapshots keep their bytes" string title_logo_url string sub_key "nullable — in a subscribed collection, its snapshot key" } diff --git a/internal/api/community_test.go b/internal/api/community_test.go index 806a90e..ac12f83 100644 --- a/internal/api/community_test.go +++ b/internal/api/community_test.go @@ -268,7 +268,7 @@ func TestCollectionWithheldMediaRoute(t *testing.T) { } art := vault.FolderArt{ TileShape: "POSTER", CoverImageURL: "https://image.tmdb.org/t/p/w500/cover.jpg", - HeroVideoURL: "https://Cdn.Example.com:8443/hero.mp4", + TitleLogoURL: "https://Cdn.Example.com:8443/logo.png", } collection, err := x.f.db.CreateUserCollection(ctx, x.f.caller.ID, vault.CollectionForm{ Title: "Art", ViewMode: "ROWS", BackdropImageURL: "https://i.postimg.cc/backdrop.jpg", @@ -288,10 +288,10 @@ func TestCollectionWithheldMediaRoute(t *testing.T) { x.f.db.ShareCommunityMediaFrom([]string{"image.tmdb.org", "*.example.org"}) trusted := newCommunityServer(t, x.f.db, CommunityTrustedImages) - hero := `"field":"hero_video_url","url":"https://Cdn.Example.com:8443/hero.mp4","site":"cdn.example.com"}` + logo := `"field":"title_logo_url","url":"https://Cdn.Example.com:8443/logo.png","site":"cdn.example.com"}` want := `{"pictures":[` + `{"title":"Art","field":"backdrop_image_url","url":"https://i.postimg.cc/backdrop.jpg","site":"i.postimg.cc"},` + - `{"title":"One",` + hero + `,{"title":"Two",` + hero + + `{"title":"One",` + logo + `,{"title":"Two",` + logo + `],"sites":["image.tmdb.org","*.example.org"]}` if w := serve(t, trusted, http.MethodGet, path, "", false); w.Code != http.StatusOK || strings.TrimSpace(w.Body.String()) != want { t.Errorf("on a server trusting some sites: %d %s\nwant %s", w.Code, w.Body.String(), want) diff --git a/internal/vault/community_media.go b/internal/vault/community_media.go index b51a92b..7d1b037 100644 --- a/internal/vault/community_media.go +++ b/internal/vault/community_media.go @@ -110,7 +110,6 @@ func (db *DB) CollectionWithheldMedia(ctx context.Context, profileID, collection add(f.Title, "cover_image_url", f.CoverImageURL) add(f.Title, "focus_gif_url", f.FocusGIFURL) add(f.Title, "hero_backdrop_url", f.HeroBackdropURL) - add(f.Title, "hero_video_url", f.HeroVideoURL) add(f.Title, "title_logo_url", f.TitleLogoURL) } return out, nil diff --git a/internal/vault/community_media_test.go b/internal/vault/community_media_test.go index 31773b9..70ea926 100644 --- a/internal/vault/community_media_test.go +++ b/internal/vault/community_media_test.go @@ -17,8 +17,8 @@ func mediaCollection(title string) CollectionForm { FolderArt: FolderArt{ TileShape: "POSTER", CoverEmoji: "🎬", CoverImageURL: "https://img.example/cover.jpg", FocusGIFURL: "https://img.example/focus.gif", FocusGIFEnabled: true, - HeroBackdropURL: "https://img.example/hero.jpg", HeroVideoURL: "https://img.example/hero.mp4", - TitleLogoURL: "https://img.example/logo.png", + HeroBackdropURL: "https://img.example/hero.jpg", + TitleLogoURL: "https://img.example/logo.png", }, Title: "F", Catalogs: []FolderCatalogRef{newScoped("k", "S", "{}")}, }}, @@ -27,7 +27,7 @@ func mediaCollection(title string) CollectionForm { // artMedia is a's media addresses, empty ones included. func artMedia(a FolderArt) []string { - return []string{a.CoverImageURL, a.FocusGIFURL, a.HeroBackdropURL, a.HeroVideoURL, a.TitleLogoURL} + return []string{a.CoverImageURL, a.FocusGIFURL, a.HeroBackdropURL, a.TitleLogoURL} } // treeMedia is every media address tree holds. @@ -95,15 +95,15 @@ func TestWithheldMediaLeavesCommunityAndCopies(t *testing.T) { } } - if got := treeMedia(mustOwnCollection(t, db, owner, source.ID)); len(got) != 6 { - t.Errorf("publisher's own row holds %v, want all 6 addresses", got) + if got := treeMedia(mustOwnCollection(t, db, owner, source.ID)); len(got) != 5 { + t.Errorf("publisher's own row holds %v, want all 5 addresses", got) } stored, err := sharingAll(db).GetPublication(ctx, owner, source.Publication.ID) if err != nil { t.Fatal(err) } - if got := snapshotMedia(stored.Snapshot); len(got) != 6 { - t.Errorf("stored snapshot holds %v, want all 6 addresses", got) + if got := snapshotMedia(stored.Snapshot); len(got) != 5 { + t.Errorf("stored snapshot holds %v, want all 5 addresses", got) } } @@ -117,8 +117,8 @@ func TestWithheldMediaUpdate(t *testing.T) { owner, subscriber := newTestProfile(t, db, "owner"), newTestProfile(t, db, "subscriber") source := publishCollection(t, db, owner, mediaCollection("Art")) added := *subscribe(t, db, subscriber, source.Publication.ID).Collection - if got := treeMedia(added); len(got) != 6 { - t.Fatalf("copy added while media is shared holds %v, want all 6 addresses", got) + if got := treeMedia(added); len(got) != 5 { + t.Fatalf("copy added while media is shared holds %v, want all 5 addresses", got) } db.WithholdCommunityMedia() pubID := source.Publication.ID @@ -285,15 +285,15 @@ func TestTrustedMediaLeavesCommunityAndCopies(t *testing.T) { } } - if got := treeMedia(mustOwnCollection(t, db, owner, source.ID)); len(got) != 6 { - t.Errorf("publisher's own row holds %v, want all 6 addresses", got) + if got := treeMedia(mustOwnCollection(t, db, owner, source.ID)); len(got) != 5 { + t.Errorf("publisher's own row holds %v, want all 5 addresses", got) } stored, err := sharingAll(db).GetPublication(ctx, owner, source.Publication.ID) if err != nil { t.Fatal(err) } - if got := snapshotMedia(stored.Snapshot); len(got) != 6 { - t.Errorf("stored snapshot holds %v, want all 6 addresses", got) + if got := snapshotMedia(stored.Snapshot); len(got) != 5 { + t.Errorf("stored snapshot holds %v, want all 5 addresses", got) } } @@ -305,8 +305,8 @@ func TestTrustedMediaUpdate(t *testing.T) { db := newTestDB(t) owner, subscriber := newTestProfile(t, db, "owner"), newTestProfile(t, db, "subscriber") source := publishCollection(t, db, owner, mixedMediaCollection("Art")) - if got := treeMedia(*subscribe(t, db, subscriber, source.Publication.ID).Collection); len(got) != 6 { - t.Fatalf("copy added while media is shared holds %v, want all 6 addresses", got) + if got := treeMedia(*subscribe(t, db, subscriber, source.Publication.ID).Collection); len(got) != 5 { + t.Fatalf("copy added while media is shared holds %v, want all 5 addresses", got) } db.ShareCommunityMediaFrom([]string{trustedSite}) pubID := source.Publication.ID diff --git a/internal/vault/folder_appearance_test.go b/internal/vault/folder_appearance_test.go index 7f69e11..7d5e704 100644 --- a/internal/vault/folder_appearance_test.go +++ b/internal/vault/folder_appearance_test.go @@ -6,7 +6,7 @@ import ( ) // The Nuvio appearance fields (focus glow on the collection; focus GIF and -// Modern Home hero fields on a folder) survive create, an in-place update of +// Modern Home hero backdrop and title logo on a folder) survive create, an in-place update of // an existing folder, and DuplicateCollection's tree copy. func TestCollectionAppearanceFieldsRoundTrip(t *testing.T) { ctx := context.Background() @@ -24,7 +24,6 @@ func TestCollectionAppearanceFieldsRoundTrip(t *testing.T) { FocusGIFURL: "https://example.com/focus.gif", FocusGIFEnabled: true, HeroBackdropURL: "https://example.com/backdrop.jpg", - HeroVideoURL: "https://example.com/hero.mp4", TitleLogoURL: "https://example.com/logo.png", }, Catalogs: CatalogRefs(listed.ID), @@ -44,7 +43,6 @@ func TestCollectionAppearanceFieldsRoundTrip(t *testing.T) { folder.ID = &created.Folders[0].ID folder.FocusGIFEnabled = false - folder.HeroVideoURL = "" folder.TitleLogoURL = "https://example.com/logo2.png" updated, err := db.UpdateUserCollection(ctx, owner, created.ID, collectionRevision(t, db, created.ID), CollectionForm{ Title: "C", ViewMode: "TABBED_GRID", @@ -80,10 +78,46 @@ func TestCollectionAppearanceFieldsRoundTrip(t *testing.T) { func assertFolderAppearance(t *testing.T, label string, got Folder, want FolderData) { t.Helper() if got.FocusGIFURL != want.FocusGIFURL || got.FocusGIFEnabled != want.FocusGIFEnabled || - got.HeroBackdropURL != want.HeroBackdropURL || got.HeroVideoURL != want.HeroVideoURL || - got.TitleLogoURL != want.TitleLogoURL { - t.Errorf("%s folder appearance = {gif %q %v, backdrop %q, video %q, logo %q}, want {gif %q %v, backdrop %q, video %q, logo %q}", - label, got.FocusGIFURL, got.FocusGIFEnabled, got.HeroBackdropURL, got.HeroVideoURL, got.TitleLogoURL, - want.FocusGIFURL, want.FocusGIFEnabled, want.HeroBackdropURL, want.HeroVideoURL, want.TitleLogoURL) + got.HeroBackdropURL != want.HeroBackdropURL || got.TitleLogoURL != want.TitleLogoURL { + t.Errorf("%s folder appearance = {gif %q %v, backdrop %q, logo %q}, want {gif %q %v, backdrop %q, logo %q}", + label, got.FocusGIFURL, got.FocusGIFEnabled, got.HeroBackdropURL, got.TitleLogoURL, + want.FocusGIFURL, want.FocusGIFEnabled, want.HeroBackdropURL, want.TitleLogoURL) + } +} + +// A hero video that arrives with a folder is never stored, on create or on an +// in-place update. +func TestHeroVideoIsNeverStored(t *testing.T) { + ctx := context.Background() + db := newTestDB(t) + owner := newTestProfile(t, db, "owner") + listed, err := db.CreateUserCatalog(ctx, owner, listedCatalogForm("Listed")) + if err != nil { + t.Fatalf("create listed catalog: %v", err) + } + folder := FolderData{ + Title: "Folder", + FolderArt: FolderArt{TileShape: "POSTER", HeroVideoURL: "https://example.com/hero.mp4"}, + Catalogs: CatalogRefs(listed.ID), + } + form := CollectionForm{Title: "C", ViewMode: "TABBED_GRID", Folders: []FolderData{folder}} + created, err := db.CreateUserCollection(ctx, owner, form) + if err != nil { + t.Fatalf("CreateUserCollection: %v", err) + } + if got := created.Folders[0].HeroVideoURL; got != "" { + t.Errorf("created hero video = %q, want none", got) + } + + form.Folders[0].ID = &created.Folders[0].ID + if _, err := db.UpdateUserCollection(ctx, owner, created.ID, collectionRevision(t, db, created.ID), form); err != nil { + t.Fatalf("UpdateUserCollection: %v", err) + } + reloaded, err := db.GetUserCollections(ctx, owner) + if err != nil { + t.Fatalf("GetUserCollections: %v", err) + } + if got := reloaded[0].Folders[0].HeroVideoURL; got != "" { + t.Errorf("updated hero video = %q, want none", got) } } diff --git a/internal/vault/folders.go b/internal/vault/folders.go index 1159c34..906b122 100644 --- a/internal/vault/folders.go +++ b/internal/vault/folders.go @@ -14,9 +14,11 @@ import ( ) // folderFrom builds the folder row fd describes: id and sortOrder from the -// caller, every other column straight off fd. The one place that field list -// lives, shared by insertFolder and updateFolder. +// caller, every other column straight off fd but the hero video, which is +// always empty. The one place that field list lives, shared by insertFolder +// and updateFolder. func folderFrom(id, collectionID uuid.UUID, sortOrder int, fd FolderData) Folder { + fd.HeroVideoURL = "" return Folder{ ID: id, CollectionID: collectionID, diff --git a/internal/vault/models.go b/internal/vault/models.go index 27f0edd..ebf1253 100644 --- a/internal/vault/models.go +++ b/internal/vault/models.go @@ -137,11 +137,13 @@ type FolderArt struct { // it's focused, when FocusGIFEnabled is set. FocusGIFURL string `json:"focus_gif_url"` FocusGIFEnabled bool `json:"focus_gif_enabled"` - // HeroBackdropURL, HeroVideoURL and TitleLogoURL are the folder's hero - // media for Nuvio's Modern Home layout. + // HeroBackdropURL and TitleLogoURL are the folder's hero media for + // Nuvio's Modern Home layout. HeroBackdropURL string `json:"hero_backdrop_url"` - HeroVideoURL string `json:"hero_video_url"` - TitleLogoURL string `json:"title_logo_url"` + // HeroVideoURL is always empty: Uno doesn't set a hero video. It stays so + // every stored snapshot keeps its bytes, and so its content hash. + HeroVideoURL string `json:"hero_video_url"` + TitleLogoURL string `json:"title_logo_url"` } // FolderCatalog joins a Folder to one of its member Catalogs, in order. diff --git a/internal/vault/pushpayload.go b/internal/vault/pushpayload.go index 82fe758..ca8f0eb 100644 --- a/internal/vault/pushpayload.go +++ b/internal/vault/pushpayload.go @@ -49,7 +49,6 @@ type PushFolder struct { FocusGIFURL string `json:"focusGifUrl,omitempty"` FocusGIFEnabled bool `json:"focusGifEnabled"` HeroBackdropURL string `json:"heroBackdropUrl,omitempty"` - HeroVideoURL string `json:"heroVideoUrl,omitempty"` TitleLogoURL string `json:"titleLogoUrl,omitempty"` TileShape string `json:"tileShape"` HideTitle bool `json:"hideTitle"` @@ -107,7 +106,6 @@ func pushFolder(f FolderWithCatalogs, catalogs map[uuid.UUID]Catalog) PushFolder FocusGIFURL: f.FocusGIFURL, FocusGIFEnabled: f.FocusGIFEnabled, HeroBackdropURL: f.HeroBackdropURL, - HeroVideoURL: f.HeroVideoURL, TitleLogoURL: f.TitleLogoURL, TileShape: f.TileShape, HideTitle: f.HideTitle, diff --git a/internal/vault/pushpayload_test.go b/internal/vault/pushpayload_test.go index 8df06f0..2295d4b 100644 --- a/internal/vault/pushpayload_test.go +++ b/internal/vault/pushpayload_test.go @@ -88,7 +88,7 @@ func TestPushPayloadAppearanceFields(t *testing.T) { if v, ok := off["focusGifEnabled"]; !ok || v != false { t.Errorf("off folder focusGifEnabled = %v (present %v), want explicit false: %s", v, ok, raw) } - for _, key := range []string{"focusGifUrl", "heroBackdropUrl", "heroVideoUrl", "titleLogoUrl"} { + for _, key := range []string{"focusGifUrl", "heroBackdropUrl", "titleLogoUrl"} { if _, ok := off[key]; ok { t.Errorf("off folder carries empty %s: %s", key, raw) } @@ -97,7 +97,6 @@ func TestPushPayloadAppearanceFields(t *testing.T) { "focusGifEnabled": true, "focusGifUrl": "https://example.com/f.gif", "heroBackdropUrl": "https://example.com/b.jpg", - "heroVideoUrl": "https://example.com/v.mp4", "titleLogoUrl": "https://example.com/l.png", } for key, v := range want { @@ -105,6 +104,9 @@ func TestPushPayloadAppearanceFields(t *testing.T) { t.Errorf("on folder %s = %v, want %v: %s", key, on[key], v, raw) } } + if _, ok := on["heroVideoUrl"]; ok { + t.Errorf("on folder carries heroVideoUrl, which Uno never sends: %s", raw) + } } // A collection's folders and a folder's catalogSources go out as JSON arrays, diff --git a/internal/vault/validation.go b/internal/vault/validation.go index f94d936..487c923 100644 --- a/internal/vault/validation.go +++ b/internal/vault/validation.go @@ -153,7 +153,7 @@ func (in CollectionForm) normalized() CollectionForm { func (fd FolderData) normalized() FolderData { for _, s := range []*string{ &fd.Title, &fd.CoverEmoji, &fd.CoverImageURL, &fd.FocusGIFURL, - &fd.HeroBackdropURL, &fd.HeroVideoURL, &fd.TitleLogoURL, + &fd.HeroBackdropURL, &fd.TitleLogoURL, } { *s = strings.TrimSpace(*s) } @@ -289,7 +289,6 @@ func folderProblems(index int, fd FolderData) []string { {"cover image url", fd.CoverImageURL}, {"focus gif url", fd.FocusGIFURL}, {"hero backdrop url", fd.HeroBackdropURL}, - {"hero video url", fd.HeroVideoURL}, {"title logo url", fd.TitleLogoURL}, } { problems = appendProblem(problems, mediaURLProblem(fmt.Sprintf("folder %d: %s", index, f.name), f.value)) From e92fd1204245cb10520c42be1bba86b98636da85 Mon Sep 17 00:00:00 2001 From: hiidz <33335872+hiidz@users.noreply.github.com> Date: Fri, 23 Oct 2026 11:42:20 +0800 Subject: [PATCH 2/2] feat(web): remove the hero video field from the folder editor --- web/src/api/types.ts | 2 -- web/src/features/collections/FolderDetail.tsx | 12 ++---------- web/src/features/collections/collectionForm.test.ts | 4 ++-- web/src/features/collections/collectionForm.ts | 5 ----- web/src/features/community/CommunityView.test.tsx | 1 - web/src/features/sharing/PublishDialog.test.tsx | 6 +++--- web/src/features/sharing/WithheldPictures.tsx | 12 +++--------- web/src/features/sharing/snapshot.test.ts | 2 -- web/src/test/fixtures.ts | 1 - 9 files changed, 10 insertions(+), 35 deletions(-) diff --git a/web/src/api/types.ts b/web/src/api/types.ts index fcff95c..8642c50 100644 --- a/web/src/api/types.ts +++ b/web/src/api/types.ts @@ -89,7 +89,6 @@ export interface FolderLook { focus_gif_enabled: boolean /** Hero media for Nuvio's Modern Home layout. */ hero_backdrop_url: string - hero_video_url: string title_logo_url: string } @@ -286,7 +285,6 @@ export interface WithheldPicture { | 'cover_image_url' | 'focus_gif_url' | 'hero_backdrop_url' - | 'hero_video_url' | 'title_logo_url' url: string site: string diff --git a/web/src/features/collections/FolderDetail.tsx b/web/src/features/collections/FolderDetail.tsx index e9726cd..f9d0e00 100644 --- a/web/src/features/collections/FolderDetail.tsx +++ b/web/src/features/collections/FolderDetail.tsx @@ -33,7 +33,7 @@ function appearanceSummary(folder: FolderFormState): string { if (folder.coverImageURL.trim()) parts.push('cover image') else if (folder.coverEmoji.trim()) parts.push(`${folder.coverEmoji.trim()} cover`) if (folder.focusGIFEnabled && folder.focusGIFURL.trim()) parts.push('focus GIF') - if (folder.heroBackdropURL.trim() || folder.heroVideoURL.trim() || folder.titleLogoURL.trim()) { + if (folder.heroBackdropURL.trim() || folder.titleLogoURL.trim()) { parts.push('Modern Home hero') } return parts.join(' · ') @@ -208,15 +208,7 @@ export function FolderDetail({ onChange={(heroBackdropURL) => onChange({ heroBackdropURL })} placeholder="Image URL, https://…" ariaLabel={`Modern Home hero backdrop URL for ${label}`} - note="Hero backdrop, hero video and title logo are used only by Nuvio TV's Modern Home layout." - /> - onChange({ heroVideoURL })} - placeholder="Video URL, https://…" - ariaLabel={`Modern Home hero video URL for ${label}`} + note="Hero backdrop and title logo are used only by Nuvio TV's Modern Home layout." /> { const form = { ...emptyCollectionForm(), title: 'C', folders: [{ ...newFolder(), title: 'F', ...update }] } return Object.values(validateCollectionForm(form, accessible).folders)[0]?.media } - expect(media({ coverImageURL: 'https://x.test/a.png', heroVideoURL: ' https://x.test/v.mp4 ' })).toBeUndefined() - expect(media({ heroVideoURL: 'http://x.test/v.mp4' })).toBe('Hero video must be a web address starting with https://.') + expect(media({ coverImageURL: 'https://x.test/a.png', titleLogoURL: ' https://x.test/l.png ' })).toBeUndefined() + expect(media({ titleLogoURL: 'http://x.test/l.png' })).toBe('Title logo must be a web address starting with https://.') expect(media({ coverImageURL: 'javascript:alert(1)' })).toBe( 'Cover image must be a web address starting with https://.', ) diff --git a/web/src/features/collections/collectionForm.ts b/web/src/features/collections/collectionForm.ts index 1ce4193..1434e98 100644 --- a/web/src/features/collections/collectionForm.ts +++ b/web/src/features/collections/collectionForm.ts @@ -95,7 +95,6 @@ export interface FolderFormState { focusGIFURL: string focusGIFEnabled: boolean heroBackdropURL: string - heroVideoURL: string titleLogoURL: string /** Ordered — index becomes `folder_catalogs.sort_order`. */ refs: FolderRefState[] @@ -184,7 +183,6 @@ export function newFolder(): FolderFormState { focusGIFURL: '', focusGIFEnabled: true, heroBackdropURL: '', - heroVideoURL: '', titleLogoURL: '', refs: [], } @@ -215,7 +213,6 @@ function folderFromWire(folder: Folder): FolderFormState { focusGIFURL: folder.focus_gif_url, focusGIFEnabled: folder.focus_gif_enabled, heroBackdropURL: folder.hero_backdrop_url, - heroVideoURL: folder.hero_video_url, titleLogoURL: folder.title_logo_url, // `?? []` is a guard, not a live case: the Go side runs `refs` through // `orEmpty`. It stays because `getList` coerces only the top-level @@ -424,7 +421,6 @@ const FOLDER_ADDRESSES = [ ['Cover image', 'coverImageURL'], ['Focus GIF', 'focusGIFURL'], ['Hero backdrop', 'heroBackdropURL'], - ['Hero video', 'heroVideoURL'], ['Title logo', 'titleLogoURL'], ] as const satisfies readonly (readonly [string, keyof FolderFormState])[] @@ -516,7 +512,6 @@ export function toCollectionPayload( focus_gif_url: folder.focusGIFURL.trim(), focus_gif_enabled: folder.focusGIFEnabled, hero_backdrop_url: folder.heroBackdropURL.trim(), - hero_video_url: folder.heroVideoURL.trim(), title_logo_url: folder.titleLogoURL.trim(), catalogs: folder.refs.map(({ catalogID, genre }): FolderCatalogRef => { const draft = isDraftCatalogID(catalogID) ? localCatalogs.get(catalogID) : undefined diff --git a/web/src/features/community/CommunityView.test.tsx b/web/src/features/community/CommunityView.test.tsx index 6c94053..0ae00c5 100644 --- a/web/src/features/community/CommunityView.test.tsx +++ b/web/src/features/community/CommunityView.test.tsx @@ -51,7 +51,6 @@ const nightDetail: PublicationDetail = { focus_gif_url: '', focus_gif_enabled: false, hero_backdrop_url: '', - hero_video_url: '', title_logo_url: '', refs: [{ catalog: 'k1', genre: 'Slasher' }], }, diff --git a/web/src/features/sharing/PublishDialog.test.tsx b/web/src/features/sharing/PublishDialog.test.tsx index 1f150a0..45bfb7e 100644 --- a/web/src/features/sharing/PublishDialog.test.tsx +++ b/web/src/features/sharing/PublishDialog.test.tsx @@ -116,7 +116,7 @@ describe('PublishDialog', () => { const media = { pictures: [ { title: 'Studios', field: 'backdrop_image_url', url: 'https://i.postimg.cc/b.jpg', site: 'i.postimg.cc' }, - { title: 'Marvel', field: 'hero_video_url', url: 'https://i.imgur.com/v.mp4', site: 'i.imgur.com' }, + { title: 'Marvel', field: 'focus_gif_url', url: 'https://i.imgur.com/f.gif', site: 'i.imgur.com' }, ], sites: ['flagcdn.com', 'image.tmdb.org'], } as const satisfies Parameters[0]['media'] @@ -128,10 +128,10 @@ describe('PublishDialog', () => { const rows = within(card).getAllByRole('listitem') expect(rows.map((row) => row.textContent)).toEqual([ 'StudiosBackground image · i.postimg.cc', - 'MarvelHero video · i.imgur.com', + 'MarvelFocus GIF · i.imgur.com', ]) expect(rows[0].querySelector('img')).toHaveAttribute('src', 'https://i.postimg.cc/b.jpg') - expect(rows[1].querySelector('img')).toBeNull() + expect(rows[1].querySelector('img')).toHaveAttribute('src', 'https://i.imgur.com/f.gif') const opening = screen.getByText(/Anyone on Uno can find it/) expect(opening.compareDocumentPosition(card) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() }) diff --git a/web/src/features/sharing/WithheldPictures.tsx b/web/src/features/sharing/WithheldPictures.tsx index 1694180..5423291 100644 --- a/web/src/features/sharing/WithheldPictures.tsx +++ b/web/src/features/sharing/WithheldPictures.tsx @@ -1,6 +1,6 @@ import { useId, useState } from 'react' import { useQuery } from '@tanstack/react-query' -import { Film, ImageOff } from 'lucide-react' +import { ImageOff } from 'lucide-react' import { fetchWithheldMedia, queryKeys, type WithheldMedia, type WithheldPicture } from '@/api' import { Icon } from '@/components/Icon' import { communitySetting } from '@/lib/pageConfig' @@ -13,7 +13,6 @@ const FIELD_WORDS: Record = { cover_image_url: 'Cover image', focus_gif_url: 'Focus GIF', hero_backdrop_url: 'Hero backdrop', - hero_video_url: 'Hero video', title_logo_url: 'Title logo', } @@ -48,16 +47,11 @@ export function WithheldPictures({ return } -/** A picture's thumbnail: the picture itself, or a film icon for a hero - * video. */ +/** A picture's thumbnail: the picture itself. */ function Thumbnail({ picture }: { picture: WithheldPicture }) { return ( - {picture.field === 'hero_video_url' ? ( - - ) : ( - - )} + ) } diff --git a/web/src/features/sharing/snapshot.test.ts b/web/src/features/sharing/snapshot.test.ts index 358ef80..0673f14 100644 --- a/web/src/features/sharing/snapshot.test.ts +++ b/web/src/features/sharing/snapshot.test.ts @@ -60,7 +60,6 @@ describe('snapshotAsCollection', () => { focus_gif_url: '', focus_gif_enabled: false, hero_backdrop_url: '', - hero_video_url: '', title_logo_url: '', refs: [{ catalog: 'c1', genre: 'Horror' }], }, @@ -116,7 +115,6 @@ function emptyFolder() { focus_gif_url: '', focus_gif_enabled: false, hero_backdrop_url: '', - hero_video_url: '', title_logo_url: '', } } diff --git a/web/src/test/fixtures.ts b/web/src/test/fixtures.ts index af071e2..c2e1058 100644 --- a/web/src/test/fixtures.ts +++ b/web/src/test/fixtures.ts @@ -34,7 +34,6 @@ export function folder(overrides: Partial = {}): Folder { focus_gif_url: '', focus_gif_enabled: true, hero_backdrop_url: '', - hero_video_url: '', title_logo_url: '', refs: [], ...overrides,