diff --git a/site/scripts/generate-pack-data.ts b/site/scripts/generate-pack-data.ts index 47f19ce..4152707 100644 --- a/site/scripts/generate-pack-data.ts +++ b/site/scripts/generate-pack-data.ts @@ -137,6 +137,7 @@ interface RegistryEntry { tags?: string[]; quality?: "gold" | "silver" | "flagged" | "unreviewed"; added?: string; + updated?: string; } interface PackData { @@ -159,6 +160,7 @@ interface PackData { sourceRepo?: string; sourcePath?: string; dateAdded?: string; + dateUpdated?: string; } // ── Config ────────────────────────────────────────────────────────────────── @@ -179,7 +181,7 @@ const REGISTRY_INDEX_URL = // ── Helpers ───────────────────────────────────────────────────────────────── // audioBase should be the URL of the directory containing sounds/ // e.g. "https://raw.../og-packs/v1.0.0/peon" or "https://raw.../mypack/v1.0.0" -function processManifest(manifest: Manifest, packName: string, audioBase: string, trustTier: string = "community", registryTags?: string[], sourceRepo?: string, sourcePath?: string, quality?: "gold" | "silver" | "flagged" | "unreviewed", dateAdded?: string): PackData { +function processManifest(manifest: Manifest, packName: string, audioBase: string, trustTier: string = "community", registryTags?: string[], sourceRepo?: string, sourcePath?: string, quality?: "gold" | "silver" | "flagged" | "unreviewed", dateAdded?: string, dateUpdated?: string): PackData { const categories: PackData["categories"] = []; const previewSounds: PackData["previewSounds"] = []; let soundCount = 0; @@ -224,6 +226,7 @@ function processManifest(manifest: Manifest, packName: string, audioBase: string sourceRepo, sourcePath, dateAdded, + dateUpdated, }; } @@ -305,7 +308,7 @@ async function generateFromRemote(): Promise { ? `${rawBase}/${entry.source_path}` : rawBase; - return processManifest(manifest, packName, audioBase, entry.trust_tier || "community", entry.tags, entry.source_repo, entry.source_path || undefined, entry.quality, entry.added); + return processManifest(manifest, packName, audioBase, entry.trust_tier || "community", entry.tags, entry.source_repo, entry.source_path || undefined, entry.quality, entry.added, entry.updated); }) ); diff --git a/site/src/components/ui/AudioPlayer.tsx b/site/src/components/ui/AudioPlayer.tsx index 6707403..9370405 100644 --- a/site/src/components/ui/AudioPlayer.tsx +++ b/site/src/components/ui/AudioPlayer.tsx @@ -60,11 +60,13 @@ export function AudioPlayer({ label, id, compact, + iconOnly, }: { url: string; label: string; id: string; compact?: boolean; + iconOnly?: boolean; }) { const { play, stop, currentId } = useAudio(); const isPlaying = currentId === id; @@ -79,6 +81,23 @@ export function AudioPlayer({ } }; + if (iconOnly) { + return ( + + ); + } + return ( - )} + {/* Stats */} +
+ + ♫ {pack.totalSoundCount} + + · + v{pack.version} + {(pack.dateUpdated || pack.dateAdded) && ( + <> + · + + + )} +
+ ); } diff --git a/site/src/lib/types.ts b/site/src/lib/types.ts index d9c648d..701cf8b 100644 --- a/site/src/lib/types.ts +++ b/site/src/lib/types.ts @@ -34,6 +34,7 @@ export interface PackMeta { sourceRepo?: string; sourcePath?: string; dateAdded?: string; + dateUpdated?: string; } export interface PacksData {