From 2f6719081a3cefb9a0100fdacba8598c3b1081a3 Mon Sep 17 00:00:00 2001 From: shockrah Date: Tue, 12 Oct 2021 22:51:47 -0700 Subject: [PATCH] - Removing old bs that doesn't do anything * Frontend noow expects the newer endpoints in place --- ts/category.ts | 37 +++++++------------------------------ 1 file changed, 7 insertions(+), 30 deletions(-) diff --git a/ts/category.ts b/ts/category.ts index c2709d1..2dfc975 100644 --- a/ts/category.ts +++ b/ts/category.ts @@ -1,22 +1,10 @@ class VideoMeta { name: string|null - mime_type: string|null - thumbnail_b64: string|null + thumbnail: string|null constructor(raw: any) { this.name = raw['name'] - if(this.name) { - const parts = this.name.split('.') - const extension = parts[parts.length - 1] - if(extension == 'jpg') { - this.mime_type = 'image/jpg' - } else { - this.mime_type = null - } - } else { - this.mime_type = null - } - this.thumbnail_b64 = raw['thumbnail'] + this.thumbnail = raw['thumbnail'] } title_link() : HTMLHeadingElement { @@ -24,22 +12,11 @@ class VideoMeta { let link = document.createElement('a') if(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('-', ' ') + link.href = `/clip/${this.name}` + link.text = this.name.replace('.', ' ').replace('-', ' ') } else { link.href = '#' - link.text = 'this nigga eatin beans' + link.text = this.name + 'ft. No thumbnail' } container.appendChild(link) @@ -53,8 +30,8 @@ class VideoMeta { nail.className = 'pure-img' // Modern browser's should be able to cache this request - if(!(this.thumbnail_b64 == null || this.thumbnail_b64.length == 0)) { - nail.setAttribute('src', `data:image/jpg;base64,${this.thumbnail_b64}`) + if(!(this.thumbnail == null || this.thumbnail.length == 0)) { + nail.setAttribute('src', this.thumbnail) } else{ nail.setAttribute('src', '/cantfindshit.gif') }