Songs offered links to all five services. Settings now has "Your music services": pick the ones you use and songs only show those, with the main one as the big button. Until someone picks, they still see all of them. Onboarding sets it to the app you said you listen with. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -47,6 +47,18 @@ export const SERVICE_COLORS: Record<StreamingService | NowPlayingProvider, strin
|
||||
android_media_session: '#5b4cf0',
|
||||
};
|
||||
|
||||
/**
|
||||
* The services to offer for a song, main one first: the ones the viewer uses,
|
||||
* or all of them if they haven't said.
|
||||
*/
|
||||
export function viewerServices(
|
||||
viewer: { preferredService: StreamingService | null; services: StreamingService[] | null } | null | undefined,
|
||||
): StreamingService[] {
|
||||
const chosen = viewer?.services?.length ? viewer.services : STREAMING_SERVICES;
|
||||
const main = viewer?.preferredService;
|
||||
return main ? [main, ...chosen.filter((s) => s !== main)] : [...chosen];
|
||||
}
|
||||
|
||||
/** Fallback when we have no direct link: a search on that service. */
|
||||
export function searchUrl(service: StreamingService, title: string, artist: string): string {
|
||||
const q = encodeURIComponent(`${artist} ${title}`);
|
||||
|
||||
Reference in New Issue
Block a user