2021-03-01 20:58:43 +00:00
|
|
|
import { fetchApi } from '@/utils/api'
|
2020-04-22 20:06:59 +00:00
|
|
|
|
2020-11-28 19:18:35 +00:00
|
|
|
/**
|
|
|
|
* @param {string} url
|
|
|
|
* @param {number} bitrate
|
|
|
|
*/
|
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-03-01 20:58:43 +00:00
|
|
|
fetchApi('addToQueue', { url, bitrate })
|
2020-04-22 20:06:59 +00:00
|
|
|
}
|
|
|
|
|
2020-10-07 18:29:20 +00:00
|
|
|
export function aggregateDownloadLinks(releases) {
|
|
|
|
let links = []
|
|
|
|
|
|
|
|
releases.forEach(release => {
|
|
|
|
links.push(release.link)
|
|
|
|
})
|
|
|
|
|
|
|
|
return links.join(';')
|
|
|
|
}
|