- 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 {
|
class VideoMeta {
|
||||||
name: string|null
|
name: string|null
|
||||||
mime_type: string|null
|
thumbnail: string|null
|
||||||
thumbnail_b64: string|null
|
|
||||||
|
|
||||||
constructor(raw: any) {
|
constructor(raw: any) {
|
||||||
this.name = raw['name']
|
this.name = raw['name']
|
||||||
if(this.name) {
|
this.thumbnail = raw['thumbnail']
|
||||||
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']
|
|
||||||
}
|
}
|
||||||
|
|
||||||
title_link() : HTMLHeadingElement {
|
title_link() : HTMLHeadingElement {
|
||||||
@ -24,22 +12,11 @@ class VideoMeta {
|
|||||||
|
|
||||||
let link = document.createElement('a')
|
let link = document.createElement('a')
|
||||||
if(this.name) {
|
if(this.name) {
|
||||||
// remove the .jpg
|
link.href = `/clip/${this.name}`
|
||||||
let fname = this.name.substr(0, this.name.length - 4)
|
link.text = this.name.replace('.', ' ').replace('-', ' ')
|
||||||
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 {
|
} else {
|
||||||
link.href = '#'
|
link.href = '#'
|
||||||
link.text = 'this nigga eatin beans'
|
link.text = this.name + 'ft. No thumbnail'
|
||||||
}
|
}
|
||||||
|
|
||||||
container.appendChild(link)
|
container.appendChild(link)
|
||||||
@ -53,8 +30,8 @@ class VideoMeta {
|
|||||||
nail.className = 'pure-img'
|
nail.className = 'pure-img'
|
||||||
|
|
||||||
// Modern browser's should be able to cache this request
|
// Modern browser's should be able to cache this request
|
||||||
if(!(this.thumbnail_b64 == null || this.thumbnail_b64.length == 0)) {
|
if(!(this.thumbnail == null || this.thumbnail.length == 0)) {
|
||||||
nail.setAttribute('src', `data:image/jpg;base64,${this.thumbnail_b64}`)
|
nail.setAttribute('src', this.thumbnail)
|
||||||
} else{
|
} else{
|
||||||
nail.setAttribute('src', '/cantfindshit.gif')
|
nail.setAttribute('src', '/cantfindshit.gif')
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user