From 6c49bc6bf4e062e1a51cc528e2b5d7b4b4696f47 Mon Sep 17 00:00:00 2001 From: pjft Date: Mon, 14 Dec 2020 18:02:12 +0000 Subject: [PATCH] Update deleteTTPTags query It didn't seem to be doing what we wanted to? We're feeding it a tags.id as an argument, but then in the query we're comparing it to the metadata_item_id which, at least for me, never produced any hits? Can you verify this code? Thanks. --- plex.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plex.js b/plex.js index 63c362c..41355eb 100644 --- a/plex.js +++ b/plex.js @@ -82,7 +82,7 @@ function getPhotoLibraryId() { function getTTPTags(mid) { let sql = `SELECT A.id as tid,B.tag as tag FROM taggings as A, tags as B - WHERE A.metadata_item_id = ? + WHERE B.id = ? AND A.tag_id = B.id AND B.tag_type = 0 AND B.extra_data='TTP'`; @@ -451,4 +451,4 @@ module.exports = { deleteAllPlaceTags: deleteAllPlaceTags, addPlaceTags: addPlaceTags, updatePlaceImageTimestamp: updatePlaceImageTimestamp -}; \ No newline at end of file +};