增加剧集更新检查

This commit is contained in:
mtvpls
2025-12-18 23:44:14 +08:00
parent 0ae5923b4b
commit c60e25ded6
12 changed files with 864 additions and 9 deletions
+45
View File
@@ -24,6 +24,8 @@ export interface Favorite {
save_time: number; // 记录保存时间(时间戳)
search_title: string; // 搜索时使用的标题
origin?: 'vod' | 'live';
is_completed?: boolean; // 是否已完结
vod_remarks?: string; // 视频备注信息
}
// 存储接口
@@ -96,6 +98,18 @@ export interface IStorage {
getGlobalValue(key: string): Promise<string | null>;
setGlobalValue(key: string, value: string): Promise<void>;
deleteGlobalValue(key: string): Promise<void>;
// 通知相关
getNotifications(userName: string): Promise<Notification[]>;
addNotification(userName: string, notification: Notification): Promise<void>;
markNotificationAsRead(userName: string, notificationId: string): Promise<void>;
deleteNotification(userName: string, notificationId: string): Promise<void>;
clearAllNotifications(userName: string): Promise<void>;
getUnreadNotificationCount(userName: string): Promise<number>;
// 收藏更新检查相关
getLastFavoriteCheckTime(userName: string): Promise<number>;
setLastFavoriteCheckTime(userName: string, timestamp: number): Promise<void>;
}
// 搜索结果数据结构
@@ -112,6 +126,8 @@ export interface SearchResult {
desc?: string;
type_name?: string;
douban_id?: number;
vod_remarks?: string; // 视频备注信息(如"全80集"、"更新至25集"等)
vod_total?: number; // 总集数
}
// 豆瓣数据结构
@@ -161,3 +177,32 @@ export interface EpisodeFilterRule {
export interface EpisodeFilterConfig {
rules: EpisodeFilterRule[]; // 过滤规则列表
}
// 通知类型枚举
export type NotificationType =
| 'favorite_update' // 收藏更新
| 'system' // 系统通知
| 'announcement'; // 公告
// 通知数据结构
export interface Notification {
id: string; // 通知ID
type: NotificationType; // 通知类型
title: string; // 通知标题
message: string; // 通知内容
timestamp: number; // 通知时间戳
read: boolean; // 是否已读
metadata?: Record<string, any>; // 额外的元数据(如收藏更新的source、id等)
}
// 收藏更新检查结果
export interface FavoriteUpdateCheck {
last_check_time: number; // 上次检查时间戳
updates: Array<{
source: string;
id: string;
title: string;
old_episodes: number;
new_episodes: number;
}>;
}