mirror of
https://github.com/alexankitty/Myrient-Search-Engine.git
synced 2026-01-15 16:33:15 -03:00
cleanup
disable new search results when igdb not authorized
This commit is contained in:
@@ -200,7 +200,7 @@ app.get("/search", async function (req, res) {
|
||||
if (settings.combineWith != "AND") {
|
||||
delete settings.combineWith;
|
||||
}
|
||||
let loadOldResults = req.query.old === "true" ? true : false
|
||||
let loadOldResults = req.query.old === "true" || !metadataSearch.authorized ? true : false
|
||||
settings.pageSize = loadOldResults ? 100 : 10;
|
||||
settings.page = pageNum - 1;
|
||||
settings.sort = req.query.o || "";
|
||||
@@ -259,6 +259,7 @@ app.get("/lucky", async function (req, res) {
|
||||
app.get("/settings", function (req, res) {
|
||||
let options = { defaultSettings: defaultSettings };
|
||||
let page = "settings";
|
||||
options.oldSettingsAvailable = metadataSearch.authorized
|
||||
options = buildOptions(page, options);
|
||||
res.render(indexPage, options);
|
||||
});
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
<%= __('settings.extras.hide_non_game.label') %> <i class="bi bi-question-circle" data-toggle="tooltip" data-placement="top" title="<%= __('settings.extras.hide_non_game.tooltip') %>"></i>
|
||||
</label>
|
||||
<label class="checkbox-inline p-1">
|
||||
<input type="checkbox" id="useOldResults" value="true">
|
||||
<input type="checkbox" id="useOldResults" value="true" <%= oldSettingsAvailable ? '' : 'disabled=""' %>">
|
||||
<%= __('settings.extras.use_old_results.label') %> <i class="bi bi-question-circle" data-toggle="tooltip" data-placement="top" title="<%= __('settings.extras.use_old_results.tooltip') %>"></i>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 9.9 KiB |
@@ -1,32 +0,0 @@
|
||||
// index.js
|
||||
const videos = [];
|
||||
const tag = document.createElement("script");
|
||||
const firstScriptTag = document.getElementsByTagName("script")[0];
|
||||
|
||||
tag.src = "https://www.youtube.com/iframe_api";
|
||||
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
|
||||
|
||||
// YouTube wants this function, don't rename it
|
||||
function onYouTubeIframeAPIReady() {
|
||||
const slides = Array.from(document.querySelectorAll(".carousel-item"));
|
||||
slides.forEach((slide, index) => {
|
||||
// does this slide have a video?
|
||||
const video = slide.querySelector(".video-player");
|
||||
if (video && video.dataset) {
|
||||
const player = createPlayer({
|
||||
id: video.id,
|
||||
videoId: video.dataset.videoId,
|
||||
});
|
||||
videos.push({ player, index });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function createPlayer(playerInfo) {
|
||||
return new YT.Player(playerInfo.id, {
|
||||
videoId: playerInfo.videoId,
|
||||
playerVars: {
|
||||
showinfo: 0,
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user