diff --git a/packages/tourmaline/src/lib/client/load-profile.ts b/packages/tourmaline/src/lib/client/load-profile.ts index de9f8b7..b63656d 100644 --- a/packages/tourmaline/src/lib/client/load-profile.ts +++ b/packages/tourmaline/src/lib/client/load-profile.ts @@ -172,6 +172,12 @@ export function computeProfile( longestNotListenedGap: data.longestNotListenedGap, recommendations: buildRecommendations(data.topArtists, data.allArtists, artistInfos), anniversaries: buildAnniversaries(data), + daysScrobbled: data.daysScrobbled, + daysScrobbledPercentage: data.daysScrobbledPercentage, + oneHitWondersCount: data.oneHitWondersCount, + oneHitWondersPercentage: data.oneHitWondersPercentage, + mostPopularYear: data.mostPopularYear, + mostPopularMonth: data.mostPopularMonth, }; const sessions = deriveSessions(filtered); diff --git a/packages/tourmaline/src/lib/types.ts b/packages/tourmaline/src/lib/types.ts index 364b9ce..d0dc0cb 100644 --- a/packages/tourmaline/src/lib/types.ts +++ b/packages/tourmaline/src/lib/types.ts @@ -141,6 +141,12 @@ export interface ListenerProfile { longestNotListenedGap: Gap | null; recommendations: Recommendation[]; anniversaries: AnniversaryGroups; + daysScrobbled: number; + daysScrobbledPercentage: number; + oneHitWondersCount: number; + oneHitWondersPercentage: number; + mostPopularYear: { year: string; count: number }; + mostPopularMonth: { month: string; count: number }; } export interface UnusualMonth { diff --git a/packages/tourmaline/src/routes/profile/[did]/+page.svelte b/packages/tourmaline/src/routes/profile/[did]/+page.svelte index 2078247..1979249 100644 --- a/packages/tourmaline/src/routes/profile/[did]/+page.svelte +++ b/packages/tourmaline/src/routes/profile/[did]/+page.svelte @@ -444,6 +444,16 @@ {:else if activeTab === 'habits'} +
+ +
+ {#if profile.scrobblesByHour.some((n) => n > 0)}

Listening Clock

diff --git a/packages/tourmaline/src/routes/profile/[did]/ListeningStats.svelte b/packages/tourmaline/src/routes/profile/[did]/ListeningStats.svelte index fe6d32f..054d4df 100644 --- a/packages/tourmaline/src/routes/profile/[did]/ListeningStats.svelte +++ b/packages/tourmaline/src/routes/profile/[did]/ListeningStats.svelte @@ -2,6 +2,14 @@ import { Flame, TrendingUp, Calendar, Hash, Clock, User, Zap, Star } from '@lucide/svelte'; import type { DailyScrobble, Gap } from '$lib/types'; + interface StatsData { + daysScrobbled: number; + daysScrobbledPercentage: number; + oneHitWondersCount: number; + oneHitWondersPercentage: number; + mostPopularMonth: { month: string; count: number }; + } + let { dailyScrobbles = [], totalScrobbles = 0, @@ -13,7 +21,7 @@ totalScrobbles: number; longestGap: Gap | null; range?: string; - statsData?: any; + statsData?: StatsData | null; } = $props(); const stats = $derived.by(() => {