Commit 281a4cf7 authored by nanahira's avatar nanahira

Merge branch 'database' into databasen

parents aae34169 ac56014b
Pipeline #1225 passed with stage
in 9 minutes and 21 seconds
......@@ -103,10 +103,11 @@ export class DataManager {
.from(CloudReplay, "replay")
.getRawOne()
));
if(!minQuery || maxQuery) {
if(!minQuery || !maxQuery) {
return null;
}
const targetId = Math.floor((maxQuery.value - minQuery.value) * Math.random()) + minQuery.value;
const [maxId, minId] = [minQuery, maxQuery].map(query => parseInt(query.value));
const targetId = Math.floor((maxId - minId) * Math.random()) + minId;
return await this.db.createQueryBuilder(CloudReplay, "replay")
.where("replay.id >= :targetId", {targetId})
.orderBy("replay.id", "ASC")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment