Add recently played to profiles

A play is recorded when a new track starts (pausing and resuming doesn't
count; returning after 10+ minutes does). Profiles show the last 10,
excluding the track playing now; 50 are kept per user. Recent plays are
free on every plan; the paid flag is renamed to fullHistory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MzFywujuH9TiuXbr9vjoX8
This commit is contained in:
2026-10-03 16:02:38 -04:00
co-authored by Claude Opus 5.5
parent 87353ccca3
commit ece9c4fd64
14 changed files with 1147 additions and 11 deletions
+8
View File
@@ -58,6 +58,12 @@ export interface FeaturedSongDTO {
updatedAt: string;
}
export interface RecentPlayDTO {
track: TrackDTO;
source: NowPlayingProvider;
playedAt: string;
}
export interface ProfileDTO {
user: UserSummaryDTO & { bio: string | null };
followerCount: number;
@@ -67,6 +73,8 @@ export interface ProfileDTO {
isSelf: boolean;
featured: FeaturedSongDTO | null;
nowPlaying: NowPlayingDTO | null;
/** Most recent first, not including the track playing right now. */
recent: RecentPlayDTO[];
}
export interface ConnectionDTO {
+4 -4
View File
@@ -11,12 +11,12 @@ export interface Entitlements {
maxConnections: number;
/** Friends you can pin to the top of your feed. */
maxPinnedFriends: number;
/** Placeholder for future paid features. */
listeningHistory: boolean;
/** Full listening history page (profiles show recent plays on every plan). Placeholder for a paid feature. */
fullHistory: boolean;
profileThemes: boolean;
}
export const PLAN_ENTITLEMENTS: Record<Plan, Entitlements> = {
free: { activePollSeconds: 15, maxConnections: 3, maxPinnedFriends: 3, listeningHistory: false, profileThemes: false },
plus: { activePollSeconds: 5, maxConnections: 10, maxPinnedFriends: 20, listeningHistory: true, profileThemes: true },
free: { activePollSeconds: 15, maxConnections: 3, maxPinnedFriends: 3, fullHistory: false, profileThemes: false },
plus: { activePollSeconds: 5, maxConnections: 10, maxPinnedFriends: 20, fullHistory: true, profileThemes: true },
};