From 0bccd4fea54748def257bb88565d63bdb728f9ee Mon Sep 17 00:00:00 2001 From: Samidy Date: Mon, 9 Feb 2026 18:38:18 +0300 Subject: [PATCH] fix(Accounts): fix public playlists not updating after first set --- js/accounts/pocketbase.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/js/accounts/pocketbase.js b/js/accounts/pocketbase.js index 59782d3..727e0d1 100644 --- a/js/accounts/pocketbase.js +++ b/js/accounts/pocketbase.js @@ -377,6 +377,7 @@ const syncManager = { const data = { uuid: playlist.id, uid: uid, + firebase_id: uid, title: playlist.name, name: playlist.name, playlist_name: playlist.name, @@ -398,9 +399,9 @@ const syncManager = { }); if (existing.items.length > 0) { - await this.pb.collection(PUBLIC_COLLECTION).update(existing.items[0].id, data); + await this.pb.collection(PUBLIC_COLLECTION).update(existing.items[0].id, data, { f_id: uid }); } else { - await this.pb.collection(PUBLIC_COLLECTION).create(data); + await this.pb.collection(PUBLIC_COLLECTION).create(data, { f_id: uid }); } } catch (error) { console.error('Failed to publish playlist:', error); @@ -412,13 +413,13 @@ const syncManager = { if (!uid) return; try { - const existing = await this.pb.collection('public_playlists').getList(1, 1, { + const existing = await this.pb.collection(PUBLIC_COLLECTION).getList(1, 1, { filter: `uuid="${uuid}"`, p_id: uuid, }); if (existing.items && existing.items.length > 0) { - await this.pb.collection('public_playlists').delete(existing.items[0].id, { p_id: uuid }); + await this.pb.collection(PUBLIC_COLLECTION).delete(existing.items[0].id, { p_id: uuid, f_id: uid }); } } catch (error) { console.error('Failed to unpublish playlist:', error);