diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index ef3a430..aa770c9 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -2031,7 +2031,6 @@ dependencies = [ "serde", "serde_json", "sha2 0.10.9", - "url", "web-time", ] diff --git a/src/core/coreMethods.ts b/src/core/coreMethods.ts index 74516db..8842c3c 100644 --- a/src/core/coreMethods.ts +++ b/src/core/coreMethods.ts @@ -49,7 +49,6 @@ export const CORE_METHODS = [ 'createProfilePlan', 'curateHomeItems', 'dataFailurePolicy', - 'desktopCalendarNotificationPlan', 'desktopCalendarReadPlan', 'detailEpisodePlan', 'detailSeasonLoadPlan', diff --git a/src/core/effectRunner.ts b/src/core/effectRunner.ts index d03aa30..59cc818 100644 --- a/src/core/effectRunner.ts +++ b/src/core/effectRunner.ts @@ -107,8 +107,8 @@ async function deriveNextProgressFromLastWatched(metaObj: Record): Promise { const items = (payload.items as Array> | undefined) ?? []; const todayIso = new Date().toISOString().slice(0, 10); - const plan = await coreInvoke<{ items: Array>; notifiedIds: string[] }>('desktopCalendarNotificationPlan', JSON.stringify({ - items, + const plan = await coreInvoke<{ items: Array>; storedKeys: string[] }>('calendarNotificationContent', JSON.stringify({ + items: items.map((item) => ({ + ...item, + dateIso: String(item.dateIso ?? '').slice(0, 10), + metaId: item.contentId ?? item.seriesId ?? item.metaId ?? item.id, + metaType: item.metaType ?? item.type ?? 'series', + artworkUrl: item.artworkUrl ?? item.poster, + })), todayIso, - notifiedIds: (await storageRead(NOTIFIED_EPISODES_KEY)) ?? [], - limit: 500, + alreadyNotifiedKeys: (await storageRead(NOTIFIED_EPISODES_KEY)) ?? [], + profileId: await storageRead('active_profile_id'), + notificationsEnabled: true, + alertNewEpisodes: true, + maxStoredKeys: 500, })); if (!plan?.items.length) return; @@ -149,7 +158,7 @@ export async function notifyReleasedEpisodes(payload: Record): const body = (item.episodeTitle as string | undefined) ?? (item.subtitle as string | undefined); void notify(t('notifications.new_episode_title', item.title as string), body); } - await storageWrite(NOTIFIED_EPISODES_KEY, plan.notifiedIds); + await storageWrite(NOTIFIED_EPISODES_KEY, plan.storedKeys); } export async function applyLibraryCommand(payload: Record): Promise {