Fix game log VIP video play filter

This commit is contained in:
Natsumi
2024-12-12 17:20:51 +13:00
parent ed3cacca6e
commit ff2be48292
2 changed files with 11 additions and 6 deletions

View File

@@ -6091,6 +6091,14 @@ speechSynthesis.getVoices();
$app.methods.setNowPlaying = function (ctx) {
if (this.nowPlaying.url !== ctx.videoUrl) {
if (!ctx.userId && ctx.displayName) {
for (var ref of API.cachedUsers.values()) {
if (ref.displayName === ctx.displayName) {
ctx.userId = ref.id;
break;
}
}
}
this.queueGameLogNoty(ctx);
this.addGameLog(ctx);
database.addGamelogVideoPlayToDatabase(ctx);

View File

@@ -1648,12 +1648,9 @@ class Database {
if (vipList.length > 0) {
vipQuery = 'AND user_id IN (';
vipList.forEach((vip, i) => {
vipQuery += `'${vip.replaceAll("'", "''")}'`;
if (i < vipList.length - 1) {
vipQuery += ', ';
}
vipQuery += `'${vip.replaceAll("'", "''")}', `;
});
vipQuery += ')';
vipQuery += "'')";
}
var location = true;
var onplayerjoined = true;
@@ -1798,7 +1795,7 @@ class Database {
userId: dbRow[7]
};
gamelogDatabase.unshift(row);
}, `SELECT * FROM gamelog_video_play WHERE video_url LIKE '%${search}%' OR video_name LIKE '%${search}%' OR display_name LIKE '%${search}%' ORDER BY id DESC LIMIT ${Database.maxTableSize}`);
}, `SELECT * FROM gamelog_video_play WHERE (video_url LIKE '%${search}%' OR video_name LIKE '%${search}%' OR display_name LIKE '%${search}%') ${vipQuery} ORDER BY id DESC LIMIT ${Database.maxTableSize}`);
}
if (resourceload_string || resourceload_image) {
var checkString = '';