deemix-webui/src/utils/downloads.js

22 lines
416 B
JavaScript
Raw Normal View History

2021-02-28 23:01:50 +00:00
import { get } from '@/utils/api'
/**
* @param {string} url
* @param {number} bitrate
*/
export function sendAddToQueue(url, bitrate = null) {
if (!url) throw new Error('No URL given to sendAddToQueue function!')
2021-02-28 23:01:50 +00:00
get('addToQueue', { url, bitrate })
}
export function aggregateDownloadLinks(releases) {
let links = []
releases.forEach(release => {
links.push(release.link)
})
return links.join(';')
}