mirror of
https://github.com/d-fi/d-fi-core.git
synced 2025-07-27 15:44:26 +02:00
support 13 digits upc #2
This commit is contained in:
parent
25c52a5e8e
commit
aea847c7e9
@ -21,7 +21,7 @@ export const isrc2deezer = async (name: string, isrc?: string) => {
|
|||||||
export const upc2deezer = async (name: string, upc?: string): Promise<[albumType, trackType[]]> => {
|
export const upc2deezer = async (name: string, upc?: string): Promise<[albumType, trackType[]]> => {
|
||||||
if (!upc) {
|
if (!upc) {
|
||||||
throw new Error('UPC code not found for ' + name);
|
throw new Error('UPC code not found for ' + name);
|
||||||
} else if (upc.length > 12) {
|
} else if (upc.length > 12 && upc.startsWith('0')) {
|
||||||
upc = upc.slice(-12);
|
upc = upc.slice(-12);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user