fixed format getting set to 'misc' to all tracks on user-upped track
This commit is contained in:
parent
1160a0e1ba
commit
ce9fb730a2
File diff suppressed because one or more lines are too long
7
index.js
7
index.js
|
@ -134,7 +134,7 @@ router.get('/:type/:id', async request => {
|
||||||
}
|
}
|
||||||
|
|
||||||
let tagging = query.t
|
let tagging = query.t
|
||||||
tagging = (tagging === 'true' || tagging === '1') && ['misc', '128', '320'].includes(format)
|
tagging = (tagging === 'true' || tagging === '1') && (['misc', '128', '320'].includes(format) || type !== 'track')
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'track':
|
case 'track':
|
||||||
|
@ -369,10 +369,11 @@ async function m3u8(type, id, format, tagging, host) {
|
||||||
let list = '#EXTM3U\n'
|
let list = '#EXTM3U\n'
|
||||||
|
|
||||||
for (const track of json.tracks.data) {
|
for (const track of json.tracks.data) {
|
||||||
|
let format_tmp = format
|
||||||
if (track.id < 0) { // user-uploaded track
|
if (track.id < 0) { // user-uploaded track
|
||||||
format = 'misc'
|
format_tmp = 'misc'
|
||||||
}
|
}
|
||||||
let result = `https://${host}/track/${track.id}?f=${format}&t=${+ tagging}`
|
let result = `https://${host}/track/${track.id}?f=${format_tmp}&t=${+ tagging}`
|
||||||
list += `#EXTINF:${track.duration},${track.title}\n${result}\n`
|
list += `#EXTINF:${track.duration},${track.title}\n${result}\n`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue