From 3686a0175d88d37d0f0d3aa67ab5aad1809700e3 Mon Sep 17 00:00:00 2001 From: ltctceplrm <14954927+ltctceplrm@users.noreply.github.com> Date: Sat, 25 Oct 2025 17:41:38 +0200 Subject: [PATCH] Added series title in the season selection modal --- src/main.ts | 4 +++- src/modals/MediaDbSeasonSelectModal.ts | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main.ts b/src/main.ts index ffb6ed7..323d00c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -248,13 +248,15 @@ export default class MediaDbPlugin extends Plugin { new Notice('No seasons found for this series.'); return; } + // Pass the original series title from the search result + const seriesName = selectResults[0]?.englishTitle || selectResults[0]?.title || ''; const modal = new MediaDbSeasonSelectModal(this, allSeasons.map(s => ({ season_number: s.seasonNumber, name: s.seasonTitle || s.title, episode_count: s.episodes || 0, air_date: s.year, poster_path: s.image, - })), true); + })), true, seriesName); const selectedSeasons: any[] = await new Promise(resolve => { modal.setSubmitCallback(resolve); modal.open(); diff --git a/src/modals/MediaDbSeasonSelectModal.ts b/src/modals/MediaDbSeasonSelectModal.ts index 2490e67..1bde2d7 100644 --- a/src/modals/MediaDbSeasonSelectModal.ts +++ b/src/modals/MediaDbSeasonSelectModal.ts @@ -12,11 +12,13 @@ export class MediaDbSeasonSelectModal extends SelectModal void; closeCallback?: (err?: Error) => void; + seriesName?: string; - constructor(plugin: MediaDbPlugin, seasons: SeasonSelectModalElement[], multiSelect = true) { + constructor(plugin: MediaDbPlugin, seasons: SeasonSelectModalElement[], multiSelect = true, seriesName?: string) { super(plugin.app, seasons, multiSelect); this.plugin = plugin; - this.title = 'Select Season(s)'; + this.seriesName = seriesName; + this.title = `Select Season(s) for${seriesName ? `: ${seriesName}` : ''}`; this.description = 'Select one or more seasons to create notes for.'; }