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:
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { STREAMING_SERVICES, openUrl, searchUrl } from './services';
|
||||
import { STREAMING_SERVICES, isQuietScrobbler, openUrl, searchUrl } from './services';
|
||||
|
||||
const track = { title: 'Midnight City', artist: 'M83', links: { spotify: 'https://open.spotify.com/track/abc' } };
|
||||
|
||||
@@ -22,3 +22,21 @@ describe('searchUrl', () => {
|
||||
expect(decodeURIComponent(url.href)).toContain('Ünïcode Café & Co');
|
||||
});
|
||||
});
|
||||
|
||||
describe('isQuietScrobbler', () => {
|
||||
const now = new Date('2026-10-04T12:00:00Z').getTime();
|
||||
const conn = (provider: string, daysAgo: number | null) => ({
|
||||
provider,
|
||||
status: 'active',
|
||||
lastActivityAt: daysAgo === null ? null : new Date(now - daysAgo * 86_400_000).toISOString(),
|
||||
});
|
||||
it('flags Last.fm/ListenBrainz that went silent for over a week', () => {
|
||||
expect(isQuietScrobbler(conn('lastfm', 8), now)).toBe(true);
|
||||
expect(isQuietScrobbler(conn('listenbrainz', 30), now)).toBe(true);
|
||||
});
|
||||
it('ignores recent activity, never-active connections, and other providers', () => {
|
||||
expect(isQuietScrobbler(conn('lastfm', 2), now)).toBe(false);
|
||||
expect(isQuietScrobbler(conn('lastfm', null), now)).toBe(false);
|
||||
expect(isQuietScrobbler(conn('spotify', 30), now)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user