- Removing old bs that doesn't do anything
* Frontend noow expects the newer endpoints in place
This commit is contained in:
parent
d924c2359a
commit
2f6719081a
@ -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')
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user