diff --git a/ts/category.ts b/ts/category.ts index 2652ced..c2709d1 100644 --- a/ts/category.ts +++ b/ts/category.ts @@ -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'