Ran prettier

This commit is contained in:
ltctceplrm 2025-12-09 21:16:53 +01:00
parent bd2b84bbce
commit 35ea3cbb22
2 changed files with 28 additions and 21 deletions

View file

@ -69,7 +69,7 @@ export class TMDBSeasonAPI extends APIModel {
id: result.id.toString(), id: result.id.toString(),
seasonTitle: result.name ?? result.original_name ?? '', seasonTitle: result.name ?? result.original_name ?? '',
seasonNumber: totalSeasons, seasonNumber: totalSeasons,
}) }),
); );
} }
@ -105,7 +105,7 @@ export class TMDBSeasonAPI extends APIModel {
id: `${tvId}/season/${seasonNumber}`, id: `${tvId}/season/${seasonNumber}`,
seasonTitle: season.name ?? titleText, seasonTitle: season.name ?? titleText,
seasonNumber: seasonNumber, seasonNumber: seasonNumber,
}) }),
); );
} }
} }

View file

@ -250,13 +250,18 @@ export default class MediaDbPlugin extends Plugin {
} }
// Pass the original series title from the search result // Pass the original series title from the search result
const seriesName = selectResults[0]?.englishTitle || selectResults[0]?.title || ''; const seriesName = selectResults[0]?.englishTitle || selectResults[0]?.title || '';
const modal = new MediaDbSeasonSelectModal(this, allSeasons.map(s => ({ const modal = new MediaDbSeasonSelectModal(
this,
allSeasons.map(s => ({
season_number: s.seasonNumber, season_number: s.seasonNumber,
name: s.seasonTitle || s.title, name: s.seasonTitle || s.title,
episode_count: s.episodes || 0, episode_count: s.episodes || 0,
air_date: s.year, air_date: s.year,
poster_path: s.image, poster_path: s.image,
})), true, seriesName); })),
true,
seriesName,
);
const selectedSeasons: any[] = await new Promise(resolve => { const selectedSeasons: any[] = await new Promise(resolve => {
modal.setSubmitCallback(resolve); modal.setSubmitCallback(resolve);
modal.open(); modal.open();
@ -265,7 +270,8 @@ export default class MediaDbPlugin extends Plugin {
return; return;
} }
// Fetch full metadata for each selected seasond and create the note // Fetch full metadata for each selected seasond and create the note
await Promise.all(selectedSeasons.map(async season => { await Promise.all(
selectedSeasons.map(async season => {
const orig = allSeasons.find(s => s.seasonNumber === season.season_number); const orig = allSeasons.find(s => s.seasonNumber === season.season_number);
if (orig) { if (orig) {
// Fetch full metadata using getById // Fetch full metadata using getById
@ -277,7 +283,8 @@ export default class MediaDbPlugin extends Plugin {
await this.createMediaDbNotes([orig]); await this.createMediaDbNotes([orig]);
} }
} }
})); }),
);
return; return;
} }