2021-05-13 16:16:11 +00:00
|
|
|
import { fetchData } from '@/utils/api'
|
2020-04-22 20:06:59 +00:00
|
|
|
|
2020-11-28 19:18:35 +00:00
|
|
|
/**
|
|
|
|
* @param {string} url
|
2021-03-01 21:32:35 +00:00
|
|
|
* @param {number|null} bitrate
|
2020-11-28 19:18:35 +00:00
|
|
|
*/
|
2020-09-17 16:11:41 +00:00
|
|
|
export function sendAddToQueue(url, bitrate = null) {
|
2020-10-07 18:29:20 +00:00
|
|
|
if (!url) throw new Error('No URL given to sendAddToQueue function!')
|
2020-08-11 19:12:47 +00:00
|
|
|
|
2021-05-13 16:16:11 +00:00
|
|
|
fetchData('addToQueue', { url, bitrate }, 'POST')
|
2020-04-22 20:06:59 +00:00
|
|
|
}
|
|
|
|
|
2020-10-07 18:29:20 +00:00
|
|
|
export function aggregateDownloadLinks(releases) {
|
2021-05-23 16:46:03 +00:00
|
|
|
const links = []
|
2020-10-07 18:29:20 +00:00
|
|
|
|
|
|
|
releases.forEach(release => {
|
|
|
|
links.push(release.link)
|
|
|
|
})
|
|
|
|
|
|
|
|
return links.join(';')
|
|
|
|
}
|