From 300e6318dc62881c3cbe185abc9d10c026378fb7 Mon Sep 17 00:00:00 2001 From: violet-dev Date: Sun, 25 Aug 2024 11:10:28 +0900 Subject: [PATCH 1/7] Extract basepath side effect sets --- .../lib/pages/download/download_routine.dart | 63 +++++++------------ 1 file changed, 21 insertions(+), 42 deletions(-) diff --git a/violet/lib/pages/download/download_routine.dart b/violet/lib/pages/download/download_routine.dart index 23d77be35..7b8e5874c 100644 --- a/violet/lib/pages/download/download_routine.dart +++ b/violet/lib/pages/download/download_routine.dart @@ -72,6 +72,15 @@ class DownloadRoutine { generalDownloadProgress, ); } + + final basepath = await downloadBasePath(); + for (var task in tasks!) { + task.downloadPath = join( + basepath, + task.format! + .formatting(HentaiDonwloadManager.instance().defaultFormat()), + ); + } } catch (e) { _setState(7); return; @@ -87,13 +96,7 @@ class DownloadRoutine { } Future extractFilePath() async { - final inner = (await getApplicationDocumentsDirectory()).path; - final files = tasks! - .map((e) => join( - Settings.useInnerStorage ? inner : Settings.downloadBasePath, - e.format! - .formatting(HentaiDonwloadManager.instance().defaultFormat()))) - .toList(); + final files = tasks!.map((e) => e.downloadPath!).toList(); result['Files'] = jsonEncode(files); result['Path'] = _extractSuperPath(files); await _updateItem(); @@ -120,18 +123,8 @@ class DownloadRoutine { required VoidStringCallback errorCallback, }) async { final downloader = await IsolateDownloader.getInstance(); - var basepath = Settings.downloadBasePath; - - if (Settings.useInnerStorage) { - basepath = (await getApplicationDocumentsDirectory()).path; - } downloader.appendTasks(tasks!.map((e) { - e.downloadPath = join( - basepath, - e.format! - .formatting(HentaiDonwloadManager.instance().defaultFormat())); - e.startCallback = () {}; e.completeCallback = completeCallback; @@ -147,23 +140,11 @@ class DownloadRoutine { } Future> checkDownloadFiles() async { - var basepath = Settings.downloadBasePath; - - if (Settings.useInnerStorage) { - basepath = (await getApplicationDocumentsDirectory()).path; - } - - final filenames = tasks! - .map((e) => join( - basepath, - e.format! - .formatting(HentaiDonwloadManager.instance().defaultFormat()))) - .toList(); - + final files = tasks!.map((e) => e.downloadPath!).toList(); final invalidIndex = []; - for (var i = 0; i < filenames.length; i++) { - var file = File(filenames[i]); + for (var i = 0; i < files.length; i++) { + var file = File(files[i]); if (!await file.exists()) { invalidIndex.add(i); @@ -187,18 +168,8 @@ class DownloadRoutine { required VoidStringCallback errorCallback, }) async { final downloader = await IsolateDownloader.getInstance(); - var basepath = Settings.downloadBasePath; - - if (Settings.useInnerStorage) { - basepath = (await getApplicationDocumentsDirectory()).path; - } downloader.appendTasks(invalidIndex.map((e) => tasks![e]).map((e) { - e.downloadPath = join( - basepath, - e.format! - .formatting(HentaiDonwloadManager.instance().defaultFormat())); - e.startCallback = () {}; e.completeCallback = completeCallback; @@ -229,4 +200,12 @@ class DownloadRoutine { await item.update(); setStateCallback.call(); } + + Future downloadBasePath() async { + if (Settings.useInnerStorage) { + return (await getApplicationDocumentsDirectory()).path; + } else { + return Settings.downloadBasePath; + } + } } From 97d2e21632e9306f958ead52efc62ddeea06c66b Mon Sep 17 00:00:00 2001 From: violet-dev Date: Sun, 18 Aug 2024 14:30:44 +0900 Subject: [PATCH 2/7] Extract mock pref init --- violet/test/component_test.dart | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/violet/test/component_test.dart b/violet/test/component_test.dart index f55ce8f40..829cb4960 100644 --- a/violet/test/component_test.dart +++ b/violet/test/component_test.dart @@ -11,16 +11,17 @@ import 'package:violet/settings/settings.dart'; void main() { setUp(() async { WidgetsFlutterBinding.ensureInitialized(); + SharedPreferences.setMockInitialValues({ + 'eh_cookies': + 'yay=louder; ipb_member_id=2742770; ipb_pass_hash=622fcc2be82c922135bb0516e0ee497d; sl=dm_2; sk=t8inbzaqn45ttyn9f78eanzuqizh; igneous=hez0uu1qwsa7r91eqpt sl=dm_1' + }); }); test('EHentai Gallery Parse', () async { Settings.searchCategory = 1; Settings.searchExpunged = false; Settings.ignoreTimeout = true; - SharedPreferences.setMockInitialValues({ - 'eh_cookies': - 'yay=louder; ipb_member_id=2742770; ipb_pass_hash=622fcc2be82c922135bb0516e0ee497d; ipb_session_id=8c457abd02a2ee708e532d7ba379a186; igneous=19f996fc4; sl=dm_1; sk=t8inbzaqn45ttyn9f78eanzuqizh' - }); + final result = await HentaiManager.searchEHentai('"female:big breasts"', 0, false); @@ -31,10 +32,7 @@ void main() { Settings.searchCategory = 1; Settings.searchExpunged = false; Settings.ignoreTimeout = true; - SharedPreferences.setMockInitialValues({ - 'eh_cookies': - 'yay=louder; ipb_member_id=2742770; ipb_pass_hash=622fcc2be82c922135bb0516e0ee497d; ipb_session_id=8c457abd02a2ee708e532d7ba379a186; igneous=19f996fc4; sl=dm_1; sk=t8inbzaqn45ttyn9f78eanzuqizh' - }); + final result = await HentaiManager.searchEHentai('"female:big breasts"', 0, true); From 7ca23dda5894024e2c19a8196cf857476ebe66fa Mon Sep 17 00:00:00 2001 From: violet-dev Date: Sun, 18 Aug 2024 14:18:57 +0900 Subject: [PATCH 3/7] Remove `tag:` prefix on tag translate --- .../lib/component/hitomi/tag_translate.dart | 26 ++++++++++++------- violet/test/translate_test.dart | 19 ++++++++++++++ 2 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 violet/test/translate_test.dart diff --git a/violet/lib/component/hitomi/tag_translate.dart b/violet/lib/component/hitomi/tag_translate.dart index e729f3441..c4940509a 100644 --- a/violet/lib/component/hitomi/tag_translate.dart +++ b/violet/lib/component/hitomi/tag_translate.dart @@ -49,14 +49,22 @@ class TagTranslate { return null; } - if (translateMap.containsKey(key)) { + late final String nomalizedKey; + if (key.startsWith('tag:female:') || key.startsWith('tag:male:')) { + nomalizedKey = key.substring('tag:'.length); + } else { + nomalizedKey = key; + } + + if (translateMap.containsKey(nomalizedKey)) { return null; } - translateMap[key] = value; - reverseAndroMap[disassembly(value) - .replaceAll('female:', '') - .replaceAll('male:', '')] = key; + late final String nomalizedValue = + value.replaceAll('female:', '').replaceAll('male:', ''); + + translateMap[nomalizedKey] = nomalizedValue; + reverseAndroMap[disassembly(nomalizedValue)] = nomalizedKey; return null; }, @@ -87,11 +95,11 @@ class TagTranslate { if (_translateMap.containsKey('character:$key')) { return _translateMap['character:$key']!.split('|').first; } - if (_translateMap.containsKey('tag:female:$key')) { - return _translateMap['tag:female:$key']!.split('|').first; + if (_translateMap.containsKey('female:$key')) { + return _translateMap['female:$key']!.split('|').first; } - if (_translateMap.containsKey('tag:male:$key')) { - return _translateMap['tag:male:$key']!.split('|').first; + if (_translateMap.containsKey('male:$key')) { + return _translateMap['male:$key']!.split('|').first; } if (_translateMap.containsKey('tag:$key')) { return _translateMap['tag:$key']!.split('|').first; diff --git a/violet/test/translate_test.dart b/violet/test/translate_test.dart new file mode 100644 index 000000000..a5374647c --- /dev/null +++ b/violet/test/translate_test.dart @@ -0,0 +1,19 @@ +// This source code is a part of Project Violet. +// Copyright (C) 2020-2024. violet-team. Licensed under the Apache-2.0 License. + +import 'package:flutter_test/flutter_test.dart'; +import 'package:violet/component/hitomi/tag_translate.dart'; + +void main() { + group('Query Test', () { + setUp(() async { + await TagTranslate.init(); + }); + + test('Translate Korean Simple', () { + expect(TagTranslate.ofAny('sole female'), '단독여성'); + expect(TagTranslate.ofAny('pokemon'), '포켓몬'); + expect(TagTranslate.ofAny('teitoku'), '제독'); + }); + }); +} From b21b77944898b1fd85b9a859f1dac26e40d706c8 Mon Sep 17 00:00:00 2001 From: violet-dev Date: Sun, 25 Aug 2024 11:29:06 +0900 Subject: [PATCH 4/7] Fix android build flutter version --- .github/workflows/violet-build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/violet-build.yml b/.github/workflows/violet-build.yml index 0323f67cb..9ea451e90 100644 --- a/.github/workflows/violet-build.yml +++ b/.github/workflows/violet-build.yml @@ -111,10 +111,11 @@ jobs: - uses: actions/setup-java@v1 with: java-version: "12.x" - + - uses: subosito/flutter-action@v2 with: channel: "stable" + flutter-version: 3.19.6 - uses: actions/setup-python@v2 with: From 66e2886e30f68c3cd106bb59b522dea31a520e96 Mon Sep 17 00:00:00 2001 From: violet-dev Date: Sun, 1 Sep 2024 11:42:35 +0900 Subject: [PATCH 5/7] Remove `tag:` prefix used with `female` or `male` --- .../lib/component/hitomi/displayed_tag.dart | 41 +----- violet/lib/component/hitomi/hitomi.dart | 137 ++++++------------ violet/lib/pages/search/search_bar_page.dart | 40 +++-- violet/lib/pages/settings/tag_selector.dart | 22 +-- violet/test/query_test.dart | 8 +- 5 files changed, 77 insertions(+), 171 deletions(-) diff --git a/violet/lib/component/hitomi/displayed_tag.dart b/violet/lib/component/hitomi/displayed_tag.dart index a159950e4..5cc1a9df0 100644 --- a/violet/lib/component/hitomi/displayed_tag.dart +++ b/violet/lib/component/hitomi/displayed_tag.dart @@ -4,9 +4,9 @@ import 'package:violet/component/hitomi/tag_translate.dart'; class DisplayedTag { - // artist, group, tag, series, character, uploader, type, class, language, prefix, page + // artist, group, tag, series, character, uploader, type, class, language, prefix, page, female, male String? group; - // , female:, male: + // String? name; // String? translated; @@ -14,33 +14,8 @@ class DisplayedTag { // tag := : DisplayedTag({String? tag, this.group, this.name, this.translated}) { if (tag != null) { - final maybeGroup = tag.split(':').first; - if ([ - 'artist', - 'group', - 'tag', - 'series', - 'character', - 'uploader', - 'type', - 'class', - 'language', - 'prefix', - 'page', - ].contains(maybeGroup)) { - group = maybeGroup; - name = tag.substring(tag.indexOf(':') + 1); - } else if (['female', 'male'].contains(maybeGroup)) { - group = 'tag'; - name = tag; - } - } - - if (group != null) { - if (['female', 'male'].contains(group)) { - if (!name!.startsWith('$group:')) name = '$group:$name'; - group = 'tag'; - } + group = tag.split(':').first; + name = tag.substring(tag.indexOf(':') + 1); } } @@ -61,12 +36,4 @@ class DisplayedTag { String toString() { return getTag(); } - - // TODO: https://github.com/project-violet/violet/issues/440 로 삭제 - bool groupEqualTo(String otherGroup) { - if (otherGroup == 'female' || otherGroup == 'male') { - return group == 'tag' && name!.startsWith(otherGroup); - } - return group == otherGroup; - } } diff --git a/violet/lib/component/hitomi/hitomi.dart b/violet/lib/component/hitomi/hitomi.dart index bc1058fca..7fda5dd51 100644 --- a/violet/lib/component/hitomi/hitomi.dart +++ b/violet/lib/component/hitomi/hitomi.dart @@ -4,6 +4,7 @@ import 'dart:convert'; import 'dart:io'; +import 'package:get/get.dart'; import 'package:path/path.dart'; import 'package:path_provider/path_provider.dart'; import 'package:tuple/tuple.dart'; @@ -46,8 +47,6 @@ class HitomiManager { static String normalizeTagPrefix(String pp) { switch (pp) { - case 'female': - case 'male': case 'tags': return 'tag'; @@ -86,6 +85,24 @@ class HitomiManager { final text = path.readAsStringSync(); tagmap = jsonDecode(text); } + + // split `tag:female:` and `tag:male:` to `female:` and `male:` + if (tagmap!.containsKey('tag')) { + final tags = tagmap!['tag'] as Map; + final femaleTags = tags.entries + .where((e) => e.key.startsWith('female:')) + .map((e) => MapEntry(e.key.split(':')[1], e.value)) + .toList(); + final maleTags = tags.entries + .where((e) => e.key.startsWith('male:')) + .map((e) => MapEntry(e.key.split(':')[1], e.value)) + .toList(); + tagmap!['female'] = Map.fromEntries(femaleTags); + tagmap!['male'] = Map.fromEntries(maleTags); + + tags.removeWhere( + (tag, _) => tag.startsWith('female:') || tag.startsWith('male:')); + } } } @@ -108,44 +125,20 @@ class HitomiManager { String prefix, bool useTranslated) { final groupOrig = prefix.split(':')[0]; final group = normalizeTagPrefix(groupOrig); + final name = prefix.split(':').last; final results = >[]; if (!tagmap!.containsKey(group)) return results; final nameCountsMap = tagmap![group] as Map; if (!useTranslated) { - final tagContains = () { - switch (groupOrig) { - case 'female': - case 'male': - return (key) => - key.toLowerCase().startsWith('$groupOrig:') && - key.toLowerCase().contains(prefix); - - case 'tag': - final po = prefix.split(':')[1]; - return (key) => - !key.toLowerCase().startsWith('female:') && - !key.toLowerCase().startsWith('male:') && - key.toLowerCase().contains(po); - - default: - final po = prefix.split(':')[1]; - return (key) => key.toLowerCase().contains(po) as bool; - } - }(); - - nameCountsMap.entries - .where((element) => tagContains(element.key)) - .forEach((element) { - results.add(Tuple2( - DisplayedTag(group: group, name: element.key), element.value)); - }); + results.addAll(nameCountsMap.entries + .where((e) => e.key.toString().toLowerCase().contains(name)) + .map((e) => Tuple2( + DisplayedTag(group: group, name: e.key), e.value))); } else { - final name = prefix.split(':').last; results.addAll(TagTranslate.containsTotal(name) - .where((e) => - e.groupEqualTo(groupOrig) && nameCountsMap.containsKey(e.name)) + .where((e) => e.group! == group && nameCountsMap.containsKey(e.name)) .map((e) => Tuple2(e, nameCountsMap[e.name]))); } results.sort((a, b) => b.item2.compareTo(a.item2)); @@ -203,53 +196,28 @@ class HitomiManager { if (prefix.contains(':')) { final groupOrig = prefix.split(':')[0]; final group = normalizeTagPrefix(groupOrig); + final name = prefix.split(':').last; + // final results = >[]; if (!tagmap!.containsKey(group)) return >[]; final nameCountsMap = tagmap![group]; if (!useTranslated) { - if (groupOrig == 'female' || groupOrig == 'male') { - nameCountsMap.forEach((key, value) { - if (key.toLowerCase().startsWith('$groupOrig:')) { - results.add(Tuple3( - DisplayedTag(group: groupOrig, name: key), - Distance.levenshteinDistance( - prefix.runes.toList(), key.runes.toList()), - value)); - } - }); - } else if (groupOrig == 'tag') { - // CHECK: tag:female:~, tag:artist:~도 허용해야하는지? - final name = prefix.split(':').last; - nameCountsMap.forEach((key, value) { - if (!key.toLowerCase().startsWith('female:') && - !key.toLowerCase().startsWith('male:')) { - results.add(Tuple3( - DisplayedTag(group: groupOrig, name: key), - Distance.levenshteinDistance( - name.runes.toList(), key.runes.toList()), - value)); - } - }); - } else { - final name = prefix.split(':').last; - nameCountsMap.forEach((key, value) { - results.add(Tuple3( - DisplayedTag(group: group, name: key), - Distance.levenshteinDistance( - name.runes.toList(), key.runes.toList()), - value)); - }); - } + nameCountsMap.forEach((key, value) { + results.add(Tuple3( + DisplayedTag(group: group, name: key), + Distance.levenshteinDistance( + name.runes.toList(), key.runes.toList()), + value)); + }); } else { - final name = prefix.split(':').last; results.addAll(TagTranslate.containsFuzzingTotal(name) .where((e) => - e.item1.groupEqualTo(groupOrig) && + e.item1.group! == group && nameCountsMap.containsKey(e.item1.name)) .map((e) => Tuple3( - e.item1, nameCountsMap[e.item1.name], e.item2))); + e.item1, e.item2, nameCountsMap[e.item1.name]))); } results.sort((a, b) => a.item2.compareTo(b.item2)); return results @@ -259,32 +227,13 @@ class HitomiManager { if (!useTranslated) { final results = >[]; tagmap!.forEach((group, value) { - if (group == 'tag') { - value.forEach((name, count) { - if (name.contains(':')) { - final split = name.split(':'); - results.add(Tuple3( - DisplayedTag(group: split[0], name: name), - Distance.levenshteinDistance( - prefix.runes.toList(), split[1].runes.toList()), - count)); - } else { - results.add(Tuple3( - DisplayedTag(group: 'tag', name: name), - Distance.levenshteinDistance( - prefix.runes.toList(), name.runes.toList()), - count)); - } - }); - } else { - value.forEach((name, count) { - results.add(Tuple3( - DisplayedTag(group: group, name: name), - Distance.levenshteinDistance( - prefix.runes.toList(), name.runes.toList()), - count)); - }); - } + value.forEach((name, count) { + results.add(Tuple3( + DisplayedTag(group: group, name: name), + Distance.levenshteinDistance( + prefix.runes.toList(), name.runes.toList()), + count)); + }); }); results.sort((a, b) => a.item2.compareTo(b.item2)); return results diff --git a/violet/lib/pages/search/search_bar_page.dart b/violet/lib/pages/search/search_bar_page.dart index e81b190b9..46b0eb4de 100644 --- a/violet/lib/pages/search/search_bar_page.dart +++ b/violet/lib/pages/search/search_bar_page.dart @@ -675,7 +675,9 @@ class _SearchBarPageState extends State ? token.split(':').last.replaceAll('_', ' ') : token.replaceAll('_', ' ')) .map((e) => Tuple2( - DisplayedTag(group: 'tag', name: e.item1), + DisplayedTag( + group: e.item1.split(':').first, + name: e.item1.split(':').last), (e.item2 * 100).toInt())) .toList(); } else if (token.startsWith('series:')) { @@ -785,14 +787,12 @@ class _SearchBarPageState extends State } if (info.item2 > 0 && Settings.searchShowCount) { - count = - ' (${info.item2.toString() + (related && info.item1.group == 'tag' ? '%' : '')})'; + count = ' (${info.item2.toString() + (related ? '%' : '')})'; } - if (info.item1.group == 'tag' && info.item1.name!.startsWith('female:')) { + if (info.item1.group == 'female') { color = Colors.pink; - } else if (info.item1.group == 'tag' && - info.item1.name!.startsWith('male:')) { + } else if (info.item1.group == 'male') { color = Colors.blue; } else if (info.item1.group == 'prefix') { color = Colors.orange; @@ -884,11 +884,7 @@ class _SearchBarPageState extends State labelPadding: const EdgeInsets.all(0.0), avatar: CircleAvatar( backgroundColor: Colors.grey.shade600, - child: Text(info.item1.group == 'tag' && - (info.item1.name!.startsWith('female:') || - info.item1.name!.startsWith('male:')) - ? info.item1.name![0].toUpperCase() - : info.item1.group![0].toUpperCase()), + child: Text(info.item1.group![0].toUpperCase()), ), label: RichText( text: TextSpan( @@ -907,12 +903,7 @@ class _SearchBarPageState extends State onPressed: () async { // Insert text to cursor. if (info.item1.group != 'prefix') { - var insert = (info.item1.group == 'tag' && - (info.item1.name!.startsWith('female') || - info.item1.name!.startsWith('male')) - ? info.item1.name - : info.item1.getTag())! - .replaceAll(' ', '_'); + final insert = info.item1.getTag().replaceAll(' ', '_'); _searchController.text = _searchText!.substring(0, _insertPos) + insert + @@ -923,11 +914,18 @@ class _SearchBarPageState extends State extentOffset: _insertPos! + insert.length, ); - if (info.item1.group == 'tag') { - _relatedLists = HitomiIndexs.getRelatedTag( - info.item1.name!.replaceAll('_', ' ')) + if (info.item1.group == 'tag' || + info.item1.group == 'female' || + info.item1.group == 'male') { + _relatedLists = HitomiIndexs.getRelatedTag(info.item1.group == 'tag' + ? info.item1.name!.replaceAll('_', ' ') + : info.item1.getTag().replaceAll('_', ' ')) .map((e) => Tuple2( - DisplayedTag(group: 'tag', name: e.item1), + DisplayedTag( + group: e.item1.contains(':') + ? e.item1.split(':').first + : 'tag', + name: e.item1.split(':').last), (e.item2 * 100).toInt())) .toList(); setState(() {}); diff --git a/violet/lib/pages/settings/tag_selector.dart b/violet/lib/pages/settings/tag_selector.dart index efa828d30..82385ef6a 100644 --- a/violet/lib/pages/settings/tag_selector.dart +++ b/violet/lib/pages/settings/tag_selector.dart @@ -227,10 +227,11 @@ class _TagSelectorDialogState extends State { if (info.item2 > 0 && _showCount) count = ' (${info.item2})'; - if (info.item1.group == 'tag' && info.item1.name!.startsWith('female:')) { + print(info.item1); + + if (info.item1.group == 'female') { color = Colors.pink; - } else if (info.item1.group == 'tag' && - info.item1.name!.startsWith('male:')) { + } else if (info.item1.group == 'male') { color = Colors.blue; } else if (info.item1.group == 'prefix') { color = Colors.orange; @@ -244,15 +245,11 @@ class _TagSelectorDialogState extends State { color = Colors.orange; } - var fc = RawChip( + final fc = RawChip( labelPadding: const EdgeInsets.all(0.0), avatar: CircleAvatar( backgroundColor: Colors.grey.shade600, - child: Text(info.item1.group == 'tag' && - (info.item1.name!.startsWith('female:') || - info.item1.name!.startsWith('male:')) - ? info.item1.name![0].toUpperCase() - : info.item1.group![0].toUpperCase()), + child: Text(info.item1.group![0].toUpperCase()), ), label: Text( ' $tagDisplayed$count', @@ -267,12 +264,7 @@ class _TagSelectorDialogState extends State { onPressed: () async { // Insert text to cursor. if (info.item1.group != 'prefix') { - var insert = (info.item1.group == 'tag' && - (info.item1.name!.startsWith('female') || - info.item1.name!.startsWith('male')) - ? info.item1.name - : info.item1.getTag())! - .replaceAll(' ', '_'); + final insert = info.item1.getTag().replaceAll(' ', '_'); _searchController.text = _searchText!.substring(0, _insertPos) + insert + diff --git a/violet/test/query_test.dart b/violet/test/query_test.dart index 712c9aa66..209501e19 100644 --- a/violet/test/query_test.dart +++ b/violet/test/query_test.dart @@ -17,7 +17,7 @@ void main() { final result0 = await HitomiManager.queryAutoComplete('fema'); final result1 = await HitomiManager.queryAutoComplete('random:'); - expect(result0[0].item1.toString(), 'tag:female:sole female'); + expect(result0[0].item1.toString(), 'female:sole female'); expect(result1.length, 0); }); @@ -25,8 +25,8 @@ void main() { final result0 = await HitomiManager.queryAutoComplete('단독여', true); final result1 = await HitomiManager.queryAutoComplete('male:단독', true); - expect(result0[0].item1.toString(), 'tag:female:sole female'); - expect(result1[0].item1.toString(), 'tag:male:sole male'); + expect(result0[0].item1.toString(), 'female:sole female'); + expect(result1[0].item1.toString(), 'male:sole male'); }); test('Hitomi Query Auto Complete Fuzzy', () async { @@ -38,7 +38,7 @@ void main() { expect(result0[0].item1.toString(), 'artist:michiking'); expect(result1[0].item1.toString(), 'artist:michiking'); - expect(result2[0].item1.toString(), 'tag:female:big breasts'); + expect(result2[0].item1.toString(), 'female:big breasts'); }); test('Hitomi Query To Sql', () { From e5c644f54ec08006e6918ee3612aad872e69bb45 Mon Sep 17 00:00:00 2001 From: violet-dev Date: Sun, 1 Sep 2024 11:44:15 +0900 Subject: [PATCH 6/7] Remove unnecessary print --- violet/lib/pages/settings/tag_selector.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/violet/lib/pages/settings/tag_selector.dart b/violet/lib/pages/settings/tag_selector.dart index 82385ef6a..c8e87e698 100644 --- a/violet/lib/pages/settings/tag_selector.dart +++ b/violet/lib/pages/settings/tag_selector.dart @@ -227,8 +227,6 @@ class _TagSelectorDialogState extends State { if (info.item2 > 0 && _showCount) count = ' (${info.item2})'; - print(info.item1); - if (info.item1.group == 'female') { color = Colors.pink; } else if (info.item1.group == 'male') { From 3345b0252d705c98c2cc8f318d1c1b6cb6007cad Mon Sep 17 00:00:00 2001 From: violet-dev Date: Sun, 1 Sep 2024 11:54:00 +0900 Subject: [PATCH 7/7] Lint --- violet/lib/component/hitomi/hitomi.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/violet/lib/component/hitomi/hitomi.dart b/violet/lib/component/hitomi/hitomi.dart index 7fda5dd51..540a09e65 100644 --- a/violet/lib/component/hitomi/hitomi.dart +++ b/violet/lib/component/hitomi/hitomi.dart @@ -4,7 +4,6 @@ import 'dart:convert'; import 'dart:io'; -import 'package:get/get.dart'; import 'package:path/path.dart'; import 'package:path_provider/path_provider.dart'; import 'package:tuple/tuple.dart';