fixed user-upped tracks
This commit is contained in:
parent
a92876194a
commit
4b8b3dde44
File diff suppressed because one or more lines are too long
8
index.js
8
index.js
|
@ -58,6 +58,10 @@ async function track(id, format, tagging) {
|
||||||
return new Response(JSON.stringify(json.error), { status: 403, headers: { 'content-type': "application/json" } })
|
return new Response(JSON.stringify(json.error), { status: 403, headers: { 'content-type': "application/json" } })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (json.id < 0) { // user-uploaded track
|
||||||
|
format = 'misc'
|
||||||
|
}
|
||||||
|
|
||||||
const wasm = await import('./pkg')
|
const wasm = await import('./pkg')
|
||||||
|
|
||||||
encrypted = !['320', 'flac'].includes(format)
|
encrypted = !['320', 'flac'].includes(format)
|
||||||
|
@ -213,10 +217,6 @@ function legacy_track_url(json, format, url_func) {
|
||||||
const md5_origin = json.md5_origin
|
const md5_origin = json.md5_origin
|
||||||
const media_version = json.media_version
|
const media_version = json.media_version
|
||||||
|
|
||||||
if (id < 0) { // user-uploaded track
|
|
||||||
format = 'misc'
|
|
||||||
}
|
|
||||||
|
|
||||||
if (json['filesize_' + format] == false) {
|
if (json['filesize_' + format] == false) {
|
||||||
return new Response('Format unavailable', { status: 403, headers: { 'content-type': 'text/plain' } })
|
return new Response('Format unavailable', { status: 403, headers: { 'content-type': 'text/plain' } })
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue