From a5222590e9748ac7c2283540598d1b96935f1ffa Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 15 Dec 2022 13:10:53 +0000 Subject: [PATCH] generate.js: add elonmusk, heavengrips, gangman, wearheadphones, gnuquest --- generate.js | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 55 insertions(+), 3 deletions(-) diff --git a/generate.js b/generate.js index b1654a4..c6cfd43 100755 --- a/generate.js +++ b/generate.js @@ -696,7 +696,56 @@ const mediaItems = [ .addSource(RadioSource.new("audio/mp3", [ "mp3" ]) .setURI("mxc://glowers.club/CIfeVQBVYpBqZRxdVVJWfNJf") .addPreview("mxc://glowers.club/NBCRNrPnlJmUwiyCTAvKKkzd", "video/mp4", [ "avc1.4D4029" ], "384x384", EDisplayType.SQUARE) - .addPreview("mxc://glowers.club/WBuCuaxhOHahCzgSHrDBnyrV", "image/gif", "384x384", EDisplayType.SQUARE)) + .addPreview("mxc://glowers.club/WBuCuaxhOHahCzgSHrDBnyrV", "image/gif", "384x384", EDisplayType.SQUARE)), + + RadioItem.new("elonmusk") + .setMetadata("Elon Musk", "Kirino Kōsaka", "https://soundcloud.com/kirinokosaka/elon-musk") + .addSource(RadioSource.new("audio/mp3", [ "mp3" ]) + .setURI("mxc://glowers.club/UeZJLHulmquZpzVMDLZJVEHu") + .addPreview("mxc://glowers.club/BCMoaoUANfsbKttHbjbKxHyS", "image/jpg", "500x500")), + + // TODO: Artwork could be better + RadioItem.new("greenday") + .setMetadata("That Hip New Meme Those Boys Are Talking About Today", "Dabunky", "https://soundcloud.com/dabunky/that-hip-new-meme-those-boys-are-talking-about-today") + .addSource(RadioSource.new("audio/mp3", [ "mp3" ]) + .setURI("mxc://glowers.club/ADNlzFLkpvlfUmGULvOfwVLH") + .addPreview("mxc://glowers.club/RhnfTvhvuQNqbqQSZDCYDhOf", "image/jpg", "500x500")), + + RadioItem.new("heavengrips") + .setMetadata("Rhythm Heaven Grips", "Kirino Kōsaka", "https://soundcloud.com/kirinokosaka/rhythm-heaven-grips") + .addSource(RadioSource.new("audio/mp3", [ "mp3" ]) + .setURI("mxc://glowers.club/fDmHjgmrYQcYjIiMIwAjUelF") + .addPreview("mxc://glowers.club/KIqvgGfUnrjGhhapMEWahlHM", "image/jpg", "500x500")), + + // TODO: Artwork could be better. White bordering + RadioItem.new("gangnam") + .setMetadata("now thats what i call murder", "Kirino Kōsaka", "https://soundcloud.com/kirinokosaka/ok-pls-stop") + .addSource(RadioSource.new("audio/mp3", [ "mp3" ]) + .setURI("mxc://glowers.club/qfHznoOiNjEfBjwWzgZJarGL") + .addPreview("mxc://glowers.club/msHrqYpLIReBYqWtcGrizMZy", "image/jpg", "500x500")), + + // TODO: Artwork could be better. White bordering + RadioItem.new("wearheadphones") + .setMetadata("I made this 2 months too late", "~Equalizee", "https://soundcloud.com/djequalizee/i-made-this-2-months-too-late") + .addSource(RadioSource.new("audio/mp3", [ "mp3" ]) + .setURI("mxc://glowers.club/WAPutdfyEeQWvgumweMUMkmx") + .addPreview("mxc://glowers.club/BqLFkwPPXOmpuGapmwBKQYWx", "image/jpg", "500x500")), + + // FIXME: Source is reupload, not original + RadioItem.new("gnuquest") + .setMetadata("GNU/STALLMAN QUEST", undefined, "https://youtu.be/Dn8gealMDsg") + .addSource(RadioSource.new("video/webm", [ "vp9", "vorbis" ]) + .setURI("mxc://glowers.club/PDbLjvNYeRTEpHMnYiGNFNBu") + .addPreview("mxc://glowers.club/BTiOylzdZcWrrxLGuCpQYcMK", "image/jpg", "562x312")) + .addSource(RadioSource.new("video/mp4", [ "avc1.4D4029", "mp4a.40.2" ]) + .setURI("mxc://glowers.club/yVvqUBGrZPxzIylwGXBsZtlw") + .addPreview("mxc://glowers.club/BTiOylzdZcWrrxLGuCpQYcMK", "image/jpg", "562x312")) + .addSource(RadioSource.new("audio/ogg", [ "vorbis" ]) + .setURI("mxc://glowers.club/hsjIhOxVpcHwlaHbmfSKmmrI") + .addPreview("mxc://glowers.club/gGvSqctfUJWHEYxYfbZEwQpn", "image/jpg", "416x416")) + .addSource(RadioSource.new("audio/mp3", [ "mp3" ]) + .setURI("mxc://glowers.club/fJQxNXitNpwnFpnLRWoVBoFN") + .addPreview("mxc://glowers.club/gGvSqctfUJWHEYxYfbZEwQpn", "image/jpg", "416x416")), ].filter(Boolean).map(a => a.serialize()).sort((a,b) => a.id.localeCompare(b.id)) @@ -714,12 +763,13 @@ const lintLikelyCodecs = { } for (const item of mediaItems) { + const hasAudioSource = item.sources.some(a => a.type.startsWith("audio/")) for (const index in item.sources) { const source = item.sources[index] - if (source.type.startsWith("video/") && !source.previews.some(item => item.display_type != EDisplayType.NATIVE)) { + if (!hasAudioSource && source.type.startsWith("video/") && !source.previews.some(item => item.display_type != EDisplayType.NATIVE)) { const logType = item.tags?.includes("misc") ? "warn" :"error" - console.warn(`${logType[0].toUpperCase()}: [codecs] [${item.id}:${index}] No audio fallback preview set!`) + console.warn(`${logType[0].toUpperCase()}: [previews] [${item.id}:${index}] No audio fallback preview set!`) } if (source.codecs?.length) @@ -747,6 +797,8 @@ const radioObj = { "songs": mediaItems } +console.info(`I: Version ${radioObj.version} with ${radioObj.songs.length} entries`) + //console.info(require("util").inspect(mediaItems[0], { colors: true, depth: Infinity })) fs.writeFileSync("./data/songs.json", JSON.stringify(radioObj)) //fs.writeFileSync("./data/songs.js", `glowersRadioSongsCallback(${JSON.stringify(radioObj)})`)