mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-09-22 05:16:22 -07:00
feat(stats): add TMDB metadata for live-action dramas in the Library (#252)
This commit is contained in:
@@ -12,6 +12,7 @@ import type {
|
||||
ImmersionTrackingRetentionMode,
|
||||
ImmersionTrackingRetentionPreset,
|
||||
TsukihimeConfig,
|
||||
TmdbConfig,
|
||||
JellyfinConfig,
|
||||
JimakuConfig,
|
||||
JimakuLanguagePreference,
|
||||
@@ -160,6 +161,7 @@ export interface Config {
|
||||
/** @deprecated Use tsukihime. */
|
||||
animetosho?: TsukihimeConfig;
|
||||
tsukihime?: TsukihimeConfig;
|
||||
tmdb?: TmdbConfig;
|
||||
anilist?: AnilistConfig;
|
||||
yomitan?: YomitanConfig;
|
||||
jellyfin?: JellyfinConfig;
|
||||
@@ -333,6 +335,10 @@ export interface ResolvedConfig {
|
||||
apiBaseUrl: string;
|
||||
maxSearchResults: number;
|
||||
};
|
||||
tmdb: {
|
||||
apiKey: string;
|
||||
apiKeyCommand: string;
|
||||
};
|
||||
anilist: {
|
||||
enabled: boolean;
|
||||
accessToken: string;
|
||||
|
||||
@@ -287,3 +287,9 @@ export interface TsukihimeConfig {
|
||||
apiBaseUrl?: string;
|
||||
maxSearchResults?: number;
|
||||
}
|
||||
|
||||
/** TMDB (The Movie Database) access for live-action drama and movie metadata. */
|
||||
export interface TmdbConfig {
|
||||
apiKey?: string;
|
||||
apiKeyCommand?: string;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ import type {
|
||||
WatchTimePerAnime,
|
||||
WordDetailData,
|
||||
} from './stats-wire';
|
||||
import type { TmdbMediaType } from '../shared/media-kind';
|
||||
|
||||
export type StatsTrendRange = '7d' | '30d' | '90d' | '365d' | 'all';
|
||||
export type StatsTrendGroupBy = 'day' | 'month';
|
||||
@@ -78,6 +79,25 @@ export interface StatsAnilistSearchResult {
|
||||
title: { romaji: string | null; english: string | null; native: string | null } | null;
|
||||
}
|
||||
|
||||
export interface StatsTmdbSearchResult {
|
||||
tmdbId: number;
|
||||
tmdbType: TmdbMediaType;
|
||||
/** English title when TMDB has one, otherwise the original title. */
|
||||
title: string;
|
||||
originalTitle: string;
|
||||
originalLanguage: string;
|
||||
overview: string | null;
|
||||
posterUrl: string | null;
|
||||
year: number | null;
|
||||
/** True when TMDB tags the title with the Animation genre. */
|
||||
isAnimation: boolean;
|
||||
}
|
||||
|
||||
export interface StatsTmdbAssignment {
|
||||
tmdbId: number;
|
||||
tmdbType: TmdbMediaType;
|
||||
}
|
||||
|
||||
export interface StatsAnilistAssignment {
|
||||
anilistId: number;
|
||||
titleRomaji?: string | null;
|
||||
@@ -209,11 +229,13 @@ export interface StatsJsonResponseMap {
|
||||
moveVideoToAnime: StatsMoveVideoResponse;
|
||||
dismissAnimeMergeRecommendation: StatsOkResponse;
|
||||
anilistSearch: StatsAnilistSearchResult[];
|
||||
tmdbSearch: StatsTmdbSearchResult[];
|
||||
knownWords: string[];
|
||||
knownWordsSummary: StatsKnownWordsSummary;
|
||||
animeKnownWordsSummary: StatsKnownWordsSummary;
|
||||
mediaKnownWordsSummary: StatsKnownWordsSummary;
|
||||
reassignAnimeAnilist: StatsOkResponse;
|
||||
reassignAnimeTmdb: StatsOkResponse;
|
||||
coverImages: StatsCoverImagesData;
|
||||
episodeDetail: EpisodeDetailData;
|
||||
ankiBrowse: StatsAnkiBrowseResponse;
|
||||
@@ -302,6 +324,8 @@ export interface StatsHttpClient {
|
||||
getMediaKnownWordsSummary: (videoId: number) => Promise<StatsKnownWordsSummary>;
|
||||
searchAnilist: (query: string) => Promise<StatsAnilistSearchResult[]>;
|
||||
reassignAnimeAnilist: (animeId: number, info: StatsAnilistAssignment) => Promise<void>;
|
||||
searchTmdb: (query: string) => Promise<StatsTmdbSearchResult[]>;
|
||||
reassignAnimeTmdb: (animeId: number, info: StatsTmdbAssignment) => Promise<void>;
|
||||
mineCard: (params: StatsMineCardParams) => Promise<StatsMineCardResponse>;
|
||||
ankiBrowse: (noteId: number) => Promise<void>;
|
||||
ankiNotesInfo: (noteIds: number[]) => Promise<StatsAnkiNoteInfo[]>;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { MediaKind } from '../shared/media-kind';
|
||||
import type { MediaKind, TmdbMediaType } from '../shared/media-kind';
|
||||
|
||||
export interface SessionSummary {
|
||||
sessionId: number;
|
||||
canonicalTitle: string | null;
|
||||
@@ -245,6 +246,8 @@ export interface AnimeLibraryItem {
|
||||
animeId: number;
|
||||
canonicalTitle: string;
|
||||
anilistId: number | null;
|
||||
tmdbId: number | null;
|
||||
tmdbType: TmdbMediaType | null;
|
||||
totalSessions: number;
|
||||
totalActiveMs: number;
|
||||
totalCards: number;
|
||||
@@ -267,6 +270,8 @@ export interface AnimeDetailData {
|
||||
animeId: number;
|
||||
canonicalTitle: string;
|
||||
anilistId: number | null;
|
||||
tmdbId: number | null;
|
||||
tmdbType: TmdbMediaType | null;
|
||||
titleRomaji: string | null;
|
||||
titleEnglish: string | null;
|
||||
titleNative: string | null;
|
||||
|
||||
Reference in New Issue
Block a user