Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live release 23 June 2024 #696

Merged
merged 4 commits into from
Jun 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow: /api/replay/*
8 changes: 6 additions & 2 deletions src/api/cups.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,11 @@ const getUnstarted = async () => {

const unlockLevel = async (indices, done) => {
await Level.update(
{ Hidden: indices.ShownTimes ? 0 : 1, Locked: 0, ForceHide: 1 },
{
Hidden: indices.ShownTimes === 1 ? 0 : indices.ShownTimes === 2 ? 2 : 1,
Locked: 0,
ForceHide: 1,
},
{ where: { LevelIndex: indices.LevelIndex } },
);
await SiteCup.update(
Expand Down Expand Up @@ -636,7 +640,7 @@ router
)}:00:00`,
EndTime: `${req.body.EndTime} ${zeroPad(req.body.EndHour, 2)}:00:00`,
Designer: kuski ? kuski.KuskiIndex : 0,
ShownTimes: req.body.ShownTimes,
ShownTimes: req.body.ShownTimes ? 1 : req.body.ShownPositions ? 2 : 0,
AppleResults: req.body.AppleResults,
});
res.json(insert);
Expand Down
4 changes: 2 additions & 2 deletions src/api/level.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ const getLevels = async (
],
[
sequelize.literal(
`(SELECT Time FROM besttime WHERE besttime.LevelIndex = level.LevelIndex AND level.Hidden != 1 ORDER BY Time ASC LIMIT 1)`,
`(SELECT Time FROM besttime WHERE besttime.LevelIndex = level.LevelIndex AND level.Hidden = 0 ORDER BY Time ASC LIMIT 1)`,
),
'Besttime',
],
Expand All @@ -356,7 +356,7 @@ const getLevels = async (
if (UserId > 0) {
attributes.push([
sequelize.literal(
`(SELECT Time FROM besttime WHERE besttime.LevelIndex = level.LevelIndex AND besttime.KuskiIndex = ${UserId} AND level.Hidden != 1)`,
`(SELECT Time FROM besttime WHERE besttime.LevelIndex = level.LevelIndex AND besttime.KuskiIndex = ${UserId} AND level.Hidden = 0)`,
),
'Mytime',
]);
Expand Down
19 changes: 14 additions & 5 deletions src/api/levelpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,18 @@ const getPacksByQuery = async query => {

const getLevelsByQuery = async (query, offset, showLocked, isMod) => {
const LevelName = formatLevelSearch(query);
let where = {
LevelName: {
[Op.like]: `${like(query)}%`,
},
};
if (LevelName !== query) {
where = {
LevelName: {
[Op.or]: [{ [Op.like]: `${like(query)}%` }, { [Op.eq]: LevelName }],
},
};
}
let show = false;
const q = {
attributes: [
Expand All @@ -585,13 +597,10 @@ const getLevelsByQuery = async (query, offset, showLocked, isMod) => {
'AddedBy',
],
offset: searchOffset(offset),
where: {
LevelName: {
[Op.like]: `${like(LevelName)}%`,
},
},
where,
limit: searchLimit(offset),
order: [
[sequelize.literal(`LevelName = ${sequelize.escape(LevelName)} DESC`)],
['LevelName', 'ASC'],
['LevelIndex', 'ASC'],
],
Expand Down
6 changes: 3 additions & 3 deletions src/config.defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ export default {

// Database
mysql: {
host: 'sql-master.elma.online',
port: 3306,
host: 'eol-sql-amd-do-user-3380165-0.c.db.ondigitalocean.com',
port: 25060,
user: 'sandbox',
pass: 'cksnmbmlfchozooqrdxahytwer',
pass: 'AVNS_BMv__q3E57g5owVincz',
database: 'eolwebtest',
},

Expand Down