diff --git a/src/userscripts/smartlink_importer/README.md b/src/userscripts/smartlink_importer/README.md index 6a83648c..26da92c1 100644 --- a/src/userscripts/smartlink_importer/README.md +++ b/src/userscripts/smartlink_importer/README.md @@ -26,7 +26,7 @@ Test link: [bfan.link/elan](https://bfan.link/elan) ### DistroKid HyperFollow -Provider destinations are read directly from DistroKid HyperFollow’s rendered store links. DistroKid’s store identifiers are normalized, including its legacy Google identifier for YouTube Music, and iTunes links are treated as downloads. +Provider destinations are read directly from DistroKid HyperFollow’s rendered store links. Legacy Google Play Music and Napster links are ignored, and iTunes links are treated as downloads. Test link: [distrokid.com/hyperfollow/timerival/stride](https://distrokid.com/hyperfollow/timerival/stride) diff --git a/src/userscripts/smartlink_importer/utils/extractors/distrokid.ts b/src/userscripts/smartlink_importer/utils/extractors/distrokid.ts index daaeb9ea..94f8b33d 100644 --- a/src/userscripts/smartlink_importer/utils/extractors/distrokid.ts +++ b/src/userscripts/smartlink_importer/utils/extractors/distrokid.ts @@ -4,7 +4,7 @@ import type { ServiceElement } from '~/userscripts/smartlink_importer/utils/type import { nextCacheKey } from './common'; const SERVICE_ALIASES: Readonly> = { - google: 'youtubemusic', + google: 'googleplay', }; export function distrokidServiceName(store: string): string { diff --git a/src/userscripts/smartlink_importer/utils/logic.ts b/src/userscripts/smartlink_importer/utils/logic.ts index 2b1e5544..f0932765 100644 --- a/src/userscripts/smartlink_importer/utils/logic.ts +++ b/src/userscripts/smartlink_importer/utils/logic.ts @@ -2,7 +2,7 @@ const HARMONY_SERVICE_PREFERENCE = ['spotify', 'tidal', 'deezer', 'bandcamp', 'apple', 'itunes'] as const; const TRACKING_PARAMETER_NAMES = new Set(['at', 'ct', 'ffm', 'lid', 'ref', 'ref_', 'si', 'src', 'tag']); -const IGNORED_SERVICES = new Set(['junodownload']); +const IGNORED_SERVICES = new Set(['googleplay', 'junodownload', 'napster']); const PHYSICAL_MEDIA_SERVICES = new Set(['amazoncdvinyl', 'barnesnoble', 'hmvjapan', 'imusic', 'sanity', 'towerrecords']); const FREE_STREAMING_SERVICES = new Set(['boomplay', 'deezer', 'spotify', 'youtube']); const STREAMING_SERVICES = new Set(['amazon', 'apple', 'itunes', 'kkbox', 'pandora', 'qobuz', 'soundcloud', 'tidal', 'youtubemusic']); diff --git a/tests/smartlink-importer/logic.test.ts b/tests/smartlink-importer/logic.test.ts index e4d9dc1b..fef5ae87 100644 --- a/tests/smartlink-importer/logic.test.ts +++ b/tests/smartlink-importer/logic.test.ts @@ -125,8 +125,10 @@ describe('Smartlink importer shared logic', () => { expect(chooseHarmonyLink(links.slice(0, 2))?.service).toBe('tidal'); }); - it('ignores sunset Juno Download services', () => { + it('ignores discontinued services', () => { + expect(isIgnoredService('googleplay')).toBe(true); expect(isIgnoredService('junodownload')).toBe(true); + expect(isIgnoredService('napster')).toBe(true); expect(isIgnoredService('beatport')).toBe(false); }); @@ -176,6 +178,12 @@ describe('Smartlink importer shared logic', () => { it('provides a shared reason for links that should be skipped', () => { expect(skipReasonForServiceLink('junodownload', 'Buy', 'https://example.com/release')).toBe('Ignored service'); + expect(skipReasonForServiceLink('googleplay', 'Listen', 'https://play.google.com/store/music/album/example')).toBe( + 'Ignored service', + ); + expect(skipReasonForServiceLink('napster', 'Listen', 'https://us.napster.com/artist/example/album/example')).toBe( + 'Ignored service', + ); expect(skipReasonForServiceLink('unknown-store', 'Buy Vinyl', 'https://example.com/release')).toBe('Physical-media link'); expect(skipReasonForServiceLink('tidal', 'Play', 'https://tidal.com/search?q=example')).toBe('Search fallback'); expect(skipReasonForServiceLink('youtube', 'Play', 'https://www.youtube.com/results?search_query=example')).toBe('Search fallback'); diff --git a/tests/smartlink-importer/site-logic.test.ts b/tests/smartlink-importer/site-logic.test.ts index df93f687..6a08cd20 100644 --- a/tests/smartlink-importer/site-logic.test.ts +++ b/tests/smartlink-importer/site-logic.test.ts @@ -109,7 +109,7 @@ describe('Smartlink importer site adapters', () => { it('maps DistroKid HyperFollow store identifiers and actions', () => { expect(distrokidServiceName('spotify')).toBe('spotify'); expect(distrokidServiceName('applemusic')).toBe('apple'); - expect(distrokidServiceName('google')).toBe('youtubemusic'); + expect(distrokidServiceName('google')).toBe('googleplay'); expect(distrokidServiceAction('itunes')).toBe('Download'); expect(distrokidServiceAction('deezer')).toBe('Listen'); });