From 4ef610c143fe50546fbef10d675ceecfc4b85672 Mon Sep 17 00:00:00 2001 From: Joshua Higgins Date: Mon, 16 Nov 2026 15:31:50 -0500 Subject: [PATCH] fix: hide unknown release years on every platform Unknown years are stored as 0 and dates as "". Album detail now returns a null year and the Siri catalog sends an empty year instead of "0", so no client has to special-case 0. Co-Authored-By: Claude Opus 5.5 --- apps/mobile/components/app-intent-bridge.tsx | 2 +- packages/convex/convex/library.ts | 8 ++++---- packages/convex/convex/types.ts | 2 ++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/mobile/components/app-intent-bridge.tsx b/apps/mobile/components/app-intent-bridge.tsx index c73c49d..56929f6 100644 --- a/apps/mobile/components/app-intent-bridge.tsx +++ b/apps/mobile/components/app-intent-bridge.tsx @@ -134,7 +134,7 @@ function songEntity(song: { albumId: song.albumId, duration: String(song.durationSeconds), genres: song.genres ?? "", - year: song.year == null ? "" : String(song.year), + year: song.year ? String(song.year) : "", track: song.track == null ? "" : String(song.track), disk: song.diskNumber == null ? "" : String(song.diskNumber), favorite: song.favorite ? "1" : "0", diff --git a/packages/convex/convex/library.ts b/packages/convex/convex/library.ts index f91062f..88afba4 100644 --- a/packages/convex/convex/library.ts +++ b/packages/convex/convex/library.ts @@ -606,7 +606,7 @@ export const browseAlbumDetail = query({ return { ...toBrowseAlbum(album, artist), - year: primarySong?.year ?? null, + year: primarySong?.year || null, genre: primarySong?.genres[0] ?? null, releaseDate: album.date, hasLossless: songs.some((song) => "lossless" in song.files), @@ -640,7 +640,7 @@ async function browseAlbumSummaryHandler( return { ...toBrowseAlbum(album, artist), - year: primarySong?.year ?? null, + year: primarySong?.year || null, genre: primarySong?.genres[0] ?? null, releaseDate: album.date, hasLossless: songs.some((song) => "lossless" in song.files), @@ -1281,7 +1281,7 @@ export const intentCatalogPage = query({ albumId: album._id, duration: String(Math.max(0, Math.round(song.length))), genres: song.genres.join(", "), - year: String(song.year), + year: song.year ? String(song.year) : "", track: String(song.track), disk: String(song.diskNumber ?? ""), favorite: user.favoriteSongs?.includes(song._id) ? "1" : "0", @@ -1302,7 +1302,7 @@ export const intentCatalogPage = query({ metadata: { artistName: artist.name, artistId: artist._id, - year: String(album.year), + year: album.year ? String(album.year) : "", favorite: user.favoriteAlbums?.includes(album._id) ? "1" : "0", }, }) diff --git a/packages/convex/convex/types.ts b/packages/convex/convex/types.ts index 6aee22a..0163235 100644 --- a/packages/convex/convex/types.ts +++ b/packages/convex/convex/types.ts @@ -33,8 +33,10 @@ export type BrowseAlbumTrack = { } export type BrowseAlbumDetail = BrowseAlbum & { + /** `null` when the files have no year tag; clients hide it. */ year: number | null genre: string | null + /** Empty when unknown; clients hide it. */ releaseDate: string hasLossless: boolean hasAtmos: boolean