forked from jon/glowers-radio
generate.js: remove setDisplayType, not needed anyway
This commit is contained in:
parent
a879706eb0
commit
70c5b09c26
19
generate.js
19
generate.js
@ -65,19 +65,17 @@ const RadioSource = function (type) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
RadioSource.new = type => new RadioSource(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.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))
|
this.previews.push(RadioPreview.new(uri, type, size, displayType))
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
RadioSource.prototype.serialize = function () {
|
RadioSource.prototype.serialize = function () {
|
||||||
const self = this
|
|
||||||
return objSerialize(this, [
|
return objSerialize(this, [
|
||||||
"type",
|
"type",
|
||||||
"uri"
|
"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) {
|
const RadioPreview = function (uri, type, size, displayType=null) {
|
||||||
@ -99,7 +97,6 @@ RadioPreview.prototype.serialize = function (radioSource) {
|
|||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const mediaItems = [
|
const mediaItems = [
|
||||||
|
|
||||||
RadioItem.new("nightinjunitaki")
|
RadioItem.new("nightinjunitaki")
|
||||||
@ -206,8 +203,7 @@ const mediaItems = [
|
|||||||
.setMetadata("Grabbag", "Lee Jackson")
|
.setMetadata("Grabbag", "Lee Jackson")
|
||||||
.addSource(RadioSource.new("audio/mp3")
|
.addSource(RadioSource.new("audio/mp3")
|
||||||
.setURI("mxc://glowers.club/xsuBJwyAUwuDoASbmqjZWrLO")
|
.setURI("mxc://glowers.club/xsuBJwyAUwuDoASbmqjZWrLO")
|
||||||
.addPreview("mxc://glowers.club/ymWgXucYRzhsgdiecjBkFvmz", "image/jpg", "1600x1800")
|
.addPreview("mxc://glowers.club/ymWgXucYRzhsgdiecjBkFvmz", "image/jpg", "1600x1800", EDisplayType.STRETCH)),
|
||||||
.setDisplayType(EDisplayType.STRETCH)),
|
|
||||||
|
|
||||||
RadioItem.new("hyperborea")
|
RadioItem.new("hyperborea")
|
||||||
.setMetadata("Somebody That I Used to Know", "VelvetCasca")
|
.setMetadata("Somebody That I Used to Know", "VelvetCasca")
|
||||||
@ -328,12 +324,10 @@ const mediaItems = [
|
|||||||
.setNiggadata("wishmaster", "570550d318f3c6dc5677b9f6")
|
.setNiggadata("wishmaster", "570550d318f3c6dc5677b9f6")
|
||||||
.addSource(RadioSource.new("audio/mp3")
|
.addSource(RadioSource.new("audio/mp3")
|
||||||
.setURI("mxc://glowers.club/TWmjcXRxqaVOfYnWPItiPAcd")
|
.setURI("mxc://glowers.club/TWmjcXRxqaVOfYnWPItiPAcd")
|
||||||
.addPreview("mxc://glowers.club/OKTbfAlagYXulaeBmgwkNwii", "image/jpg", "352x288")
|
.addPreview("mxc://glowers.club/OKTbfAlagYXulaeBmgwkNwii", "image/jpg", "352x288", EDisplayType.STRETCH))
|
||||||
.setDisplayType(EDisplayType.STRETCH))
|
|
||||||
.addSource(RadioSource.new("audio/ogg")
|
.addSource(RadioSource.new("audio/ogg")
|
||||||
.setURI("mxc://glowers.club/uaxDKxCUtRVXMWAJgoKeiNcJ")
|
.setURI("mxc://glowers.club/uaxDKxCUtRVXMWAJgoKeiNcJ")
|
||||||
.addPreview("mxc://glowers.club/OKTbfAlagYXulaeBmgwkNwii", "image/jpg", "352x288")
|
.addPreview("mxc://glowers.club/OKTbfAlagYXulaeBmgwkNwii", "image/jpg", "352x288", EDisplayType.STRETCH)),
|
||||||
.setDisplayType(EDisplayType.STRETCH)),
|
|
||||||
|
|
||||||
RadioItem.new("negromancy")
|
RadioItem.new("negromancy")
|
||||||
.setMetadata(undefined, undefined, "https://youtu.be/PxjA-jq1e7E")
|
.setMetadata(undefined, undefined, "https://youtu.be/PxjA-jq1e7E")
|
||||||
@ -448,8 +442,7 @@ const mediaItems = [
|
|||||||
.addTags([ "misc" ])
|
.addTags([ "misc" ])
|
||||||
.addSource(RadioSource.new("audio/mp3")
|
.addSource(RadioSource.new("audio/mp3")
|
||||||
.setURI("mxc://glowers.club/SzqNmhQOxaReaTmOegUItcHY")
|
.setURI("mxc://glowers.club/SzqNmhQOxaReaTmOegUItcHY")
|
||||||
.addPreview("mxc://glowers.club/aHWNIqMTUjXZRGZUqZCuOgbi", "image/jpg", "898x480")
|
.addPreview("mxc://glowers.club/aHWNIqMTUjXZRGZUqZCuOgbi", "image/jpg", "898x480", EDisplayType.LANDSCAPE)),
|
||||||
.setDisplayType(EDisplayType.LANDSCAPE)),
|
|
||||||
|
|
||||||
RadioItem.new("whenblackissus")
|
RadioItem.new("whenblackissus")
|
||||||
.setMetadata("Among Us theme song but it's in the style of Metallica's Black Album", "rex", "https://youtu.be/tA2Sr6GgbWo")
|
.setMetadata("Among Us theme song but it's in the style of Metallica's Black Album", "rex", "https://youtu.be/tA2Sr6GgbWo")
|
||||||
|
Loading…
Reference in New Issue
Block a user