From 70c5b09c265ed5cf415342b117c1e08dceb74c6f Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 8 Dec 2022 14:39:35 +0000 Subject: [PATCH] generate.js: remove setDisplayType, not needed anyway --- generate.js | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/generate.js b/generate.js index 24bf103..1d2dbaf 100755 --- a/generate.js +++ b/generate.js @@ -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")