whoops i spilled my pink paint all over those nong songs

This commit is contained in:
GDColon 2021-01-27 19:56:22 -05:00
parent 9affb9b74f
commit 1c85b59d4d
9 changed files with 22 additions and 8 deletions

View file

@ -61,6 +61,7 @@ module.exports = async (app, req, res, api, ID, analyze) => {
level.songAuthor = songData[4] || "Unknown"
level.songSize = (songData[5] || "0") + "MB"
level.songID = songData[1] || String(level.customSong)
if (songData[10]) level.songLink = decodeURIComponent(songData[10])
if (!songData[2]) level.invalidSong = true
}

View file

@ -26,7 +26,9 @@ module.exports = async (app, req, res, post) => {
let cellIndex = type == "demons" ? 2 : type == "coins" ? 1 : 0
if (modMode) cellIndex += 3
let leaderboard = JSON.parse(tab.getCell(1, cellIndex).value)
let cell = tab.getCell(1, cellIndex).value
if (cell.startsWith("GoogleSpreadsheetFormulaError")) return res.send("-1")
let leaderboard = JSON.parse(cell)
let gdFormatting = ""
leaderboard.forEach(x => {

View file

@ -40,6 +40,7 @@ module.exports = async (app, req, res, api, analyze) => {
level.songAuthor = song[4] || "Unknown"
level.songSize = (song[5] || "0") + "MB"
level.songID = song[1] || String(level.customSong)
if (song[10]) level.songLink = decodeURIComponent(song[10])
}
else {

View file

@ -127,6 +127,7 @@ module.exports = async (app, req, res) => {
level.songAuthor = songSearch[4] || "Unknown"
level.songSize = (songSearch[5] || "0") + "MB"
level.songID = songSearch[1] || level.customSong
if (songSearch[10]) level.songLink = decodeURIComponent(songSearch[10])
}
else {
let foundSong = require('../misc/level.json').music[parseInt(x[12]) + 1] || {"null": true}

View file

@ -1197,6 +1197,10 @@ input::-webkit-inner-spin-button {
color: #FF82FF;
}
.nong {
color: #FFAABE;
}
.blue {
color: #27CEFA;
}

View file

@ -114,7 +114,7 @@
</div>
<br>
<p class="reveal" onclick="$('#response-level').slideToggle(100);"><b>Response (46)</b></p>
<p class="reveal" onclick="$('#response-level').slideToggle(100);"><b>Response (47)</b></p>
<div class="subdiv" id="response-level">
<p class="br">*Values that require a download are in <span style="color:red">red</span> and values that only work with daily/weekly levels are <span style="color:#00abee">blue</span></p>
<p>name: The name of the level</p>
@ -150,6 +150,7 @@
<p>songAuthor: The name of the author of said song</p>
<p>songSize: The size of the song in megabytes, if a custom song was used</p>
<p>songID: The ID of the song (again). If a non-custom song was used, this will return a string with the level number of the song</p>
<p>songLink: The link to the raw MP3 of the song, if available</p>
<p>demonList: The level's position on the Demon List (Pointercrate). Extreme demons only</p>
<p class="red">uploaded: Time since the level was uploaded (sent as "x days/weeks/months" ago, since it's all the API sends)</p>
<p class="red">updated: Time since the level was last updated</p>

View file

@ -263,8 +263,10 @@ if ("[[SONGID]]".startsWith("Level")) {
else $('#checkSong').show()
if (!"[[GDPS]]".startsWith("[")) {
$('#playSong').hide()
$('#moreSongs').hide()
if (!("[[SONGLINK]]").match(/^https?:\/\/\audio\.ngfiles\.com\//)) {
$('#playSong').hide()
$('#moreSongs').hide()
}
$('#leaderboardbtn').hide()
$('#checkSong').remove()
}

View file

@ -1,7 +1,7 @@
<head>
<title id="tabTitle">Level Search</title>
<meta charset="utf-8">
<link href="../assets/css/browser.css" type="text/css" rel="stylesheet">
<link href="../assets/css/browser.css?" type="text/css" rel="stylesheet">
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-135255146-3"></script><script>window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'UA-135255146-3');</script>
<link rel="icon" href="../assets/coin.png">
<meta id="meta-title" property="og:title" content="Level Search">
@ -187,13 +187,15 @@ function Append(firstLoad) {
accID = x.playerID
}
let noLink = gdps || !x.customSong
let filteredSong = x.songName.replace(/[^ -~]/g, "")
if (!filteredSong) filteredSong = x.songName
let songColor = x.customSong == 0 ? "blue" : (x.songLink && !x.songLink.match(/^https?:\/\/\audio\.ngfiles\.com\//)) ? "nong" : "whatIfItWasPurple"
let noLink = songColor != "whatIfItWasPurple"
$('#searchBox').append(`<div class="searchresult" title="${clean(x.description)}">
<h1 class="help lessspaced pre" title="${x.name} (${x.id})" style="width: fit-content; padding-right: 1%">${x.name}</h1>
<h2 class="lessSpaced pre smaller inline gdButton help ${hasAuthor ? "" : "green unregistered"}" title="Account ID: ${x.accountID}\nPlayer ID: ${x.playerID}">${hasAuthor && !onePointNine ? `<a href="../u/${x.author}">By ${x.author || "-"}</a>` : `<a ${userSearch ? "" : `href="../search/${x.playerID}?user"`}>By ${x.author || "-"}</a>`}</h2><h2 class="inline" style="margin-left: 1.5%; transform:translateY(30%)"> ${x.copiedID == '0' ? "" : `<a target="_blank" href="../${x.copiedID}"><img class="gdButton valign sideSpace" title="Original: ${x.copiedID}" src="../assets/copied.png" height="12%"></a>`}${x.large ? `<img class="help valign sideSpaceD" title="${x.objects}${x.objects == 65535 ? "+" : ""} objects" src="../assets/large.png" height="12%">` : ''}</h2>
<h3 class="lessSpaced help ${noLink ? "" : 'gdButton '}pre ${x.customSong == 0 ? "blue" : "whatIfItWasPurple"}" title="${filteredSong} by ${x.songAuthor} (${x.songID})" style="overflow: hidden; max-height: 19%; width: fit-content">${noLink ? filteredSong : `<a target="_blank" style="width: fit-content" href="https://www.newgrounds.com/audio/listen/${x.songID}">${filteredSong}</a>`}</h3>
<h3 class="lessSpaced help ${noLink ? "" : 'gdButton '}pre ${songColor}" title="${filteredSong} by ${x.songAuthor} (${x.songID})" style="overflow: hidden; max-height: 19%; width: fit-content">${noLink ? filteredSong : `<a target="_blank" style="width: fit-content" href="https://www.newgrounds.com/audio/listen/${x.songID}">${filteredSong}</a>`}</h3>
<h3 class="lessSpaced" style="width: fit-content" title="">
<img class="help valign" title="Length" src="../assets/time.png" height="14%"> ${x.length}
<img class="help valign" title="Downloads" src="../assets/download.png" height="14%"> ${x.downloads}

View file

@ -120,7 +120,7 @@ app.timeSince = function(id, time) {
}
app.userCache = function(id, accountID, playerID, name) {
if (!app.config.cacheAccountIDs) return
if (!accountID || !app.config.cacheAccountIDs) return
if (!playerID) return app.accountCache[id][accountID.toLowerCase()]
let cacheStuff = [accountID, playerID, name]
app.accountCache[id][name.toLowerCase()] = cacheStuff