Skip to content

Commit 98547d4

Browse files
committed
feat(iTunes): Handle music video URLs
1 parent 3183769 commit 98547d4

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

providers/iTunes/mod.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ describe('iTunes provider', () => {
4747
description: 'Apple Music song URL with slug',
4848
url: new URL('https://music.apple.com/fr/song/wet-cheese-delirium-2015-remaster/973594909'),
4949
id: { type: 'song', id: '973594909', region: 'FR', slug: 'wet-cheese-delirium-2015-remaster' },
50+
}, {
51+
description: 'Apple Music video URL',
52+
url: new URL('https://music.apple.com/gb/music-video/1441458100'),
53+
id: { type: 'music-video', id: '1441458100', region: 'GB' },
54+
isCanonical: true,
5055
}, {
5156
description: 'iTunes legacy album URL',
5257
url: new URL('https://itunes.apple.com/gb/album/id1722294645'),

providers/iTunes/mod.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default class iTunesProvider extends MetadataApiProvider {
2525

2626
readonly supportedUrls = new URLPattern({
2727
hostname: '{geo.}?(itunes|music).apple.com',
28-
pathname: String.raw`/:region(\w{2})?/:type(album|artist|song)/:slug?/{id}?:id(\d+)`,
28+
pathname: String.raw`/:region(\w{2})?/:type(album|artist|song|music-video)/:slug?/{id}?:id(\d+)`,
2929
});
3030

3131
override readonly features: FeatureQualityMap = {
@@ -38,7 +38,7 @@ export default class iTunesProvider extends MetadataApiProvider {
3838
readonly entityTypeMap = {
3939
artist: 'artist',
4040
release: 'album',
41-
recording: 'song', // ['song', 'music-video'],
41+
recording: ['song', 'music-video'],
4242
};
4343

4444
override readonly availableRegions = new Set(availableRegions);

0 commit comments

Comments
 (0)