* Fixing clip links for individual clips

This commit is contained in:
shockrah 2021-10-12 00:16:27 -07:00
parent 69dfa488d9
commit 574bcc0473

View File

@ -24,8 +24,19 @@ class VideoMeta {
let link = document.createElement('a')
if(this.name) {
link.href = `/category/${this.name}`
link.text = this.name
// remove the .jpg
let fname = this.name.substr(0, this.name.length - 4)
console.log(fname)
const parts = fname.split('.')
const extension = parts[parts.length -1]
if(extension == '.webm') {
fname = fname.substr(0, fname.length - 5)
} else {
fname = fname.substr(0, fname.length - 4)
}
link.href = `/clip/${fname}`
link.text = fname.replace('.', ' ').replace('-', ' ')
} else {
link.href = '#'
link.text = 'this nigga eatin beans'