forked from NO-ob/LoliSnatcher_Droid
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- update to flutter 3.16 - update deps (dart_vlc is now taken from main git) - bump targetSdkVersion to 34 - show init state during app start on special screen - new booru handler to view Downloads - rework how item filtering works and used (fixes lags during fast scroll and loading of new pages) - added DB indexing (may cause long first start after the update for some) - reworked "tab with this tag exists" indication - added ability to filter snatched items and items with AI related tags - downloads drawer [WIP] - moved from WillPopScope to PopScope - reworked tab selector [a bit incomplete, needs another bug and design pass] + rework history viewer - fixed scaling bugs with notes (error in calc when fully zoomed, sample images didn't scale position properly, takes image dimensions directly from the loaded image through photo_view) - scroll to search in tagview on focus - attempt to make double tap zoom to tap position (works poorly, still needs work, see photo_view fork) - added double-tap-drag-zoom - old tag searches from booru now properly cancel when starting a new one, which fixes race condition when old results could override newer ones - fixed videos unpausing after restate when they shouldn't - thumbnails scrollbar is now interactive (fixed in inner_drawer fork, it had a container which blocked interaction) - other small fixes
- Loading branch information
Showing
107 changed files
with
4,043 additions
and
2,416 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"flutterSdkVersion": "3.10.6", | ||
"flutterSdkVersion": "3.16.0", | ||
"flavors": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
buildscript { | ||
ext.kotlin_version = '1.6.10' | ||
ext.kotlin_version = '1.9.0' | ||
repositories { | ||
google() | ||
mavenCentral() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import 'package:dio/dio.dart'; | ||
|
||
import 'package:lolisnatcher/src/handlers/booru_handler.dart'; | ||
import 'package:lolisnatcher/src/handlers/settings_handler.dart'; | ||
import 'package:lolisnatcher/src/utils/logger.dart'; | ||
|
||
class DownloadsHandler extends BooruHandler { | ||
DownloadsHandler(super.booru, super.limit); | ||
|
||
@override | ||
String validateTags(String tags) { | ||
return tags; | ||
} | ||
|
||
@override | ||
Future search(String tags, int? pageNumCustom, {bool withCaptchaCheck = true}) async { | ||
// set custom page number | ||
if (pageNumCustom != null) { | ||
pageNum = pageNumCustom; | ||
} | ||
|
||
// validate tags | ||
tags = validateTags(tags.trim()); | ||
|
||
// if tags are different than previous tags, reset fetched | ||
if (prevTags != tags) { | ||
fetched.value = []; | ||
totalCount.value = 0; | ||
} | ||
|
||
// get amount of items before fetching | ||
final int length = fetched.length; | ||
|
||
final newItems = await SettingsHandler.instance.dbHandler.searchDB( | ||
tags, | ||
(pageNum * limit).toString(), | ||
limit.toString(), | ||
'DESC', | ||
'Favourites', | ||
isDownloads: true, | ||
); | ||
|
||
await afterParseResponse(newItems); | ||
prevTags = tags; | ||
|
||
if (fetched.isEmpty || fetched.length == length) { | ||
Logger.Inst().log('dbhandler dbLocked', 'DownloadsHandler', 'search', LogTypes.booruHandlerInfo); | ||
locked = true; | ||
} | ||
|
||
return fetched; | ||
} | ||
|
||
@override | ||
Future<List<String>> tagSearch(String input, {CancelToken? cancelToken}) async { | ||
final List<String> tags = await SettingsHandler.instance.dbHandler.getTags(input, limit); | ||
return tags; | ||
} | ||
|
||
@override | ||
Future<void> searchCount(String input) async { | ||
totalCount.value = await SettingsHandler.instance.dbHandler.searchDBCount( | ||
input, | ||
isDownloads: true, | ||
); | ||
return; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.