Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Do not automatically include the preview URL into the list of downloa…
Browse files Browse the repository at this point in the history
…d formats (#627)
  • Loading branch information
sarayourfriend authored Jan 18, 2022
1 parent be9dcf6 commit f974ac3
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/components/VAudioTrack/layouts/VFullLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,25 +89,27 @@ export default defineComponent({
/**
* Creates a list of { extension_name, download_url } objects
* for DownloadButton
* for DownloadButton.
*
* If there are `alt_files` then just use that list. Otherwise,
* create one using the preview URL.
*
* @param {AudioDetail} audio
*/
const getFormats = (audio) => {
let formats = [
if (audio.alt_files?.length) {
return audio.alt_files.map((altFile) => ({
extension_name: displayFormat(audio.provider, altFile.filetype),
download_url: altFile.url,
}))
}
return [
{
extension_name: displayFormat(audio.provider, audio.filetype),
download_url: audio.url,
},
]
if (audio.alt_files) {
formats = formats.concat(
audio.alt_files.map((altFile) => ({
extension_name: displayFormat(audio.provider, altFile.filetype),
download_url: altFile.url,
}))
)
}
return formats
}
const isSmall = computed(() => props.size === 's')
Expand Down

0 comments on commit f974ac3

Please sign in to comment.