another possible fix for fav randoming
This commit is contained in:
@@ -381,7 +381,7 @@ window.requestAnimFrame = (function () {
|
||||
const wUserMatch = window.location.href.match(/\/user\/([^/]+)/);
|
||||
if (wUserMatch) {
|
||||
params.append('user', decodeURIComponent(wUserMatch[1]));
|
||||
if (window.location.href.includes('/favs/')) {
|
||||
if (window.location.href.match(/\/favs(\/|$|\?)/)) {
|
||||
params.append('fav', 'true');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,8 @@ export default router => {
|
||||
const hasSession = !!req.session;
|
||||
const modequery = mime.startsWith("audio") ? lib.getMode(0) : lib.getMode(req.session?.mode ?? 0);
|
||||
|
||||
console.log('[RANDOM DEBUG] hasSession:', hasSession, 'globalfilter:', globalfilter, 'modequery:', modequery, 'isFav:', isFav);
|
||||
|
||||
const rows = await db`
|
||||
select "items".*
|
||||
from "items"
|
||||
@@ -45,6 +47,8 @@ export default router => {
|
||||
limit 1
|
||||
`;
|
||||
|
||||
console.log('[RANDOM DEBUG] Result item id:', rows[0]?.id);
|
||||
|
||||
return res.json({
|
||||
success: rows.length > 0,
|
||||
items: rows.length > 0 ? rows[0] : []
|
||||
|
||||
Reference in New Issue
Block a user