Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/src/config/theme_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ThemeConfig {

return themeData.copyWith(
appBarTheme: themeData.appBarTheme.copyWith(backgroundColor: themeData.colorScheme.surface),
dialogTheme: DialogTheme(backgroundColor: themeData.colorScheme.surface),
dialogTheme: DialogThemeData(backgroundColor: themeData.colorScheme.surface),
);
}
}
29 changes: 22 additions & 7 deletions lib/src/database/dao/gallery_history_dao.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,19 @@ class GalleryHistoryDao {
static Future<List<GalleryHistoryV2Data>> selectAll() {
return (appDb.select(appDb.galleryHistoryV2)
..orderBy([
(tbl) => OrderingTerm(expression: tbl.lastReadTime, mode: OrderingMode.asc),
(tbl) => OrderingTerm(
expression: tbl.lastReadTime, mode: OrderingMode.asc),
(tbl) => OrderingTerm(expression: tbl.gid, mode: OrderingMode.asc),
]))
.get();
}

static Future<List<GalleryHistoryV2Data>> selectByPageIndex(int pageIndex, int pageSize) {
static Future<List<GalleryHistoryV2Data>> selectByPageIndex(
int pageIndex, int pageSize) {
return (appDb.select(appDb.galleryHistoryV2)
..orderBy([
(tbl) => OrderingTerm(expression: tbl.lastReadTime, mode: OrderingMode.desc),
(tbl) => OrderingTerm(
expression: tbl.lastReadTime, mode: OrderingMode.desc),
(tbl) => OrderingTerm(expression: tbl.gid, mode: OrderingMode.desc),
])
..limit(pageSize, offset: pageIndex * pageSize))
Expand All @@ -29,7 +32,15 @@ class GalleryHistoryDao {
return appDb.into(appDb.galleryHistoryV2).insertOnConflictUpdate(history);
}

static Future<void> batchReplaceHistory(List<GalleryHistoryV2Data> histories) async {
static Future<bool> contains(int gid) {
return (appDb.select(appDb.galleryHistoryV2)
..where((tbl) => tbl.gid.equals(gid)))
.getSingleOrNull()
.then((value) => value != null);
}

static Future<void> batchReplaceHistory(
List<GalleryHistoryV2Data> histories) async {
if (histories.isEmpty) {
return;
}
Expand All @@ -40,7 +51,9 @@ class GalleryHistoryDao {
}

static Future<int> deleteHistory(int gid) {
return (appDb.delete(appDb.galleryHistoryV2)..where((tbl) => tbl.gid.equals(gid))).go();
return (appDb.delete(appDb.galleryHistoryV2)
..where((tbl) => tbl.gid.equals(gid)))
.go();
}

static Future<int> deleteAllHistory() {
Expand All @@ -51,11 +64,13 @@ class GalleryHistoryDao {
return appDb.galleryHistory.count().getSingle();
}

static Future<List<GalleryHistoryData>> selectLargerThanLastReadTimeAndGidOld(String lastReadTime, int limit) {
static Future<List<GalleryHistoryData>> selectLargerThanLastReadTimeAndGidOld(
String lastReadTime, int limit) {
return (appDb.select(appDb.galleryHistory)
..where((tbl) => tbl.lastReadTime.isBiggerOrEqualValue(lastReadTime))
..orderBy([
(tbl) => OrderingTerm(expression: tbl.lastReadTime, mode: OrderingMode.asc),
(tbl) => OrderingTerm(
expression: tbl.lastReadTime, mode: OrderingMode.asc),
(tbl) => OrderingTerm(expression: tbl.gid, mode: OrderingMode.asc),
])
..limit(limit))
Expand Down
5 changes: 5 additions & 0 deletions lib/src/l18n/en_US.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ class en_US {
'receiveDataTimeoutHint': 'Network receive data timeout',
'archiveError': 'Download Archive Error',
'edit': 'Edit',
'opened': 'Opened',

'home': "Home",
'localSearch': "Local Search",
'inputKeyword2Search': "Input keyword to search",
'gallery': "Gallery",
'setting': 'Setting',

Expand Down Expand Up @@ -459,6 +462,7 @@ class en_US {
'keepScreenAwakeWhenReading': 'Keep Screen Awake When Reading',
'enableCustomReadBrightness': 'Enable Custom Brightness When Reading',
'spaceBetweenImages': 'Space Between Images',
'resetReadProgress': 'Reset Read Progress',
'enableImmersiveHint': 'Hide System Bar',
'enableImmersiveHint4Windows': 'Hide Title Bar',
'deviceOrientation': 'Device Orientation',
Expand Down Expand Up @@ -537,6 +541,7 @@ class en_US {

/// download page
'local': 'Local',
'downloadCategory': 'Download Category',
'reDownload': 'Re-Download',
'delete': 'Delete',
'deleteTask': 'Delete Task Only',
Expand Down
3 changes: 3 additions & 0 deletions lib/src/l18n/ko_KR.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class ko_KR {
'receiveDataTimeoutHint': 'Network receive data timeout',
'archiveError': 'Download Archive Error',
'edit': 'Edit',
'opened': 'Opened',

'home': "홈",
'gallery': "갤러리",
Expand Down Expand Up @@ -459,6 +460,7 @@ class ko_KR {
'keepScreenAwakeWhenReading': '읽는 중에 화면 꺼짐 방지하기',
'enableCustomReadBrightness': 'Enable Custom Brightness When Reading',
'spaceBetweenImages': '이미지 간격',
'resetReadProgress': 'Reset Read Progress',
'enableImmersiveHint': '시스템 바를 숨김',
'enableImmersiveHint4Windows': 'Hide Title Bar',
'deviceOrientation': 'Device Orientation',
Expand Down Expand Up @@ -537,6 +539,7 @@ class ko_KR {

/// download page
'local': '로컬',
'downloadCategory': 'Download Category',
'reDownload': '다시 다운로드',
'delete': '삭제',
'deleteTask': '리스트에서만 삭제',
Expand Down
3 changes: 3 additions & 0 deletions lib/src/l18n/pt_BR.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class pt_BR {
'receiveDataTimeoutHint': 'Network receive data timeout',
'archiveError': 'Download Archive Error',
'edit': 'Edit',
'opened': 'Opened',

'home': "Home",
'gallery': "Galeria",
Expand Down Expand Up @@ -460,6 +461,7 @@ class pt_BR {
'keepScreenAwakeWhenReading': 'Keep Screen Awake When Reading',
'enableCustomReadBrightness': 'Enable Custom Brightness When Reading',
'spaceBetweenImages': 'Space Between Images',
'resetReadProgress': 'Reset Read Progress',
'enableImmersiveHint': 'Esconder barra do sistema',
'enableImmersiveHint4Windows': 'Hide Title Bar',
'deviceOrientation': 'Device Orientation',
Expand Down Expand Up @@ -538,6 +540,7 @@ class pt_BR {

/// download page
'local': 'Local',
'downloadCategory': 'Download Category',
'reDownload': 'Baixar novamente',
'delete': 'Apagar',
'deleteTask': 'Apagar apenas tarefa',
Expand Down
3 changes: 3 additions & 0 deletions lib/src/l18n/ru_RU.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class ru_RU {
'receiveDataTimeoutHint': 'Тайм-аут получения данных',
'archiveError': 'Ошибка загрузки архива',
'edit': 'Редактировать',
'opened': 'Opened',

'home': "Главная",
'gallery': "Галерея",
Expand Down Expand Up @@ -466,6 +467,7 @@ class ru_RU {
'keepScreenAwakeWhenReading': 'Не выключать экран при чтении',
'enableCustomReadBrightness': 'Включить пользовательскую яркость при чтении',
'spaceBetweenImages': 'Пространство между изображениями',
'resetReadProgress': 'Reset Read Progress',
'enableImmersiveHint': 'Скрыть системную панель',
'enableImmersiveHint4Windows': 'Скрыть заголовок окна',
'deviceOrientation': 'Ориентация устройства',
Expand Down Expand Up @@ -544,6 +546,7 @@ class ru_RU {

/// download page
'local': 'Локально',
'downloadCategory': 'Download Category',
'reDownload': 'Перекачать',
'delete': 'Удалить',
'deleteTask': 'Удалить только задачу',
Expand Down
5 changes: 5 additions & 0 deletions lib/src/l18n/zh_CN.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ class zh_CN {
'receiveDataTimeoutHint': '网络接收数据超时',
'archiveError': '下载归档错误',
'edit': '编辑',
'opened': '已打开',

'home': "主页",
'localSearch': "本地搜索",
'inputKeyword2Search': "输入关键字以搜索",
'gallery': "画廊",
'setting': '设置',

Expand Down Expand Up @@ -459,6 +462,7 @@ class zh_CN {
'keepScreenAwakeWhenReading': '阅读时屏幕不自动锁定',
'enableCustomReadBrightness': '阅读页自定义亮度',
'spaceBetweenImages': '图片间隔',
'resetReadProgress': '重置阅读进度',
'enableImmersiveHint': '隐藏系统状态栏和底部导航栏',
'enableImmersiveHint4Windows': '隐藏顶部标题栏',
'deviceOrientation': '屏幕方向',
Expand Down Expand Up @@ -537,6 +541,7 @@ class zh_CN {

/// download page
'local': '本地',
'downloadCategory': '下载分类',
'delete': '删除',
'deleteTask': '仅删除任务',
'deleteTaskAndImages': '删除任务和图片',
Expand Down
3 changes: 3 additions & 0 deletions lib/src/l18n/zh_TW.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class zh_TW {
'receiveDataTimeoutHint': '接收網路資料超時',
'archiveError': '下載歸檔錯誤',
'edit': '編輯',
'opened': '已開啟',

'home': "首頁",
'gallery': "畫廊",
Expand Down Expand Up @@ -459,6 +460,7 @@ class zh_TW {
'keepScreenAwakeWhenReading': '閱讀時螢幕不自動鎖定',
'enableCustomReadBrightness': '閱讀頁自訂亮度',
'spaceBetweenImages': '圖片間隔',
'resetReadProgress': '重設閱讀進度',
'enableImmersiveHint': '隱藏系統狀態欄和底部導航欄',
'enableImmersiveHint4Windows': '隱藏頂部標題欄',
'deviceOrientation': '螢幕方向',
Expand Down Expand Up @@ -537,6 +539,7 @@ class zh_TW {

/// download page
'local': '本機',
'downloadCategory': '下載分類',
'delete': '刪除',
'deleteTask': '僅刪除任務',
'deleteTaskAndImages': '刪除任務和圖片',
Expand Down
1 change: 1 addition & 0 deletions lib/src/model/tab_bar_icon.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ enum TabBarIconNameEnum {
favorite,
history,
download,
localSearch,
setting,
}

Expand Down
3 changes: 3 additions & 0 deletions lib/src/pages/base/base_page_logic.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ import '../../mixin/scroll_to_top_state_mixin.dart';
import '../../model/gallery.dart';
import '../../network/eh_request.dart';
import '../../routes/routes.dart';
import '../../service/history_service.dart';
import '../../service/local_block_rule_service.dart';
import '../../service/tag_translation_service.dart';
import '../../utils/convert_util.dart';
import '../../setting/user_setting.dart';
import '../../utils/eh_spider_parser.dart';
import '../../service/log.dart';
Expand Down Expand Up @@ -382,6 +384,7 @@ abstract class BasePageLogic extends GetxController with Scroll2TopLogicMixin {
}

void handleTapGalleryCard(Gallery gallery) async {
unawaited(historyService.record(gallery2GalleryHistoryModel(gallery)));
toRoute(
Routes.details,
arguments: DetailsPageArgument(galleryUrl: gallery.galleryUrl, gallery: gallery),
Expand Down
Loading