d5726c4f07
- Added support for time input in minutes:seconds format for skipping segments. - Introduced automatic skipping functionality for both opening and ending segments. - Enhanced UI for skip settings with a floating configuration card. - Implemented countdown timer for automatic next episode playback. - Added batch settings for configuring multiple skip segments at once. - Updated SkipController component to handle new skip logic and UI changes. - Created comprehensive usage guide for the new skip feature.
95 lines
3.6 KiB
Markdown
95 lines
3.6 KiB
Markdown
```sql
|
|
CREATE TABLE IF NOT EXISTS users (
|
|
username TEXT PRIMARY KEY,
|
|
password TEXT NOT NULL,
|
|
created_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now'))
|
|
);
|
|
|
|
CREATE TABLE IF NOT EXISTS play_records (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
username TEXT NOT NULL,
|
|
key TEXT NOT NULL,
|
|
title TEXT NOT NULL,
|
|
source_name TEXT NOT NULL,
|
|
cover TEXT NOT NULL,
|
|
year TEXT NOT NULL,
|
|
index_episode INTEGER NOT NULL,
|
|
total_episodes INTEGER NOT NULL,
|
|
play_time INTEGER NOT NULL,
|
|
total_time INTEGER NOT NULL,
|
|
save_time INTEGER NOT NULL,
|
|
search_title TEXT,
|
|
UNIQUE(username, key)
|
|
);
|
|
|
|
CREATE TABLE IF NOT EXISTS favorites (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
username TEXT NOT NULL,
|
|
key TEXT NOT NULL,
|
|
title TEXT NOT NULL,
|
|
source_name TEXT NOT NULL,
|
|
cover TEXT NOT NULL,
|
|
year TEXT NOT NULL,
|
|
total_episodes INTEGER NOT NULL,
|
|
save_time INTEGER NOT NULL,
|
|
UNIQUE(username, key)
|
|
);
|
|
|
|
CREATE TABLE IF NOT EXISTS search_history (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
username TEXT NOT NULL,
|
|
keyword TEXT NOT NULL,
|
|
created_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now')),
|
|
UNIQUE(username, keyword)
|
|
);
|
|
|
|
CREATE TABLE IF NOT EXISTS admin_config (
|
|
id INTEGER PRIMARY KEY DEFAULT 1,
|
|
config TEXT NOT NULL,
|
|
updated_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now'))
|
|
);
|
|
|
|
CREATE TABLE IF NOT EXISTS skip_configs (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
username TEXT NOT NULL,
|
|
key TEXT NOT NULL,
|
|
source TEXT NOT NULL,
|
|
video_id TEXT NOT NULL,
|
|
title TEXT NOT NULL,
|
|
segments TEXT NOT NULL,
|
|
updated_time INTEGER NOT NULL,
|
|
UNIQUE(username, key)
|
|
);
|
|
|
|
-- 基本索引
|
|
CREATE INDEX IF NOT EXISTS idx_play_records_username ON play_records(username);
|
|
CREATE INDEX IF NOT EXISTS idx_favorites_username ON favorites(username);
|
|
CREATE INDEX IF NOT EXISTS idx_search_history_username ON search_history(username);
|
|
CREATE INDEX IF NOT EXISTS idx_skip_configs_username ON skip_configs(username);
|
|
|
|
-- 复合索引优化查询性能
|
|
-- 播放记录:用户名+键值的复合索引,用于快速查找特定记录
|
|
CREATE INDEX IF NOT EXISTS idx_play_records_username_key ON play_records(username, key);
|
|
-- 播放记录:用户名+保存时间的复合索引,用于按时间排序的查询
|
|
CREATE INDEX IF NOT EXISTS idx_play_records_username_save_time ON play_records(username, save_time DESC);
|
|
|
|
-- 收藏:用户名+键值的复合索引,用于快速查找特定收藏
|
|
CREATE INDEX IF NOT EXISTS idx_favorites_username_key ON favorites(username, key);
|
|
-- 收藏:用户名+保存时间的复合索引,用于按时间排序的查询
|
|
CREATE INDEX IF NOT EXISTS idx_favorites_username_save_time ON favorites(username, save_time DESC);
|
|
|
|
-- 搜索历史:用户名+关键词的复合索引,用于快速查找/删除特定搜索记录
|
|
CREATE INDEX IF NOT EXISTS idx_search_history_username_keyword ON search_history(username, keyword);
|
|
-- 搜索历史:用户名+创建时间的复合索引,用于按时间排序的查询
|
|
CREATE INDEX IF NOT EXISTS idx_search_history_username_created_at ON search_history(username, created_at DESC);
|
|
|
|
-- 搜索历史清理查询的优化索引
|
|
CREATE INDEX IF NOT EXISTS idx_search_history_username_id_created_at ON search_history(username, id, created_at DESC);
|
|
|
|
-- 跳过配置索引
|
|
-- 跳过配置:用户名+键值的复合索引,用于快速查找特定配置
|
|
CREATE INDEX IF NOT EXISTS idx_skip_configs_username_key ON skip_configs(username, key);
|
|
-- 跳过配置:用户名+更新时间的复合索引,用于按时间排序的查询
|
|
CREATE INDEX IF NOT EXISTS idx_skip_configs_username_updated_time ON skip_configs(username, updated_time DESC);
|
|
```
|