refacto: move size to computed values
All checks were successful
repod / xml (push) Successful in 17s
repod / php (push) Successful in 57s
repod / nodejs (push) Successful in 2m1s
repod / release (push) Has been skipped

This commit is contained in:
Michel Roux 2024-01-14 00:33:40 +01:00
parent 1c566b19cb
commit 6b6d21fa2f

View File

@ -22,7 +22,7 @@
<template #icon> <template #icon>
<Download :size="20" /> <Download :size="20" />
</template> </template>
{{ t('repod', 'Download') }} {{ size ? `(${humanFileSize(size)})` : '' }} {{ t('repod', 'Download') }} {{ size ? `(${episodeFileSize})` : '' }}
</NcButton> </NcButton>
</div> </div>
</div> </div>
@ -73,6 +73,9 @@ export default {
}, },
}, },
computed: { computed: {
episodeFileSize() {
return humanFileSize(this.size)
},
strippedDescription() { strippedDescription() {
const pre = document.createElement('pre') const pre = document.createElement('pre')
pre.innerHTML = this.description pre.innerHTML = this.description
@ -80,9 +83,6 @@ export default {
return strippedDescription.replace(/\n/g, '<br>') return strippedDescription.replace(/\n/g, '<br>')
}, },
}, },
methods: {
humanFileSize,
},
} }
</script> </script>