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
|
|
|
}
|
|
|
|
|
2021-06-02 15:28:45 +00:00
|
|
|
/**
|
|
|
|
* @param {{ link: string }[]} releases
|
|
|
|
* @returns {string}
|
|
|
|
*/
|
2020-10-07 18:29:20 +00:00
|
|
|
export function aggregateDownloadLinks(releases) {
|
2021-06-02 15:28:45 +00:00
|
|
|
const links = releases.map(release => release.link)
|
2020-10-07 18:29:20 +00:00
|
|
|
|
|
|
|
return links.join(';')
|
|
|
|
}
|