debug(sync): diag inclut la chaîne mine=true (id+titre) pour comparaison

This commit is contained in:
2026-09-27 09:01:06 -04:00
parent fdb5a48023
commit a3d29fe3cd
2 changed files with 18 additions and 1 deletions
+12
View File
@@ -347,6 +347,18 @@ async function googleApiPost(accessToken, path, body) {
return data;
}
/** Chaîne résolue par `mine=true` pour ce token (id + titre, pour comparer). */
export async function fetchMineChannel(accessToken) {
const data = await googleApiGet(accessToken, 'channels', { part: 'id,snippet,contentDetails', mine: 'true' });
const item = Array.isArray(data?.items) ? data.items[0] : null;
if (!item) return { id: null, title: null, relatedKeys: [] };
return {
id: item.id || null,
title: item.snippet?.title || null,
relatedKeys: Object.keys(item?.contentDetails?.relatedPlaylists || {}),
};
}
/** ID de la playlist "Regarder plus tard" du compte (lecture seule OK). */
export async function fetchGoogleWatchLaterId(accessToken) {
const data = await googleApiGet(accessToken, 'channels', { part: 'contentDetails', mine: 'true' });