Update task manager

This commit is contained in:
2024-02-18 20:52:25 +08:00
parent f9e920cc57
commit b176c8dbb8
13 changed files with 610 additions and 20 deletions

16
lib/utils/parse_url.dart Normal file
View File

@@ -0,0 +1,16 @@
final _galleryRegex = RegExp(r"(g|mpv)/(\d+)/([^/]+)");
(int, String)? parseGalleryUrl(String url) {
final uri = Uri.tryParse(url);
if (uri == null) {
return null;
}
final path = uri.path;
final match = _galleryRegex.firstMatch(path);
if (match == null) {
return null;
}
final gid = int.parse(match.group(2)!);
final token = match.group(3)!;
return (gid, token);
}