Unlock everything, add a donation link, credit Last.fm, nudge re-linking

- Every feature is free for everyone (the plan system stays for later);
  remaining limits are abuse guards
- Optional website donation link (NEXT_PUBLIC_DONATION_URL). Not shown in
  the mobile apps, where tips to the developer generally need in-app
  purchase
- Last.fm/ListenBrainz-sourced plays link to the user's profile, as
  Last.fm's API terms require
- Connections track when they last saw activity; a scrobbler silent for
  over a week prompts re-linking Spotify (its link expires every 6 months)

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-04 08:13:54 -04:00
co-authored by Claude Opus 5.5
parent 91a78a8ad4
commit 63d618f0e3
33 changed files with 1277 additions and 38 deletions
+11
View File
@@ -71,3 +71,14 @@ describe('listening history', () => {
expect(await db.select().from(schema.listens)).toHaveLength(0);
});
});
describe('attribution', () => {
it('links Last.fm-sourced plays back to the Last.fm profile (required by Last.fm)', async () => {
const { user } = await createUser(app(), 'bob');
await db.insert(schema.connections).values({ userId: user.id, provider: 'lastfm', externalUserId: 'RJ', displayName: 'RJ' });
await applyPollResult(user.id, 'lastfm', playing('Disorder'), { sourceUrl: 'https://www.last.fm/user/RJ' });
const profile = (await app().inject({ url: '/users/bob' })).json();
expect(profile.nowPlaying.sourceUrl).toBe('https://www.last.fm/user/RJ');
expect(profile.attribution).toEqual({ lastfm: 'https://www.last.fm/user/RJ' });
});
});