generate.js: add elonmusk, heavengrips, gangman, wearheadphones, gnuquest

This commit is contained in:
Jon 2022-12-15 13:10:53 +00:00
parent 0e3bdf2783
commit a5222590e9

View File

@ -696,7 +696,56 @@ const mediaItems = [
.addSource(RadioSource.new("audio/mp3", [ "mp3" ]) .addSource(RadioSource.new("audio/mp3", [ "mp3" ])
.setURI("mxc://glowers.club/CIfeVQBVYpBqZRxdVVJWfNJf") .setURI("mxc://glowers.club/CIfeVQBVYpBqZRxdVVJWfNJf")
.addPreview("mxc://glowers.club/NBCRNrPnlJmUwiyCTAvKKkzd", "video/mp4", [ "avc1.4D4029" ], "384x384", EDisplayType.SQUARE) .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)) ].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) { for (const item of mediaItems) {
const hasAudioSource = item.sources.some(a => a.type.startsWith("audio/"))
for (const index in item.sources) { for (const index in item.sources) {
const source = item.sources[index] 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" 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) if (source.codecs?.length)
@ -747,6 +797,8 @@ const radioObj = {
"songs": mediaItems "songs": mediaItems
} }
console.info(`I: Version ${radioObj.version} with ${radioObj.songs.length} entries`)
//console.info(require("util").inspect(mediaItems[0], { colors: true, depth: Infinity })) //console.info(require("util").inspect(mediaItems[0], { colors: true, depth: Infinity }))
fs.writeFileSync("./data/songs.json", JSON.stringify(radioObj)) fs.writeFileSync("./data/songs.json", JSON.stringify(radioObj))
//fs.writeFileSync("./data/songs.js", `glowersRadioSongsCallback(${JSON.stringify(radioObj)})`) //fs.writeFileSync("./data/songs.js", `glowersRadioSongsCallback(${JSON.stringify(radioObj)})`)