replaced Number() with parseInt()

This commit is contained in:
uh wot 2021-08-06 20:25:38 +02:00
parent 827da7a0f8
commit a5603af1ed
Signed by: uhwot
GPG Key ID: CB2454984587B781
2 changed files with 5 additions and 5 deletions

4
dist/worker.js vendored

File diff suppressed because one or more lines are too long

View File

@ -27,7 +27,7 @@ async function handler(type, request) {
}
access_token = json.access_token
await KV.put('access_token', access_token, { expirationTtl: Number(json.expires) })
await KV.put('access_token', access_token, { expirationTtl: parseInt(json.expires) })
}
const url = new URL(request.url)
@ -150,7 +150,7 @@ async function track(id, format, access_token, tagging) {
const cipher = new wasm.Cipher(id)
const length = Number(track.headers.get('Content-Length'))
const length = parseInt(track.headers.get('Content-Length'))
pipeDecryptedStream(writer, track.body, length, cipher)
@ -228,7 +228,7 @@ async function m3u8(type, id, format, access_token, tagging) {
if (track.id < 0) { // user-uploaded track
format = 'misc'
}
let result = `https://dz.uhwot.workers.dev/track/${track.id}?f=${format}&t=${Number(tagging)}`
let result = `https://dz.uhwot.workers.dev/track/${track.id}?f=${format}&t=${+ tagging}`
list += `#EXTINF:${track.duration},${track.title}\n${result}\n`
}