generate.js: remove setDisplayType, not needed anyway

This commit is contained in:
Jon 2022-12-08 14:39:35 +00:00
parent a879706eb0
commit 70c5b09c26

View File

@ -65,19 +65,17 @@ const RadioSource = function (type) {
}
RadioSource.new = type => new RadioSource(type)
RadioSource.prototype.setDisplayType = function (display_type) { this.display_type = display_type; return this }
RadioSource.prototype.setURI = function (uri) { this.uri = uri; return this }
RadioSource.prototype.addPreview = function (uri, type, size, displayType=null) {
RadioSource.prototype.addPreview = function (uri, type, size, displayType) {
this.previews.push(RadioPreview.new(uri, type, size, displayType))
return this
}
RadioSource.prototype.serialize = function () {
const self = this
return objSerialize(this, [
"type",
"uri"
], obj => ({ ...obj, "previews": this.previews.map(preview => preview.serialize(self)) }))
], obj => ({ ...obj, "previews": this.previews.map(preview => preview.serialize(obj)) }))
}
const RadioPreview = function (uri, type, size, displayType=null) {
@ -99,7 +97,6 @@ RadioPreview.prototype.serialize = function (radioSource) {
])
}
const mediaItems = [
RadioItem.new("nightinjunitaki")
@ -206,8 +203,7 @@ const mediaItems = [
.setMetadata("Grabbag", "Lee Jackson")
.addSource(RadioSource.new("audio/mp3")
.setURI("mxc://glowers.club/xsuBJwyAUwuDoASbmqjZWrLO")
.addPreview("mxc://glowers.club/ymWgXucYRzhsgdiecjBkFvmz", "image/jpg", "1600x1800")
.setDisplayType(EDisplayType.STRETCH)),
.addPreview("mxc://glowers.club/ymWgXucYRzhsgdiecjBkFvmz", "image/jpg", "1600x1800", EDisplayType.STRETCH)),
RadioItem.new("hyperborea")
.setMetadata("Somebody That I Used to Know", "VelvetCasca")
@ -328,12 +324,10 @@ const mediaItems = [
.setNiggadata("wishmaster", "570550d318f3c6dc5677b9f6")
.addSource(RadioSource.new("audio/mp3")
.setURI("mxc://glowers.club/TWmjcXRxqaVOfYnWPItiPAcd")
.addPreview("mxc://glowers.club/OKTbfAlagYXulaeBmgwkNwii", "image/jpg", "352x288")
.setDisplayType(EDisplayType.STRETCH))
.addPreview("mxc://glowers.club/OKTbfAlagYXulaeBmgwkNwii", "image/jpg", "352x288", EDisplayType.STRETCH))
.addSource(RadioSource.new("audio/ogg")
.setURI("mxc://glowers.club/uaxDKxCUtRVXMWAJgoKeiNcJ")
.addPreview("mxc://glowers.club/OKTbfAlagYXulaeBmgwkNwii", "image/jpg", "352x288")
.setDisplayType(EDisplayType.STRETCH)),
.addPreview("mxc://glowers.club/OKTbfAlagYXulaeBmgwkNwii", "image/jpg", "352x288", EDisplayType.STRETCH)),
RadioItem.new("negromancy")
.setMetadata(undefined, undefined, "https://youtu.be/PxjA-jq1e7E")
@ -448,8 +442,7 @@ const mediaItems = [
.addTags([ "misc" ])
.addSource(RadioSource.new("audio/mp3")
.setURI("mxc://glowers.club/SzqNmhQOxaReaTmOegUItcHY")
.addPreview("mxc://glowers.club/aHWNIqMTUjXZRGZUqZCuOgbi", "image/jpg", "898x480")
.setDisplayType(EDisplayType.LANDSCAPE)),
.addPreview("mxc://glowers.club/aHWNIqMTUjXZRGZUqZCuOgbi", "image/jpg", "898x480", EDisplayType.LANDSCAPE)),
RadioItem.new("whenblackissus")
.setMetadata("Among Us theme song but it's in the style of Metallica's Black Album", "rex", "https://youtu.be/tA2Sr6GgbWo")