generated from dellevin/template
优化清理缓存
This commit is contained in:
@@ -2660,6 +2660,8 @@ class _LocalBackupContentState extends State<_LocalBackupContent> {
|
|||||||
await context.read<AppProvider>().loadBooks();
|
await context.read<AppProvider>().loadBooks();
|
||||||
await context.read<AppProvider>().loadNotes();
|
await context.read<AppProvider>().loadNotes();
|
||||||
await context.read<AppProvider>().loadGames();
|
await context.read<AppProvider>().loadGames();
|
||||||
|
await context.read<AppProvider>().loadPlaylists();
|
||||||
|
await context.read<AppProvider>().loadPeople();
|
||||||
if (!mounted) return;
|
if (!mounted) return;
|
||||||
ToastUtil.show(context,'导入成功');
|
ToastUtil.show(context,'导入成功');
|
||||||
} else {
|
} else {
|
||||||
@@ -2798,6 +2800,8 @@ class _WebDAVBackupContentState extends State<_WebDAVBackupContent> {
|
|||||||
await provider.loadBooks();
|
await provider.loadBooks();
|
||||||
await provider.loadNotes();
|
await provider.loadNotes();
|
||||||
await provider.loadGames();
|
await provider.loadGames();
|
||||||
|
await provider.loadPlaylists();
|
||||||
|
await provider.loadPeople();
|
||||||
}
|
}
|
||||||
ToastUtil.show(context,'同步成功');
|
ToastUtil.show(context,'同步成功');
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -455,6 +455,8 @@ class _CloudSheetContentState extends State<_CloudSheetContent> {
|
|||||||
await provider.loadBooks();
|
await provider.loadBooks();
|
||||||
await provider.loadNotes();
|
await provider.loadNotes();
|
||||||
await provider.loadGames();
|
await provider.loadGames();
|
||||||
|
await provider.loadPlaylists();
|
||||||
|
await provider.loadPeople();
|
||||||
}
|
}
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
setState(() => _syncing = false);
|
setState(() => _syncing = false);
|
||||||
@@ -485,6 +487,8 @@ class _CloudSheetContentState extends State<_CloudSheetContent> {
|
|||||||
await provider.loadBooks();
|
await provider.loadBooks();
|
||||||
await provider.loadNotes();
|
await provider.loadNotes();
|
||||||
await provider.loadGames();
|
await provider.loadGames();
|
||||||
|
await provider.loadPlaylists();
|
||||||
|
await provider.loadPeople();
|
||||||
}
|
}
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
setState(() => _syncing = false);
|
setState(() => _syncing = false);
|
||||||
|
|||||||
@@ -1104,6 +1104,20 @@ class _SettingsPageState extends State<SettingsPage> {
|
|||||||
if (p != null && p.isNotEmpty) paths.add(p);
|
if (p != null && p.isNotEmpty) paths.add(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final people = await db.query('people', columns: ['photo_path']);
|
||||||
|
for (final p in people) {
|
||||||
|
final pp = p['photo_path'] as String?;
|
||||||
|
if (pp != null && pp.isNotEmpty) paths.add(pp);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (final table in const ['movie_characters', 'book_characters', 'game_characters']) {
|
||||||
|
final rows = await db.query(table, columns: ['image_path']);
|
||||||
|
for (final r in rows) {
|
||||||
|
final p = r['image_path'] as String?;
|
||||||
|
if (p != null && p.isNotEmpty) paths.add(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
final userPrefs = UserPrefs();
|
final userPrefs = UserPrefs();
|
||||||
final avatarPath = userPrefs.avatarPath;
|
final avatarPath = userPrefs.avatarPath;
|
||||||
if (avatarPath != null && avatarPath.isNotEmpty) paths.add(avatarPath);
|
if (avatarPath != null && avatarPath.isNotEmpty) paths.add(avatarPath);
|
||||||
|
|||||||
@@ -679,6 +679,8 @@ class _BackupPageState extends State<BackupPage> {
|
|||||||
await context.read<AppProvider>().loadBooks();
|
await context.read<AppProvider>().loadBooks();
|
||||||
await context.read<AppProvider>().loadNotes();
|
await context.read<AppProvider>().loadNotes();
|
||||||
await context.read<AppProvider>().loadGames();
|
await context.read<AppProvider>().loadGames();
|
||||||
|
await context.read<AppProvider>().loadPlaylists();
|
||||||
|
await context.read<AppProvider>().loadPeople();
|
||||||
|
|
||||||
if (!mounted) return;
|
if (!mounted) return;
|
||||||
|
|
||||||
|
|||||||
@@ -166,6 +166,8 @@ class _WebDAVSyncPageState extends State<WebDAVSyncPage> {
|
|||||||
await provider.loadBooks();
|
await provider.loadBooks();
|
||||||
await provider.loadNotes();
|
await provider.loadNotes();
|
||||||
await provider.loadGames();
|
await provider.loadGames();
|
||||||
|
await provider.loadPlaylists();
|
||||||
|
await provider.loadPeople();
|
||||||
if (mounted) _showResultDialog('同步成功', details);
|
if (mounted) _showResultDialog('同步成功', details);
|
||||||
} else {
|
} else {
|
||||||
_showResultDialog('同步成功', details);
|
_showResultDialog('同步成功', details);
|
||||||
|
|||||||
@@ -80,6 +80,22 @@ class CacheCleaner {
|
|||||||
if (p != null && p.isNotEmpty) paths.add(p);
|
if (p != null && p.isNotEmpty) paths.add(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 人物照片
|
||||||
|
final people = await db.query('people', columns: ['photo_path']);
|
||||||
|
for (final p in people) {
|
||||||
|
final pp = p['photo_path'] as String?;
|
||||||
|
if (pp != null && pp.isNotEmpty) paths.add(pp);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 角色图片(影视/书籍/游戏)
|
||||||
|
for (final table in const ['movie_characters', 'book_characters', 'game_characters']) {
|
||||||
|
final rows = await db.query(table, columns: ['image_path']);
|
||||||
|
for (final r in rows) {
|
||||||
|
final p = r['image_path'] as String?;
|
||||||
|
if (p != null && p.isNotEmpty) paths.add(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 用户头像
|
// 用户头像
|
||||||
final userPrefs = UserPrefs();
|
final userPrefs = UserPrefs();
|
||||||
final avatarPath = userPrefs.avatarPath;
|
final avatarPath = userPrefs.avatarPath;
|
||||||
|
|||||||
Reference in New Issue
Block a user