From 663c9e0fa92ad534555bbd57dd02c3d61792463b Mon Sep 17 00:00:00 2001 From: advplyr Date: Thu, 15 Aug 2024 15:54:03 -0500 Subject: [PATCH] Fix podcast filter user permissions query --- server/utils/queries/libraryItemsPodcastFilters.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/utils/queries/libraryItemsPodcastFilters.js b/server/utils/queries/libraryItemsPodcastFilters.js index f629b689..1fe6dbc5 100644 --- a/server/utils/queries/libraryItemsPodcastFilters.js +++ b/server/utils/queries/libraryItemsPodcastFilters.js @@ -20,9 +20,9 @@ module.exports = { if (!user.permissions?.accessAllTags && user.permissions?.itemTagsSelected?.length) { replacements['userTagsSelected'] = user.permissions.itemTagsSelected if (user.permissions.selectedTagsNotAccessible) { - bookWhere.push(Sequelize.where(Sequelize.literal(`(SELECT count(*) FROM json_each(tags) WHERE json_valid(tags) AND json_each.value IN (:userTagsSelected))`), 0)) + podcastWhere.push(Sequelize.where(Sequelize.literal(`(SELECT count(*) FROM json_each(tags) WHERE json_valid(tags) AND json_each.value IN (:userTagsSelected))`), 0)) } else { - bookWhere.push( + podcastWhere.push( Sequelize.where(Sequelize.literal(`(SELECT count(*) FROM json_each(tags) WHERE json_valid(tags) AND json_each.value IN (:userTagsSelected))`), { [Sequelize.Op.gte]: 1 })