remove solid; rework season search
This commit is contained in:
parent
ee985419e0
commit
21ad8c59d0
17 changed files with 407 additions and 357 deletions
|
|
@ -3,6 +3,7 @@ import { APIModel } from 'packages/obsidian/src/api/APIModel';
|
|||
import type MediaDbPlugin from 'packages/obsidian/src/main';
|
||||
import type { MediaTypeModel } from 'packages/obsidian/src/models/MediaTypeModel';
|
||||
import { SeasonModel } from 'packages/obsidian/src/models/SeasonModel';
|
||||
import { SeasonSearchResultModel } from 'packages/obsidian/src/models/SeasonSearchResultModel';
|
||||
import { Logger } from 'packages/obsidian/src/utils/Logger';
|
||||
import type { MDBError } from 'packages/obsidian/src/utils/MDBError';
|
||||
import { MDBErrorKind, toMdbError } from 'packages/obsidian/src/utils/MDBError';
|
||||
|
|
@ -153,14 +154,13 @@ export class TMDBSeasonAPI extends APIModel {
|
|||
}
|
||||
}
|
||||
|
||||
return new SeasonModel({
|
||||
return new SeasonSearchResultModel({
|
||||
title: `${result.name ?? result.original_name ?? ''}`,
|
||||
englishTitle: result.name ?? result.original_name ?? '',
|
||||
year: result.first_air_date ? new Date(result.first_air_date).getFullYear().toString() : 'unknown',
|
||||
dataSource: this.apiName,
|
||||
id: result.id?.toString() ?? '',
|
||||
seasonTitle: result.name ?? result.original_name ?? '',
|
||||
seasonNumber: totalSeasons,
|
||||
seasonCount: totalSeasons,
|
||||
});
|
||||
}),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -252,4 +252,8 @@ export class TMDBSeriesAPI extends APIModel {
|
|||
getDisabledMediaTypes(): MediaType[] {
|
||||
return this.plugin.settings.TMDBSeriesAPI_disabledMediaTypes;
|
||||
}
|
||||
|
||||
getSeasonApiNameForSeries(_series: MediaTypeModel): string {
|
||||
return 'TMDBSeasonAPI';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue