mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
chore: bump dart sdk to 3.8 (#20355)
* chore: bump dart sdk to 3.8 * chore: make build * make pigeon * chore: format files --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
9b3718120b
commit
e52b9d15b5
643 changed files with 32561 additions and 35292 deletions
|
|
@ -1,17 +1,6 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
enum ImmichColorPreset {
|
enum ImmichColorPreset { indigo, deepPurple, pink, red, orange, yellow, lime, green, cyan, slateGray }
|
||||||
indigo,
|
|
||||||
deepPurple,
|
|
||||||
pink,
|
|
||||||
red,
|
|
||||||
orange,
|
|
||||||
yellow,
|
|
||||||
lime,
|
|
||||||
green,
|
|
||||||
cyan,
|
|
||||||
slateGray,
|
|
||||||
}
|
|
||||||
|
|
||||||
const ImmichColorPreset defaultColorPreset = ImmichColorPreset.indigo;
|
const ImmichColorPreset defaultColorPreset = ImmichColorPreset.indigo;
|
||||||
const String defaultColorPresetName = "indigo";
|
const String defaultColorPresetName = "indigo";
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,6 @@
|
||||||
enum SortOrder {
|
enum SortOrder { asc, desc }
|
||||||
asc,
|
|
||||||
desc,
|
|
||||||
}
|
|
||||||
|
|
||||||
enum TextSearchType {
|
enum TextSearchType { context, filename, description }
|
||||||
context,
|
|
||||||
filename,
|
|
||||||
description,
|
|
||||||
}
|
|
||||||
|
|
||||||
enum AssetVisibilityEnum { timeline, hidden, archive, locked }
|
enum AssetVisibilityEnum { timeline, hidden, archive, locked }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,511 +2,49 @@ import 'package:flutter/material.dart';
|
||||||
|
|
||||||
const List<ColorFilter> filters = [
|
const List<ColorFilter> filters = [
|
||||||
//Original
|
//Original
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]),
|
||||||
1,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
//Vintage
|
//Vintage
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([0.8, 0.1, 0.1, 0, 20, 0.1, 0.8, 0.1, 0, 20, 0.1, 0.1, 0.8, 0, 20, 0, 0, 0, 1, 0]),
|
||||||
0.8,
|
|
||||||
0.1,
|
|
||||||
0.1,
|
|
||||||
0,
|
|
||||||
20,
|
|
||||||
0.1,
|
|
||||||
0.8,
|
|
||||||
0.1,
|
|
||||||
0,
|
|
||||||
20,
|
|
||||||
0.1,
|
|
||||||
0.1,
|
|
||||||
0.8,
|
|
||||||
0,
|
|
||||||
20,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
//Mood
|
//Mood
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([1.2, 0.1, 0.1, 0, 10, 0.1, 1, 0.1, 0, 10, 0.1, 0.1, 1, 0, 10, 0, 0, 0, 1, 0]),
|
||||||
1.2,
|
|
||||||
0.1,
|
|
||||||
0.1,
|
|
||||||
0,
|
|
||||||
10,
|
|
||||||
0.1,
|
|
||||||
1,
|
|
||||||
0.1,
|
|
||||||
0,
|
|
||||||
10,
|
|
||||||
0.1,
|
|
||||||
0.1,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
10,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
//Crisp
|
//Crisp
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([1.2, 0, 0, 0, 0, 0, 1.2, 0, 0, 0, 0, 0, 1.2, 0, 0, 0, 0, 0, 1, 0]),
|
||||||
1.2,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1.2,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1.2,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
//Cool
|
//Cool
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([0.9, 0, 0.2, 0, 0, 0, 1, 0.1, 0, 0, 0.1, 0, 1.2, 0, 0, 0, 0, 0, 1, 0]),
|
||||||
0.9,
|
|
||||||
0,
|
|
||||||
0.2,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0.1,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0.1,
|
|
||||||
0,
|
|
||||||
1.2,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
//Blush
|
//Blush
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([1.1, 0.1, 0.1, 0, 10, 0.1, 1, 0.1, 0, 10, 0.1, 0.1, 1, 0, 5, 0, 0, 0, 1, 0]),
|
||||||
1.1,
|
|
||||||
0.1,
|
|
||||||
0.1,
|
|
||||||
0,
|
|
||||||
10,
|
|
||||||
0.1,
|
|
||||||
1,
|
|
||||||
0.1,
|
|
||||||
0,
|
|
||||||
10,
|
|
||||||
0.1,
|
|
||||||
0.1,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
5,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
//Sunkissed
|
//Sunkissed
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([1.3, 0, 0.1, 0, 15, 0, 1.1, 0.1, 0, 10, 0, 0, 0.9, 0, 5, 0, 0, 0, 1, 0]),
|
||||||
1.3,
|
|
||||||
0,
|
|
||||||
0.1,
|
|
||||||
0,
|
|
||||||
15,
|
|
||||||
0,
|
|
||||||
1.1,
|
|
||||||
0.1,
|
|
||||||
0,
|
|
||||||
10,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0.9,
|
|
||||||
0,
|
|
||||||
5,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
//Fresh
|
//Fresh
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([1.2, 0, 0, 0, 20, 0, 1.2, 0, 0, 20, 0, 0, 1.1, 0, 20, 0, 0, 0, 1, 0]),
|
||||||
1.2,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
20,
|
|
||||||
0,
|
|
||||||
1.2,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
20,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1.1,
|
|
||||||
0,
|
|
||||||
20,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
//Classic
|
//Classic
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([1.1, 0, -0.1, 0, 10, -0.1, 1.1, 0.1, 0, 5, 0, -0.1, 1.1, 0, 0, 0, 0, 0, 1, 0]),
|
||||||
1.1,
|
|
||||||
0,
|
|
||||||
-0.1,
|
|
||||||
0,
|
|
||||||
10,
|
|
||||||
-0.1,
|
|
||||||
1.1,
|
|
||||||
0.1,
|
|
||||||
0,
|
|
||||||
5,
|
|
||||||
0,
|
|
||||||
-0.1,
|
|
||||||
1.1,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
//Lomo-ish
|
//Lomo-ish
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([1.5, 0, 0.1, 0, 0, 0, 1.45, 0, 0, 0, 0.1, 0, 1.3, 0, 0, 0, 0, 0, 1, 0]),
|
||||||
1.5,
|
|
||||||
0,
|
|
||||||
0.1,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1.45,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0.1,
|
|
||||||
0,
|
|
||||||
1.3,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
//Nashville
|
//Nashville
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([1.2, 0.15, -0.15, 0, 15, 0.1, 1.1, 0.1, 0, 10, -0.05, 0.2, 1.25, 0, 5, 0, 0, 0, 1, 0]),
|
||||||
1.2,
|
|
||||||
0.15,
|
|
||||||
-0.15,
|
|
||||||
0,
|
|
||||||
15,
|
|
||||||
0.1,
|
|
||||||
1.1,
|
|
||||||
0.1,
|
|
||||||
0,
|
|
||||||
10,
|
|
||||||
-0.05,
|
|
||||||
0.2,
|
|
||||||
1.25,
|
|
||||||
0,
|
|
||||||
5,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
//Valencia
|
//Valencia
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([1.15, 0.1, 0.1, 0, 20, 0.1, 1.1, 0, 0, 10, 0.1, 0.1, 1.2, 0, 5, 0, 0, 0, 1, 0]),
|
||||||
1.15,
|
|
||||||
0.1,
|
|
||||||
0.1,
|
|
||||||
0,
|
|
||||||
20,
|
|
||||||
0.1,
|
|
||||||
1.1,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
10,
|
|
||||||
0.1,
|
|
||||||
0.1,
|
|
||||||
1.2,
|
|
||||||
0,
|
|
||||||
5,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
//Clarendon
|
//Clarendon
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([1.2, 0, 0, 0, 10, 0, 1.25, 0, 0, 10, 0, 0, 1.3, 0, 10, 0, 0, 0, 1, 0]),
|
||||||
1.2,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
10,
|
|
||||||
0,
|
|
||||||
1.25,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
10,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1.3,
|
|
||||||
0,
|
|
||||||
10,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
//Moon
|
//Moon
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([0.33, 0.33, 0.33, 0, 0, 0.33, 0.33, 0.33, 0, 0, 0.33, 0.33, 0.33, 0, 0, 0, 0, 0, 1, 0]),
|
||||||
0.33,
|
|
||||||
0.33,
|
|
||||||
0.33,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0.33,
|
|
||||||
0.33,
|
|
||||||
0.33,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0.33,
|
|
||||||
0.33,
|
|
||||||
0.33,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
//Willow
|
//Willow
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([0.5, 0.5, 0.5, 0, 20, 0.5, 0.5, 0.5, 0, 20, 0.5, 0.5, 0.5, 0, 20, 0, 0, 0, 1, 0]),
|
||||||
0.5,
|
|
||||||
0.5,
|
|
||||||
0.5,
|
|
||||||
0,
|
|
||||||
20,
|
|
||||||
0.5,
|
|
||||||
0.5,
|
|
||||||
0.5,
|
|
||||||
0,
|
|
||||||
20,
|
|
||||||
0.5,
|
|
||||||
0.5,
|
|
||||||
0.5,
|
|
||||||
0,
|
|
||||||
20,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
//Kodak
|
//Kodak
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([1.3, 0.1, -0.1, 0, 10, 0, 1.25, 0.1, 0, 10, 0, -0.1, 1.1, 0, 5, 0, 0, 0, 1, 0]),
|
||||||
1.3,
|
|
||||||
0.1,
|
|
||||||
-0.1,
|
|
||||||
0,
|
|
||||||
10,
|
|
||||||
0,
|
|
||||||
1.25,
|
|
||||||
0.1,
|
|
||||||
0,
|
|
||||||
10,
|
|
||||||
0,
|
|
||||||
-0.1,
|
|
||||||
1.1,
|
|
||||||
0,
|
|
||||||
5,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
//Frost
|
//Frost
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([0.8, 0.2, 0.1, 0, 0, 0.2, 1.1, 0.1, 0, 0, 0.1, 0.1, 1.2, 0, 10, 0, 0, 0, 1, 0]),
|
||||||
0.8,
|
|
||||||
0.2,
|
|
||||||
0.1,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0.2,
|
|
||||||
1.1,
|
|
||||||
0.1,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0.1,
|
|
||||||
0.1,
|
|
||||||
1.2,
|
|
||||||
0,
|
|
||||||
10,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
//Night Vision
|
//Night Vision
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([0.1, 0.95, 0.2, 0, 0, 0.1, 1.5, 0.1, 0, 0, 0.2, 0.7, 0, 0, 0, 0, 0, 0, 1, 0]),
|
||||||
0.1,
|
|
||||||
0.95,
|
|
||||||
0.2,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0.1,
|
|
||||||
1.5,
|
|
||||||
0.1,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0.2,
|
|
||||||
0.7,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
//Sunset
|
//Sunset
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([1.5, 0.2, 0, 0, 0, 0.1, 0.9, 0.1, 0, 0, -0.1, -0.2, 1.3, 0, 0, 0, 0, 0, 1, 0]),
|
||||||
1.5,
|
|
||||||
0.2,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0.1,
|
|
||||||
0.9,
|
|
||||||
0.1,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
-0.1,
|
|
||||||
-0.2,
|
|
||||||
1.3,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
//Noir
|
//Noir
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([1.3, -0.3, 0.1, 0, 0, -0.1, 1.2, -0.1, 0, 0, 0.1, -0.2, 1.3, 0, 0, 0, 0, 0, 1, 0]),
|
||||||
1.3,
|
|
||||||
-0.3,
|
|
||||||
0.1,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
-0.1,
|
|
||||||
1.2,
|
|
||||||
-0.1,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0.1,
|
|
||||||
-0.2,
|
|
||||||
1.3,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
//Dreamy
|
//Dreamy
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([1.1, 0.1, 0.1, 0, 0, 0.1, 1.1, 0.1, 0, 0, 0.1, 0.1, 1.1, 0, 15, 0, 0, 0, 1, 0]),
|
||||||
1.1,
|
|
||||||
0.1,
|
|
||||||
0.1,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0.1,
|
|
||||||
1.1,
|
|
||||||
0.1,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0.1,
|
|
||||||
0.1,
|
|
||||||
1.1,
|
|
||||||
0,
|
|
||||||
15,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
//Sepia
|
//Sepia
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([0.393, 0.769, 0.189, 0, 0, 0.349, 0.686, 0.168, 0, 0, 0.272, 0.534, 0.131, 0, 0, 0, 0, 0, 1, 0]),
|
||||||
0.393,
|
|
||||||
0.769,
|
|
||||||
0.189,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0.349,
|
|
||||||
0.686,
|
|
||||||
0.168,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0.272,
|
|
||||||
0.534,
|
|
||||||
0.131,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
//Radium
|
//Radium
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([
|
||||||
1.438,
|
1.438,
|
||||||
|
|
@ -554,212 +92,23 @@ const List<ColorFilter> filters = [
|
||||||
0,
|
0,
|
||||||
]),
|
]),
|
||||||
//Purple Haze
|
//Purple Haze
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([1.3, 0, 1.2, 0, 0, 0, 1.1, 0, 0, 0, 0.2, 0, 1.3, 0, 0, 0, 0, 0, 1, 0]),
|
||||||
1.3,
|
|
||||||
0,
|
|
||||||
1.2,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1.1,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0.2,
|
|
||||||
0,
|
|
||||||
1.3,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
//Lemonade
|
//Lemonade
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([1.2, 0.1, 0, 0, 0, 0, 1.1, 0.2, 0, 0, 0.1, 0, 0.7, 0, 0, 0, 0, 0, 1, 0]),
|
||||||
1.2,
|
|
||||||
0.1,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1.1,
|
|
||||||
0.2,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0.1,
|
|
||||||
0,
|
|
||||||
0.7,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
//Caramel
|
//Caramel
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([1.6, 0.2, 0, 0, 0, 0.1, 1.3, 0.1, 0, 0, 0, 0.1, 0.9, 0, 0, 0, 0, 0, 1, 0]),
|
||||||
1.6,
|
|
||||||
0.2,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0.1,
|
|
||||||
1.3,
|
|
||||||
0.1,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0.1,
|
|
||||||
0.9,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
//Peachy
|
//Peachy
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([1.3, 0.5, 0, 0, 0, 0.2, 1.1, 0.3, 0, 0, 0.1, 0.1, 1.2, 0, 0, 0, 0, 0, 1, 0]),
|
||||||
1.3,
|
|
||||||
0.5,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0.2,
|
|
||||||
1.1,
|
|
||||||
0.3,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0.1,
|
|
||||||
0.1,
|
|
||||||
1.2,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
//Neon
|
//Neon
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([1, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 1, 0]),
|
||||||
1,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
2,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
3,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
//Cold Morning
|
//Cold Morning
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([0.9, 0.1, 0.2, 0, 0, 0, 1, 0.1, 0, 0, 0.1, 0, 1.2, 0, 0, 0, 0, 0, 1, 0]),
|
||||||
0.9,
|
|
||||||
0.1,
|
|
||||||
0.2,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0.1,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0.1,
|
|
||||||
0,
|
|
||||||
1.2,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
//Lush
|
//Lush
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([0.9, 0.2, 0, 0, 0, 0, 1.2, 0, 0, 0, 0, 0, 1.1, 0, 0, 0, 0, 0, 1, 0]),
|
||||||
0.9,
|
|
||||||
0.2,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1.2,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1.1,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
//Urban Neon
|
//Urban Neon
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([1.1, 0, 0.3, 0, 0, 0, 0.9, 0.3, 0, 0, 0.3, 0.1, 1.2, 0, 0, 0, 0, 0, 1, 0]),
|
||||||
1.1,
|
|
||||||
0,
|
|
||||||
0.3,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0.9,
|
|
||||||
0.3,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0.3,
|
|
||||||
0.1,
|
|
||||||
1.2,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
//Monochrome
|
//Monochrome
|
||||||
ColorFilter.matrix([
|
ColorFilter.matrix([0.6, 0.2, 0.2, 0, 0, 0.2, 0.6, 0.2, 0, 0, 0.2, 0.2, 0.7, 0, 0, 0, 0, 0, 1, 0]),
|
||||||
0.6,
|
|
||||||
0.2,
|
|
||||||
0.2,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0.2,
|
|
||||||
0.6,
|
|
||||||
0.2,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0.2,
|
|
||||||
0.2,
|
|
||||||
0.7,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
]),
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const List<String> filterNames = [
|
const List<String> filterNames = [
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,4 @@ const Map<String, Locale> locales = {
|
||||||
|
|
||||||
const String translationsPath = 'assets/i18n';
|
const String translationsPath = 'assets/i18n';
|
||||||
|
|
||||||
const List<Locale> localesNotSupportedByOverpass = [
|
const List<Locale> localesNotSupportedByOverpass = [Locale('el', 'GR'), Locale('sr', 'Cyrl')];
|
||||||
Locale('el', 'GR'),
|
|
||||||
Locale('sr', 'Cyrl'),
|
|
||||||
];
|
|
||||||
|
|
|
||||||
|
|
@ -9,11 +9,7 @@ enum AssetType {
|
||||||
audio,
|
audio,
|
||||||
}
|
}
|
||||||
|
|
||||||
enum AssetState {
|
enum AssetState { local, remote, merged }
|
||||||
local,
|
|
||||||
remote,
|
|
||||||
merged,
|
|
||||||
}
|
|
||||||
|
|
||||||
sealed class BaseAsset {
|
sealed class BaseAsset {
|
||||||
final String name;
|
final String name;
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,6 @@
|
||||||
part of 'base_asset.model.dart';
|
part of 'base_asset.model.dart';
|
||||||
|
|
||||||
enum AssetVisibility {
|
enum AssetVisibility { timeline, hidden, archive, locked }
|
||||||
timeline,
|
|
||||||
hidden,
|
|
||||||
archive,
|
|
||||||
locked,
|
|
||||||
}
|
|
||||||
|
|
||||||
// Model for an asset stored in the server
|
// Model for an asset stored in the server
|
||||||
class RemoteAsset extends BaseAsset {
|
class RemoteAsset extends BaseAsset {
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,7 @@ class DeviceAsset {
|
||||||
final Uint8List hash;
|
final Uint8List hash;
|
||||||
final DateTime modifiedTime;
|
final DateTime modifiedTime;
|
||||||
|
|
||||||
const DeviceAsset({
|
const DeviceAsset({required this.assetId, required this.hash, required this.modifiedTime});
|
||||||
required this.assetId,
|
|
||||||
required this.hash,
|
|
||||||
required this.modifiedTime,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(covariant DeviceAsset other) {
|
bool operator ==(covariant DeviceAsset other) {
|
||||||
|
|
@ -28,11 +24,7 @@ class DeviceAsset {
|
||||||
return 'DeviceAsset(assetId: $assetId, hash: $hash, modifiedTime: $modifiedTime)';
|
return 'DeviceAsset(assetId: $assetId, hash: $hash, modifiedTime: $modifiedTime)';
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceAsset copyWith({
|
DeviceAsset copyWith({String? assetId, Uint8List? hash, DateTime? modifiedTime}) {
|
||||||
String? assetId,
|
|
||||||
Uint8List? hash,
|
|
||||||
DateTime? modifiedTime,
|
|
||||||
}) {
|
|
||||||
return DeviceAsset(
|
return DeviceAsset(
|
||||||
assetId: assetId ?? this.assetId,
|
assetId: assetId ?? this.assetId,
|
||||||
hash: hash ?? this.hash,
|
hash: hash ?? this.hash,
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,5 @@
|
||||||
/// Log levels according to dart logging [Level]
|
/// Log levels according to dart logging [Level]
|
||||||
enum LogLevel {
|
enum LogLevel { all, finest, finer, fine, config, info, warning, severe, shout, off }
|
||||||
all,
|
|
||||||
finest,
|
|
||||||
finer,
|
|
||||||
fine,
|
|
||||||
config,
|
|
||||||
info,
|
|
||||||
warning,
|
|
||||||
severe,
|
|
||||||
shout,
|
|
||||||
off,
|
|
||||||
}
|
|
||||||
|
|
||||||
class LogMessage {
|
class LogMessage {
|
||||||
final String message;
|
final String message;
|
||||||
|
|
|
||||||
|
|
@ -13,28 +13,18 @@ enum MemoryTypeEnum {
|
||||||
class MemoryData {
|
class MemoryData {
|
||||||
final int year;
|
final int year;
|
||||||
|
|
||||||
const MemoryData({
|
const MemoryData({required this.year});
|
||||||
required this.year,
|
|
||||||
});
|
|
||||||
|
|
||||||
MemoryData copyWith({
|
MemoryData copyWith({int? year}) {
|
||||||
int? year,
|
return MemoryData(year: year ?? this.year);
|
||||||
}) {
|
|
||||||
return MemoryData(
|
|
||||||
year: year ?? this.year,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return <String, dynamic>{
|
return <String, dynamic>{'year': year};
|
||||||
'year': year,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
factory MemoryData.fromMap(Map<String, dynamic> map) {
|
factory MemoryData.fromMap(Map<String, dynamic> map) {
|
||||||
return MemoryData(
|
return MemoryData(year: map['year'] as int);
|
||||||
year: map['year'] as int,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String toJson() => json.encode(toMap());
|
String toJson() => json.encode(toMap());
|
||||||
|
|
|
||||||
|
|
@ -5,21 +5,12 @@ class SearchResult {
|
||||||
final List<BaseAsset> assets;
|
final List<BaseAsset> assets;
|
||||||
final int? nextPage;
|
final int? nextPage;
|
||||||
|
|
||||||
const SearchResult({
|
const SearchResult({required this.assets, this.nextPage});
|
||||||
required this.assets,
|
|
||||||
this.nextPage,
|
|
||||||
});
|
|
||||||
|
|
||||||
int get totalAssets => assets.length;
|
int get totalAssets => assets.length;
|
||||||
|
|
||||||
SearchResult copyWith({
|
SearchResult copyWith({List<BaseAsset>? assets, int? nextPage}) {
|
||||||
List<BaseAsset>? assets,
|
return SearchResult(assets: assets ?? this.assets, nextPage: nextPage ?? this.nextPage);
|
||||||
int? nextPage,
|
|
||||||
}) {
|
|
||||||
return SearchResult(
|
|
||||||
assets: assets ?? this.assets,
|
|
||||||
nextPage: nextPage ?? this.nextPage,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,7 @@ enum Setting<T> {
|
||||||
loadOriginalVideo<bool>(StoreKey.loadOriginalVideo, false),
|
loadOriginalVideo<bool>(StoreKey.loadOriginalVideo, false),
|
||||||
preferRemoteImage<bool>(StoreKey.preferRemoteImage, false),
|
preferRemoteImage<bool>(StoreKey.preferRemoteImage, false),
|
||||||
advancedTroubleshooting<bool>(StoreKey.advancedTroubleshooting, false),
|
advancedTroubleshooting<bool>(StoreKey.advancedTroubleshooting, false),
|
||||||
enableBackup<bool>(StoreKey.enableBackup, false),
|
enableBackup<bool>(StoreKey.enableBackup, false);
|
||||||
;
|
|
||||||
|
|
||||||
const Setting(this.storeKey, this.defaultValue);
|
const Setting(this.storeKey, this.defaultValue);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,13 +14,7 @@ class Stack {
|
||||||
required this.primaryAssetId,
|
required this.primaryAssetId,
|
||||||
});
|
});
|
||||||
|
|
||||||
Stack copyWith({
|
Stack copyWith({String? id, DateTime? createdAt, DateTime? updatedAt, String? ownerId, String? primaryAssetId}) {
|
||||||
String? id,
|
|
||||||
DateTime? createdAt,
|
|
||||||
DateTime? updatedAt,
|
|
||||||
String? ownerId,
|
|
||||||
String? primaryAssetId,
|
|
||||||
}) {
|
|
||||||
return Stack(
|
return Stack(
|
||||||
id: id ?? this.id,
|
id: id ?? this.id,
|
||||||
createdAt: createdAt ?? this.createdAt,
|
createdAt: createdAt ?? this.createdAt,
|
||||||
|
|
@ -63,11 +57,7 @@ class StackResponse {
|
||||||
final String primaryAssetId;
|
final String primaryAssetId;
|
||||||
final List<String> assetIds;
|
final List<String> assetIds;
|
||||||
|
|
||||||
const StackResponse({
|
const StackResponse({required this.id, required this.primaryAssetId, required this.assetIds});
|
||||||
required this.id,
|
|
||||||
required this.primaryAssetId,
|
|
||||||
required this.assetIds,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(covariant StackResponse other) {
|
bool operator ==(covariant StackResponse other) {
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,8 @@
|
||||||
import 'package:immich_mobile/domain/utils/event_stream.dart';
|
import 'package:immich_mobile/domain/utils/event_stream.dart';
|
||||||
|
|
||||||
enum GroupAssetsBy {
|
enum GroupAssetsBy { day, month, auto, none }
|
||||||
day,
|
|
||||||
month,
|
|
||||||
auto,
|
|
||||||
none;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum HeaderType {
|
enum HeaderType { none, month, day, monthAndDay }
|
||||||
none,
|
|
||||||
month,
|
|
||||||
day,
|
|
||||||
monthAndDay;
|
|
||||||
}
|
|
||||||
|
|
||||||
class Bucket {
|
class Bucket {
|
||||||
final int assetCount;
|
final int assetCount;
|
||||||
|
|
|
||||||
|
|
@ -74,22 +74,21 @@ quotaSizeInBytes: $quotaSizeInBytes,
|
||||||
bool? isPartnerSharedWith,
|
bool? isPartnerSharedWith,
|
||||||
int? quotaUsageInBytes,
|
int? quotaUsageInBytes,
|
||||||
int? quotaSizeInBytes,
|
int? quotaSizeInBytes,
|
||||||
}) =>
|
}) => UserDto(
|
||||||
UserDto(
|
id: id ?? this.id,
|
||||||
id: id ?? this.id,
|
email: email ?? this.email,
|
||||||
email: email ?? this.email,
|
name: name ?? this.name,
|
||||||
name: name ?? this.name,
|
isAdmin: isAdmin ?? this.isAdmin,
|
||||||
isAdmin: isAdmin ?? this.isAdmin,
|
updatedAt: updatedAt ?? this.updatedAt,
|
||||||
updatedAt: updatedAt ?? this.updatedAt,
|
profileImagePath: profileImagePath ?? this.profileImagePath,
|
||||||
profileImagePath: profileImagePath ?? this.profileImagePath,
|
avatarColor: avatarColor ?? this.avatarColor,
|
||||||
avatarColor: avatarColor ?? this.avatarColor,
|
memoryEnabled: memoryEnabled ?? this.memoryEnabled,
|
||||||
memoryEnabled: memoryEnabled ?? this.memoryEnabled,
|
inTimeline: inTimeline ?? this.inTimeline,
|
||||||
inTimeline: inTimeline ?? this.inTimeline,
|
isPartnerSharedBy: isPartnerSharedBy ?? this.isPartnerSharedBy,
|
||||||
isPartnerSharedBy: isPartnerSharedBy ?? this.isPartnerSharedBy,
|
isPartnerSharedWith: isPartnerSharedWith ?? this.isPartnerSharedWith,
|
||||||
isPartnerSharedWith: isPartnerSharedWith ?? this.isPartnerSharedWith,
|
quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes,
|
||||||
quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes,
|
quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes,
|
||||||
quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes,
|
);
|
||||||
);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(covariant UserDto other) {
|
bool operator ==(covariant UserDto other) {
|
||||||
|
|
@ -143,13 +142,7 @@ class PartnerUserDto {
|
||||||
this.profileImagePath,
|
this.profileImagePath,
|
||||||
});
|
});
|
||||||
|
|
||||||
PartnerUserDto copyWith({
|
PartnerUserDto copyWith({String? id, String? email, String? name, bool? inTimeline, String? profileImagePath}) {
|
||||||
String? id,
|
|
||||||
String? email,
|
|
||||||
String? name,
|
|
||||||
bool? inTimeline,
|
|
||||||
String? profileImagePath,
|
|
||||||
}) {
|
|
||||||
return PartnerUserDto(
|
return PartnerUserDto(
|
||||||
id: id ?? this.id,
|
id: id ?? this.id,
|
||||||
email: email ?? this.email,
|
email: email ?? this.email,
|
||||||
|
|
|
||||||
|
|
@ -24,17 +24,17 @@ enum AvatarColor {
|
||||||
const AvatarColor(this.value);
|
const AvatarColor(this.value);
|
||||||
|
|
||||||
Color toColor({bool isDarkTheme = false}) => switch (this) {
|
Color toColor({bool isDarkTheme = false}) => switch (this) {
|
||||||
AvatarColor.primary => isDarkTheme ? const Color(0xFFABCBFA) : const Color(0xFF4250AF),
|
AvatarColor.primary => isDarkTheme ? const Color(0xFFABCBFA) : const Color(0xFF4250AF),
|
||||||
AvatarColor.pink => const Color.fromARGB(255, 244, 114, 182),
|
AvatarColor.pink => const Color.fromARGB(255, 244, 114, 182),
|
||||||
AvatarColor.red => const Color.fromARGB(255, 239, 68, 68),
|
AvatarColor.red => const Color.fromARGB(255, 239, 68, 68),
|
||||||
AvatarColor.yellow => const Color.fromARGB(255, 234, 179, 8),
|
AvatarColor.yellow => const Color.fromARGB(255, 234, 179, 8),
|
||||||
AvatarColor.blue => const Color.fromARGB(255, 59, 130, 246),
|
AvatarColor.blue => const Color.fromARGB(255, 59, 130, 246),
|
||||||
AvatarColor.green => const Color.fromARGB(255, 22, 163, 74),
|
AvatarColor.green => const Color.fromARGB(255, 22, 163, 74),
|
||||||
AvatarColor.purple => const Color.fromARGB(255, 147, 51, 234),
|
AvatarColor.purple => const Color.fromARGB(255, 147, 51, 234),
|
||||||
AvatarColor.orange => const Color.fromARGB(255, 234, 88, 12),
|
AvatarColor.orange => const Color.fromARGB(255, 234, 88, 12),
|
||||||
AvatarColor.gray => const Color.fromARGB(255, 75, 85, 99),
|
AvatarColor.gray => const Color.fromARGB(255, 75, 85, 99),
|
||||||
AvatarColor.amber => const Color.fromARGB(255, 217, 119, 6),
|
AvatarColor.amber => const Color.fromARGB(255, 217, 119, 6),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
class Onboarding {
|
class Onboarding {
|
||||||
|
|
@ -193,17 +193,9 @@ class License {
|
||||||
final String activationKey;
|
final String activationKey;
|
||||||
final String licenseKey;
|
final String licenseKey;
|
||||||
|
|
||||||
const License({
|
const License({required this.activatedAt, required this.activationKey, required this.licenseKey});
|
||||||
required this.activatedAt,
|
|
||||||
required this.activationKey,
|
|
||||||
required this.licenseKey,
|
|
||||||
});
|
|
||||||
|
|
||||||
License copyWith({
|
License copyWith({DateTime? activatedAt, String? activationKey, String? licenseKey}) {
|
||||||
DateTime? activatedAt,
|
|
||||||
String? activationKey,
|
|
||||||
String? licenseKey,
|
|
||||||
}) {
|
|
||||||
return License(
|
return License(
|
||||||
activatedAt: activatedAt ?? this.activatedAt,
|
activatedAt: activatedAt ?? this.activatedAt,
|
||||||
activationKey: activationKey ?? this.activationKey,
|
activationKey: activationKey ?? this.activationKey,
|
||||||
|
|
@ -255,16 +247,11 @@ class UserMetadata {
|
||||||
final Preferences? preferences;
|
final Preferences? preferences;
|
||||||
final License? license;
|
final License? license;
|
||||||
|
|
||||||
const UserMetadata({
|
const UserMetadata({required this.userId, required this.key, this.onboarding, this.preferences, this.license})
|
||||||
required this.userId,
|
: assert(
|
||||||
required this.key,
|
onboarding != null || preferences != null || license != null,
|
||||||
this.onboarding,
|
'One of onboarding, preferences and license must be provided',
|
||||||
this.preferences,
|
);
|
||||||
this.license,
|
|
||||||
}) : assert(
|
|
||||||
onboarding != null || preferences != null || license != null,
|
|
||||||
'One of onboarding, preferences and license must be provided',
|
|
||||||
);
|
|
||||||
|
|
||||||
UserMetadata copyWith({
|
UserMetadata copyWith({
|
||||||
String? userId,
|
String? userId,
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,9 @@ class AssetService {
|
||||||
const AssetService({
|
const AssetService({
|
||||||
required RemoteAssetRepository remoteAssetRepository,
|
required RemoteAssetRepository remoteAssetRepository,
|
||||||
required DriftLocalAssetRepository localAssetRepository,
|
required DriftLocalAssetRepository localAssetRepository,
|
||||||
}) : _remoteAssetRepository = remoteAssetRepository,
|
}) : _remoteAssetRepository = remoteAssetRepository,
|
||||||
_localAssetRepository = localAssetRepository,
|
_localAssetRepository = localAssetRepository,
|
||||||
_platform = const LocalPlatform();
|
_platform = const LocalPlatform();
|
||||||
|
|
||||||
Stream<BaseAsset?> watchAsset(BaseAsset asset) {
|
Stream<BaseAsset?> watchAsset(BaseAsset asset) {
|
||||||
final id = asset is LocalAsset ? asset.id : (asset as RemoteAsset).id;
|
final id = asset is LocalAsset ? asset.id : (asset as RemoteAsset).id;
|
||||||
|
|
|
||||||
|
|
@ -25,19 +25,16 @@ class HashService {
|
||||||
required NativeSyncApi nativeSyncApi,
|
required NativeSyncApi nativeSyncApi,
|
||||||
this.batchSizeLimit = kBatchHashSizeLimit,
|
this.batchSizeLimit = kBatchHashSizeLimit,
|
||||||
this.batchFileLimit = kBatchHashFileLimit,
|
this.batchFileLimit = kBatchHashFileLimit,
|
||||||
}) : _localAlbumRepository = localAlbumRepository,
|
}) : _localAlbumRepository = localAlbumRepository,
|
||||||
_localAssetRepository = localAssetRepository,
|
_localAssetRepository = localAssetRepository,
|
||||||
_storageRepository = storageRepository,
|
_storageRepository = storageRepository,
|
||||||
_nativeSyncApi = nativeSyncApi;
|
_nativeSyncApi = nativeSyncApi;
|
||||||
|
|
||||||
Future<void> hashAssets() async {
|
Future<void> hashAssets() async {
|
||||||
final Stopwatch stopwatch = Stopwatch()..start();
|
final Stopwatch stopwatch = Stopwatch()..start();
|
||||||
// Sorted by backupSelection followed by isCloud
|
// Sorted by backupSelection followed by isCloud
|
||||||
final localAlbums = await _localAlbumRepository.getAll(
|
final localAlbums = await _localAlbumRepository.getAll(
|
||||||
sortBy: {
|
sortBy: {SortLocalAlbumsBy.backupSelection, SortLocalAlbumsBy.isIosSharedAlbum},
|
||||||
SortLocalAlbumsBy.backupSelection,
|
|
||||||
SortLocalAlbumsBy.isIosSharedAlbum,
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
|
|
||||||
for (final album in localAlbums) {
|
for (final album in localAlbums) {
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,9 @@ class LocalSyncService {
|
||||||
required DriftLocalAlbumRepository localAlbumRepository,
|
required DriftLocalAlbumRepository localAlbumRepository,
|
||||||
required NativeSyncApi nativeSyncApi,
|
required NativeSyncApi nativeSyncApi,
|
||||||
Platform? platform,
|
Platform? platform,
|
||||||
}) : _localAlbumRepository = localAlbumRepository,
|
}) : _localAlbumRepository = localAlbumRepository,
|
||||||
_nativeSyncApi = nativeSyncApi,
|
_nativeSyncApi = nativeSyncApi,
|
||||||
_platform = platform ?? const LocalPlatform();
|
_platform = platform ?? const LocalPlatform();
|
||||||
|
|
||||||
Future<void> sync({bool full = false}) async {
|
Future<void> sync({bool full = false}) async {
|
||||||
final Stopwatch stopwatch = Stopwatch()..start();
|
final Stopwatch stopwatch = Stopwatch()..start();
|
||||||
|
|
@ -70,9 +70,7 @@ class LocalSyncService {
|
||||||
for (final album in cloudAlbums) {
|
for (final album in cloudAlbums) {
|
||||||
final dbAlbum = dbAlbums.firstWhereOrNull((a) => a.id == album.id);
|
final dbAlbum = dbAlbums.firstWhereOrNull((a) => a.id == album.id);
|
||||||
if (dbAlbum == null) {
|
if (dbAlbum == null) {
|
||||||
_log.warning(
|
_log.warning("Cloud album ${album.name} not found in local database. Skipping sync.");
|
||||||
"Cloud album ${album.name} not found in local database. Skipping sync.",
|
|
||||||
);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
await updateAlbum(dbAlbum, album);
|
await updateAlbum(dbAlbum, album);
|
||||||
|
|
@ -120,10 +118,7 @@ class LocalSyncService {
|
||||||
|
|
||||||
final assets = album.assetCount > 0 ? await _nativeSyncApi.getAssetsForAlbum(album.id) : <PlatformAsset>[];
|
final assets = album.assetCount > 0 ? await _nativeSyncApi.getAssetsForAlbum(album.id) : <PlatformAsset>[];
|
||||||
|
|
||||||
await _localAlbumRepository.upsert(
|
await _localAlbumRepository.upsert(album, toUpsert: assets.toLocalAssets());
|
||||||
album,
|
|
||||||
toUpsert: assets.toLocalAssets(),
|
|
||||||
);
|
|
||||||
_log.fine("Successfully added device album ${album.name}");
|
_log.fine("Successfully added device album ${album.name}");
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
_log.warning("Error while adding device album", e, s);
|
_log.warning("Error while adding device album", e, s);
|
||||||
|
|
@ -146,9 +141,7 @@ class LocalSyncService {
|
||||||
_log.fine("Syncing device album ${dbAlbum.name}");
|
_log.fine("Syncing device album ${dbAlbum.name}");
|
||||||
|
|
||||||
if (_albumsEqual(deviceAlbum, dbAlbum)) {
|
if (_albumsEqual(deviceAlbum, dbAlbum)) {
|
||||||
_log.fine(
|
_log.fine("Device album ${dbAlbum.name} has not changed. Skipping sync.");
|
||||||
"Device album ${dbAlbum.name} has not changed. Skipping sync.",
|
|
||||||
);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -172,10 +165,7 @@ class LocalSyncService {
|
||||||
@visibleForTesting
|
@visibleForTesting
|
||||||
// The [deviceAlbum] is expected to be refreshed before calling this method
|
// The [deviceAlbum] is expected to be refreshed before calling this method
|
||||||
// with modified time and asset count
|
// with modified time and asset count
|
||||||
Future<bool> checkAddition(
|
Future<bool> checkAddition(LocalAlbum dbAlbum, LocalAlbum deviceAlbum) async {
|
||||||
LocalAlbum dbAlbum,
|
|
||||||
LocalAlbum deviceAlbum,
|
|
||||||
) async {
|
|
||||||
try {
|
try {
|
||||||
_log.fine("Fast syncing device album ${dbAlbum.name}");
|
_log.fine("Fast syncing device album ${dbAlbum.name}");
|
||||||
// Assets has been modified
|
// Assets has been modified
|
||||||
|
|
@ -189,9 +179,7 @@ class LocalSyncService {
|
||||||
|
|
||||||
// Early return if no new assets were found
|
// Early return if no new assets were found
|
||||||
if (newAssetsCount == 0) {
|
if (newAssetsCount == 0) {
|
||||||
_log.fine(
|
_log.fine("No new assets found despite album having changes. Proceeding to full sync for ${dbAlbum.name}");
|
||||||
"No new assets found despite album having changes. Proceeding to full sync for ${dbAlbum.name}",
|
|
||||||
);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -201,10 +189,7 @@ class LocalSyncService {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
final newAssets = await _nativeSyncApi.getAssetsForAlbum(
|
final newAssets = await _nativeSyncApi.getAssetsForAlbum(deviceAlbum.id, updatedTimeCond: updatedTime);
|
||||||
deviceAlbum.id,
|
|
||||||
updatedTimeCond: updatedTime,
|
|
||||||
);
|
|
||||||
|
|
||||||
await _localAlbumRepository.upsert(
|
await _localAlbumRepository.upsert(
|
||||||
deviceAlbum.copyWith(backupSelection: dbAlbum.backupSelection),
|
deviceAlbum.copyWith(backupSelection: dbAlbum.backupSelection),
|
||||||
|
|
@ -229,9 +214,7 @@ class LocalSyncService {
|
||||||
final assetsInDb = dbAlbum.assetCount > 0 ? await _localAlbumRepository.getAssets(dbAlbum.id) : <LocalAsset>[];
|
final assetsInDb = dbAlbum.assetCount > 0 ? await _localAlbumRepository.getAssets(dbAlbum.id) : <LocalAsset>[];
|
||||||
|
|
||||||
if (deviceAlbum.assetCount == 0) {
|
if (deviceAlbum.assetCount == 0) {
|
||||||
_log.fine(
|
_log.fine("Device album ${deviceAlbum.name} is empty. Removing assets from DB.");
|
||||||
"Device album ${deviceAlbum.name} is empty. Removing assets from DB.",
|
|
||||||
);
|
|
||||||
await _localAlbumRepository.upsert(
|
await _localAlbumRepository.upsert(
|
||||||
deviceAlbum.copyWith(backupSelection: dbAlbum.backupSelection),
|
deviceAlbum.copyWith(backupSelection: dbAlbum.backupSelection),
|
||||||
toDelete: assetsInDb.map((a) => a.id),
|
toDelete: assetsInDb.map((a) => a.id),
|
||||||
|
|
@ -239,18 +222,11 @@ class LocalSyncService {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
final updatedDeviceAlbum = deviceAlbum.copyWith(
|
final updatedDeviceAlbum = deviceAlbum.copyWith(backupSelection: dbAlbum.backupSelection);
|
||||||
backupSelection: dbAlbum.backupSelection,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (dbAlbum.assetCount == 0) {
|
if (dbAlbum.assetCount == 0) {
|
||||||
_log.fine(
|
_log.fine("Device album ${deviceAlbum.name} is empty. Adding assets to DB.");
|
||||||
"Device album ${deviceAlbum.name} is empty. Adding assets to DB.",
|
await _localAlbumRepository.upsert(updatedDeviceAlbum, toUpsert: assetsInDevice);
|
||||||
);
|
|
||||||
await _localAlbumRepository.upsert(
|
|
||||||
updatedDeviceAlbum,
|
|
||||||
toUpsert: assetsInDevice,
|
|
||||||
);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -282,18 +258,12 @@ class LocalSyncService {
|
||||||
);
|
);
|
||||||
|
|
||||||
if (assetsToUpsert.isEmpty && assetsToDelete.isEmpty) {
|
if (assetsToUpsert.isEmpty && assetsToDelete.isEmpty) {
|
||||||
_log.fine(
|
_log.fine("No asset changes detected in album ${deviceAlbum.name}. Updating metadata.");
|
||||||
"No asset changes detected in album ${deviceAlbum.name}. Updating metadata.",
|
|
||||||
);
|
|
||||||
_localAlbumRepository.upsert(updatedDeviceAlbum);
|
_localAlbumRepository.upsert(updatedDeviceAlbum);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
await _localAlbumRepository.upsert(
|
await _localAlbumRepository.upsert(updatedDeviceAlbum, toUpsert: assetsToUpsert, toDelete: assetsToDelete);
|
||||||
updatedDeviceAlbum,
|
|
||||||
toUpsert: assetsToUpsert,
|
|
||||||
toDelete: assetsToDelete,
|
|
||||||
);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
|
|
|
||||||
|
|
@ -61,11 +61,7 @@ class LogService {
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
LogService._(
|
LogService._(this._logRepository, this._storeRepository, this._shouldBuffer) {
|
||||||
this._logRepository,
|
|
||||||
this._storeRepository,
|
|
||||||
this._shouldBuffer,
|
|
||||||
) {
|
|
||||||
_logSubscription = Logger.root.onRecord.listen(_handleLogRecord);
|
_logSubscription = Logger.root.onRecord.listen(_handleLogRecord);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -89,10 +85,7 @@ class LogService {
|
||||||
|
|
||||||
if (_shouldBuffer) {
|
if (_shouldBuffer) {
|
||||||
_msgBuffer.add(record);
|
_msgBuffer.add(record);
|
||||||
_flushTimer ??= Timer(
|
_flushTimer ??= Timer(const Duration(seconds: 5), () => unawaited(flushBuffer()));
|
||||||
const Duration(seconds: 5),
|
|
||||||
() => unawaited(flushBuffer()),
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
unawaited(_logRepository.insert(record));
|
unawaited(_logRepository.insert(record));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,7 @@ class DriftPartnerService {
|
||||||
final DriftPartnerRepository _driftPartnerRepository;
|
final DriftPartnerRepository _driftPartnerRepository;
|
||||||
final PartnerApiRepository _partnerApiRepository;
|
final PartnerApiRepository _partnerApiRepository;
|
||||||
|
|
||||||
const DriftPartnerService(
|
const DriftPartnerService(this._driftPartnerRepository, this._partnerApiRepository);
|
||||||
this._driftPartnerRepository,
|
|
||||||
this._partnerApiRepository,
|
|
||||||
);
|
|
||||||
|
|
||||||
Future<List<PartnerUserDto>> getSharedWith(String userId) {
|
Future<List<PartnerUserDto>> getSharedWith(String userId) {
|
||||||
return _driftPartnerRepository.getSharedWith(userId);
|
return _driftPartnerRepository.getSharedWith(userId);
|
||||||
|
|
@ -20,9 +17,7 @@ class DriftPartnerService {
|
||||||
return _driftPartnerRepository.getSharedBy(userId);
|
return _driftPartnerRepository.getSharedBy(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<List<PartnerUserDto>> getAvailablePartners(
|
Future<List<PartnerUserDto>> getAvailablePartners(String currentUserId) async {
|
||||||
String currentUserId,
|
|
||||||
) async {
|
|
||||||
final otherUsers = await _driftPartnerRepository.getAvailablePartners(currentUserId);
|
final otherUsers = await _driftPartnerRepository.getAvailablePartners(currentUserId);
|
||||||
final currentPartners = await _driftPartnerRepository.getSharedBy(currentUserId);
|
final currentPartners = await _driftPartnerRepository.getSharedBy(currentUserId);
|
||||||
final available = otherUsers.where((user) {
|
final available = otherUsers.where((user) {
|
||||||
|
|
@ -39,10 +34,7 @@ class DriftPartnerService {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await _partnerApiRepository.update(
|
await _partnerApiRepository.update(partnerId, inTimeline: !partner.inTimeline);
|
||||||
partnerId,
|
|
||||||
inTimeline: !partner.inTimeline,
|
|
||||||
);
|
|
||||||
|
|
||||||
await _driftPartnerRepository.toggleShowInTimeline(partner, userId);
|
await _driftPartnerRepository.toggleShowInTimeline(partner, userId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,11 +26,7 @@ class RemoteAlbumService {
|
||||||
return _repository.get(albumId);
|
return _repository.get(albumId);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<RemoteAlbum> sortAlbums(
|
List<RemoteAlbum> sortAlbums(List<RemoteAlbum> albums, RemoteAlbumSortMode sortMode, {bool isReverse = false}) {
|
||||||
List<RemoteAlbum> albums,
|
|
||||||
RemoteAlbumSortMode sortMode, {
|
|
||||||
bool isReverse = false,
|
|
||||||
}) {
|
|
||||||
return sortMode.sortFn(albums, isReverse);
|
return sortMode.sortFn(albums, isReverse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -69,16 +65,8 @@ class RemoteAlbumService {
|
||||||
return filtered;
|
return filtered;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<RemoteAlbum> createAlbum({
|
Future<RemoteAlbum> createAlbum({required String title, required List<String> assetIds, String? description}) async {
|
||||||
required String title,
|
final album = await _albumApiRepository.createDriftAlbum(title, description: description, assetIds: assetIds);
|
||||||
required List<String> assetIds,
|
|
||||||
String? description,
|
|
||||||
}) async {
|
|
||||||
final album = await _albumApiRepository.createDriftAlbum(
|
|
||||||
title,
|
|
||||||
description: description,
|
|
||||||
assetIds: assetIds,
|
|
||||||
);
|
|
||||||
|
|
||||||
await _repository.create(album, assetIds);
|
await _repository.create(album, assetIds);
|
||||||
|
|
||||||
|
|
@ -120,14 +108,8 @@ class RemoteAlbumService {
|
||||||
return _repository.getAssets(albumId);
|
return _repository.getAssets(albumId);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<int> addAssets({
|
Future<int> addAssets({required String albumId, required List<String> assetIds}) async {
|
||||||
required String albumId,
|
final album = await _albumApiRepository.addAssets(albumId, assetIds);
|
||||||
required List<String> assetIds,
|
|
||||||
}) async {
|
|
||||||
final album = await _albumApiRepository.addAssets(
|
|
||||||
albumId,
|
|
||||||
assetIds,
|
|
||||||
);
|
|
||||||
|
|
||||||
await _repository.addAssets(albumId, album.added);
|
await _repository.addAssets(albumId, album.added);
|
||||||
|
|
||||||
|
|
@ -140,10 +122,7 @@ class RemoteAlbumService {
|
||||||
await _repository.deleteAlbum(albumId);
|
await _repository.deleteAlbum(albumId);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> addUsers({
|
Future<void> addUsers({required String albumId, required List<String> userIds}) async {
|
||||||
required String albumId,
|
|
||||||
required List<String> userIds,
|
|
||||||
}) async {
|
|
||||||
await _albumApiRepository.addUsers(albumId, userIds);
|
await _albumApiRepository.addUsers(albumId, userIds);
|
||||||
|
|
||||||
return _repository.addUsers(albumId, userIds);
|
return _repository.addUsers(albumId, userIds);
|
||||||
|
|
|
||||||
|
|
@ -83,10 +83,10 @@ extension on AssetResponseDto {
|
||||||
|
|
||||||
extension on AssetTypeEnum {
|
extension on AssetTypeEnum {
|
||||||
AssetType toAssetType() => switch (this) {
|
AssetType toAssetType() => switch (this) {
|
||||||
AssetTypeEnum.IMAGE => AssetType.image,
|
AssetTypeEnum.IMAGE => AssetType.image,
|
||||||
AssetTypeEnum.VIDEO => AssetType.video,
|
AssetTypeEnum.VIDEO => AssetType.video,
|
||||||
AssetTypeEnum.AUDIO => AssetType.audio,
|
AssetTypeEnum.AUDIO => AssetType.audio,
|
||||||
AssetTypeEnum.OTHER => AssetType.other,
|
AssetTypeEnum.OTHER => AssetType.other,
|
||||||
_ => throw Exception('Unknown AssetType value: $this'),
|
_ => throw Exception('Unknown AssetType value: $this'),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,16 +24,12 @@ class StoreService {
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Replace the implementation with the one from create after removing the typedef
|
// TODO: Replace the implementation with the one from create after removing the typedef
|
||||||
static Future<StoreService> init({
|
static Future<StoreService> init({required IsarStoreRepository storeRepository}) async {
|
||||||
required IsarStoreRepository storeRepository,
|
|
||||||
}) async {
|
|
||||||
_instance ??= await create(storeRepository: storeRepository);
|
_instance ??= await create(storeRepository: storeRepository);
|
||||||
return _instance!;
|
return _instance!;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<StoreService> create({
|
static Future<StoreService> create({required IsarStoreRepository storeRepository}) async {
|
||||||
required IsarStoreRepository storeRepository,
|
|
||||||
}) async {
|
|
||||||
final instance = StoreService._(storeRepository: storeRepository);
|
final instance = StoreService._(storeRepository: storeRepository);
|
||||||
await instance._populateCache();
|
await instance._populateCache();
|
||||||
instance._storeUpdateSubscription = instance._listenForChange();
|
instance._storeUpdateSubscription = instance._listenForChange();
|
||||||
|
|
@ -48,8 +44,8 @@ class StoreService {
|
||||||
}
|
}
|
||||||
|
|
||||||
StreamSubscription<StoreDto> _listenForChange() => _storeRepository.watchAll().listen((event) {
|
StreamSubscription<StoreDto> _listenForChange() => _storeRepository.watchAll().listen((event) {
|
||||||
_cache[event.key.id] = event.value;
|
_cache[event.key.id] = event.value;
|
||||||
});
|
});
|
||||||
|
|
||||||
/// Disposes the store and cancels the subscription. To reuse the store call init() again
|
/// Disposes the store and cancels the subscription. To reuse the store call init() again
|
||||||
void dispose() async {
|
void dispose() async {
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,9 @@ class SyncStreamService {
|
||||||
required SyncApiRepository syncApiRepository,
|
required SyncApiRepository syncApiRepository,
|
||||||
required SyncStreamRepository syncStreamRepository,
|
required SyncStreamRepository syncStreamRepository,
|
||||||
bool Function()? cancelChecker,
|
bool Function()? cancelChecker,
|
||||||
}) : _syncApiRepository = syncApiRepository,
|
}) : _syncApiRepository = syncApiRepository,
|
||||||
_syncStreamRepository = syncStreamRepository,
|
_syncStreamRepository = syncStreamRepository,
|
||||||
_cancelChecker = cancelChecker;
|
_cancelChecker = cancelChecker;
|
||||||
|
|
||||||
bool get isCancelled => _cancelChecker?.call() ?? false;
|
bool get isCancelled => _cancelChecker?.call() ?? false;
|
||||||
|
|
||||||
|
|
@ -34,9 +34,7 @@ class SyncStreamService {
|
||||||
Future<void> handleWsAssetUploadReadyV1Batch(List<dynamic> batchData) async {
|
Future<void> handleWsAssetUploadReadyV1Batch(List<dynamic> batchData) async {
|
||||||
if (batchData.isEmpty) return;
|
if (batchData.isEmpty) return;
|
||||||
|
|
||||||
_logger.info(
|
_logger.info('Processing batch of ${batchData.length} AssetUploadReadyV1 events');
|
||||||
'Processing batch of ${batchData.length} AssetUploadReadyV1 events',
|
|
||||||
);
|
|
||||||
|
|
||||||
final List<SyncAssetV1> assets = [];
|
final List<SyncAssetV1> assets = [];
|
||||||
final List<SyncAssetExifV1> exifs = [];
|
final List<SyncAssetExifV1> exifs = [];
|
||||||
|
|
@ -65,22 +63,12 @@ class SyncStreamService {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (assets.isNotEmpty && exifs.isNotEmpty) {
|
if (assets.isNotEmpty && exifs.isNotEmpty) {
|
||||||
await _syncStreamRepository.updateAssetsV1(
|
await _syncStreamRepository.updateAssetsV1(assets, debugLabel: 'websocket-batch');
|
||||||
assets,
|
await _syncStreamRepository.updateAssetsExifV1(exifs, debugLabel: 'websocket-batch');
|
||||||
debugLabel: 'websocket-batch',
|
|
||||||
);
|
|
||||||
await _syncStreamRepository.updateAssetsExifV1(
|
|
||||||
exifs,
|
|
||||||
debugLabel: 'websocket-batch',
|
|
||||||
);
|
|
||||||
_logger.info('Successfully processed ${assets.length} assets in batch');
|
_logger.info('Successfully processed ${assets.length} assets in batch');
|
||||||
}
|
}
|
||||||
} catch (error, stackTrace) {
|
} catch (error, stackTrace) {
|
||||||
_logger.severe(
|
_logger.severe("Error processing AssetUploadReadyV1 websocket batch events", error, stackTrace);
|
||||||
"Error processing AssetUploadReadyV1 websocket batch events",
|
|
||||||
error,
|
|
||||||
stackTrace,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -114,10 +102,7 @@ class SyncStreamService {
|
||||||
batch.clear();
|
batch.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _handleSyncData(
|
Future<void> _handleSyncData(SyncEntityType type, Iterable<Object> data) async {
|
||||||
SyncEntityType type,
|
|
||||||
Iterable<Object> data,
|
|
||||||
) async {
|
|
||||||
_logger.fine("Processing sync data for $type of length ${data.length}");
|
_logger.fine("Processing sync data for $type of length ${data.length}");
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case SyncEntityType.userV1:
|
case SyncEntityType.userV1:
|
||||||
|
|
@ -135,30 +120,15 @@ class SyncStreamService {
|
||||||
case SyncEntityType.assetExifV1:
|
case SyncEntityType.assetExifV1:
|
||||||
return _syncStreamRepository.updateAssetsExifV1(data.cast());
|
return _syncStreamRepository.updateAssetsExifV1(data.cast());
|
||||||
case SyncEntityType.partnerAssetV1:
|
case SyncEntityType.partnerAssetV1:
|
||||||
return _syncStreamRepository.updateAssetsV1(
|
return _syncStreamRepository.updateAssetsV1(data.cast(), debugLabel: 'partner');
|
||||||
data.cast(),
|
|
||||||
debugLabel: 'partner',
|
|
||||||
);
|
|
||||||
case SyncEntityType.partnerAssetBackfillV1:
|
case SyncEntityType.partnerAssetBackfillV1:
|
||||||
return _syncStreamRepository.updateAssetsV1(
|
return _syncStreamRepository.updateAssetsV1(data.cast(), debugLabel: 'partner backfill');
|
||||||
data.cast(),
|
|
||||||
debugLabel: 'partner backfill',
|
|
||||||
);
|
|
||||||
case SyncEntityType.partnerAssetDeleteV1:
|
case SyncEntityType.partnerAssetDeleteV1:
|
||||||
return _syncStreamRepository.deleteAssetsV1(
|
return _syncStreamRepository.deleteAssetsV1(data.cast(), debugLabel: "partner");
|
||||||
data.cast(),
|
|
||||||
debugLabel: "partner",
|
|
||||||
);
|
|
||||||
case SyncEntityType.partnerAssetExifV1:
|
case SyncEntityType.partnerAssetExifV1:
|
||||||
return _syncStreamRepository.updateAssetsExifV1(
|
return _syncStreamRepository.updateAssetsExifV1(data.cast(), debugLabel: 'partner');
|
||||||
data.cast(),
|
|
||||||
debugLabel: 'partner',
|
|
||||||
);
|
|
||||||
case SyncEntityType.partnerAssetExifBackfillV1:
|
case SyncEntityType.partnerAssetExifBackfillV1:
|
||||||
return _syncStreamRepository.updateAssetsExifV1(
|
return _syncStreamRepository.updateAssetsExifV1(data.cast(), debugLabel: 'partner backfill');
|
||||||
data.cast(),
|
|
||||||
debugLabel: 'partner backfill',
|
|
||||||
);
|
|
||||||
case SyncEntityType.albumV1:
|
case SyncEntityType.albumV1:
|
||||||
return _syncStreamRepository.updateAlbumsV1(data.cast());
|
return _syncStreamRepository.updateAlbumsV1(data.cast());
|
||||||
case SyncEntityType.albumDeleteV1:
|
case SyncEntityType.albumDeleteV1:
|
||||||
|
|
@ -166,39 +136,21 @@ class SyncStreamService {
|
||||||
case SyncEntityType.albumUserV1:
|
case SyncEntityType.albumUserV1:
|
||||||
return _syncStreamRepository.updateAlbumUsersV1(data.cast());
|
return _syncStreamRepository.updateAlbumUsersV1(data.cast());
|
||||||
case SyncEntityType.albumUserBackfillV1:
|
case SyncEntityType.albumUserBackfillV1:
|
||||||
return _syncStreamRepository.updateAlbumUsersV1(
|
return _syncStreamRepository.updateAlbumUsersV1(data.cast(), debugLabel: 'backfill');
|
||||||
data.cast(),
|
|
||||||
debugLabel: 'backfill',
|
|
||||||
);
|
|
||||||
case SyncEntityType.albumUserDeleteV1:
|
case SyncEntityType.albumUserDeleteV1:
|
||||||
return _syncStreamRepository.deleteAlbumUsersV1(data.cast());
|
return _syncStreamRepository.deleteAlbumUsersV1(data.cast());
|
||||||
case SyncEntityType.albumAssetV1:
|
case SyncEntityType.albumAssetV1:
|
||||||
return _syncStreamRepository.updateAssetsV1(
|
return _syncStreamRepository.updateAssetsV1(data.cast(), debugLabel: 'album');
|
||||||
data.cast(),
|
|
||||||
debugLabel: 'album',
|
|
||||||
);
|
|
||||||
case SyncEntityType.albumAssetBackfillV1:
|
case SyncEntityType.albumAssetBackfillV1:
|
||||||
return _syncStreamRepository.updateAssetsV1(
|
return _syncStreamRepository.updateAssetsV1(data.cast(), debugLabel: 'album backfill');
|
||||||
data.cast(),
|
|
||||||
debugLabel: 'album backfill',
|
|
||||||
);
|
|
||||||
case SyncEntityType.albumAssetExifV1:
|
case SyncEntityType.albumAssetExifV1:
|
||||||
return _syncStreamRepository.updateAssetsExifV1(
|
return _syncStreamRepository.updateAssetsExifV1(data.cast(), debugLabel: 'album');
|
||||||
data.cast(),
|
|
||||||
debugLabel: 'album',
|
|
||||||
);
|
|
||||||
case SyncEntityType.albumAssetExifBackfillV1:
|
case SyncEntityType.albumAssetExifBackfillV1:
|
||||||
return _syncStreamRepository.updateAssetsExifV1(
|
return _syncStreamRepository.updateAssetsExifV1(data.cast(), debugLabel: 'album backfill');
|
||||||
data.cast(),
|
|
||||||
debugLabel: 'album backfill',
|
|
||||||
);
|
|
||||||
case SyncEntityType.albumToAssetV1:
|
case SyncEntityType.albumToAssetV1:
|
||||||
return _syncStreamRepository.updateAlbumToAssetsV1(data.cast());
|
return _syncStreamRepository.updateAlbumToAssetsV1(data.cast());
|
||||||
case SyncEntityType.albumToAssetBackfillV1:
|
case SyncEntityType.albumToAssetBackfillV1:
|
||||||
return _syncStreamRepository.updateAlbumToAssetsV1(
|
return _syncStreamRepository.updateAlbumToAssetsV1(data.cast(), debugLabel: 'backfill');
|
||||||
data.cast(),
|
|
||||||
debugLabel: 'backfill',
|
|
||||||
);
|
|
||||||
case SyncEntityType.albumToAssetDeleteV1:
|
case SyncEntityType.albumToAssetDeleteV1:
|
||||||
return _syncStreamRepository.deleteAlbumToAssetsV1(data.cast());
|
return _syncStreamRepository.deleteAlbumToAssetsV1(data.cast());
|
||||||
// No-op. SyncAckV1 entities are checkpoints in the sync stream
|
// No-op. SyncAckV1 entities are checkpoints in the sync stream
|
||||||
|
|
@ -218,28 +170,15 @@ class SyncStreamService {
|
||||||
case SyncEntityType.stackDeleteV1:
|
case SyncEntityType.stackDeleteV1:
|
||||||
return _syncStreamRepository.deleteStacksV1(data.cast());
|
return _syncStreamRepository.deleteStacksV1(data.cast());
|
||||||
case SyncEntityType.partnerStackV1:
|
case SyncEntityType.partnerStackV1:
|
||||||
return _syncStreamRepository.updateStacksV1(
|
return _syncStreamRepository.updateStacksV1(data.cast(), debugLabel: 'partner');
|
||||||
data.cast(),
|
|
||||||
debugLabel: 'partner',
|
|
||||||
);
|
|
||||||
case SyncEntityType.partnerStackBackfillV1:
|
case SyncEntityType.partnerStackBackfillV1:
|
||||||
return _syncStreamRepository.updateStacksV1(
|
return _syncStreamRepository.updateStacksV1(data.cast(), debugLabel: 'partner backfill');
|
||||||
data.cast(),
|
|
||||||
debugLabel: 'partner backfill',
|
|
||||||
);
|
|
||||||
case SyncEntityType.partnerStackDeleteV1:
|
case SyncEntityType.partnerStackDeleteV1:
|
||||||
return _syncStreamRepository.deleteStacksV1(
|
return _syncStreamRepository.deleteStacksV1(data.cast(), debugLabel: 'partner');
|
||||||
data.cast(),
|
|
||||||
debugLabel: 'partner',
|
|
||||||
);
|
|
||||||
case SyncEntityType.userMetadataV1:
|
case SyncEntityType.userMetadataV1:
|
||||||
return _syncStreamRepository.updateUserMetadatasV1(
|
return _syncStreamRepository.updateUserMetadatasV1(data.cast());
|
||||||
data.cast(),
|
|
||||||
);
|
|
||||||
case SyncEntityType.userMetadataDeleteV1:
|
case SyncEntityType.userMetadataDeleteV1:
|
||||||
return _syncStreamRepository.deleteUserMetadatasV1(
|
return _syncStreamRepository.deleteUserMetadatasV1(data.cast());
|
||||||
data.cast(),
|
|
||||||
);
|
|
||||||
case SyncEntityType.personV1:
|
case SyncEntityType.personV1:
|
||||||
return _syncStreamRepository.updatePeopleV1(data.cast());
|
return _syncStreamRepository.updatePeopleV1(data.cast());
|
||||||
case SyncEntityType.personDeleteV1:
|
case SyncEntityType.personDeleteV1:
|
||||||
|
|
|
||||||
|
|
@ -11,27 +11,19 @@ import 'package:immich_mobile/domain/utils/event_stream.dart';
|
||||||
import 'package:immich_mobile/infrastructure/repositories/timeline.repository.dart';
|
import 'package:immich_mobile/infrastructure/repositories/timeline.repository.dart';
|
||||||
import 'package:immich_mobile/utils/async_mutex.dart';
|
import 'package:immich_mobile/utils/async_mutex.dart';
|
||||||
|
|
||||||
typedef TimelineAssetSource = Future<List<BaseAsset>> Function(
|
typedef TimelineAssetSource = Future<List<BaseAsset>> Function(int index, int count);
|
||||||
int index,
|
|
||||||
int count,
|
|
||||||
);
|
|
||||||
|
|
||||||
typedef TimelineBucketSource = Stream<List<Bucket>> Function();
|
typedef TimelineBucketSource = Stream<List<Bucket>> Function();
|
||||||
|
|
||||||
typedef TimelineQuery = ({
|
typedef TimelineQuery = ({TimelineAssetSource assetSource, TimelineBucketSource bucketSource});
|
||||||
TimelineAssetSource assetSource,
|
|
||||||
TimelineBucketSource bucketSource,
|
|
||||||
});
|
|
||||||
|
|
||||||
class TimelineFactory {
|
class TimelineFactory {
|
||||||
final DriftTimelineRepository _timelineRepository;
|
final DriftTimelineRepository _timelineRepository;
|
||||||
final SettingsService _settingsService;
|
final SettingsService _settingsService;
|
||||||
|
|
||||||
const TimelineFactory({
|
const TimelineFactory({required DriftTimelineRepository timelineRepository, required SettingsService settingsService})
|
||||||
required DriftTimelineRepository timelineRepository,
|
: _timelineRepository = timelineRepository,
|
||||||
required SettingsService settingsService,
|
_settingsService = settingsService;
|
||||||
}) : _timelineRepository = timelineRepository,
|
|
||||||
_settingsService = settingsService;
|
|
||||||
|
|
||||||
GroupAssetsBy get groupBy {
|
GroupAssetsBy get groupBy {
|
||||||
final group = GroupAssetsBy.values[_settingsService.get(Setting.groupAssetsBy)];
|
final group = GroupAssetsBy.values[_settingsService.get(Setting.groupAssetsBy)];
|
||||||
|
|
@ -75,17 +67,11 @@ class TimelineService {
|
||||||
int _totalAssets = 0;
|
int _totalAssets = 0;
|
||||||
int get totalAssets => _totalAssets;
|
int get totalAssets => _totalAssets;
|
||||||
|
|
||||||
TimelineService(TimelineQuery query)
|
TimelineService(TimelineQuery query) : this._(assetSource: query.assetSource, bucketSource: query.bucketSource);
|
||||||
: this._(
|
|
||||||
assetSource: query.assetSource,
|
|
||||||
bucketSource: query.bucketSource,
|
|
||||||
);
|
|
||||||
|
|
||||||
TimelineService._({
|
TimelineService._({required TimelineAssetSource assetSource, required TimelineBucketSource bucketSource})
|
||||||
required TimelineAssetSource assetSource,
|
: _assetSource = assetSource,
|
||||||
required TimelineBucketSource bucketSource,
|
_bucketSource = bucketSource {
|
||||||
}) : _assetSource = assetSource,
|
|
||||||
_bucketSource = bucketSource {
|
|
||||||
_bucketSubscription = _bucketSource().listen((buckets) {
|
_bucketSubscription = _bucketSource().listen((buckets) {
|
||||||
_mutex.run(() async {
|
_mutex.run(() async {
|
||||||
final totalAssets = buckets.fold<int>(0, (acc, bucket) => acc + bucket.assetCount);
|
final totalAssets = buckets.fold<int>(0, (acc, bucket) => acc + bucket.assetCount);
|
||||||
|
|
@ -103,10 +89,7 @@ class TimelineService {
|
||||||
count = kTimelineAssetLoadBatchSize;
|
count = kTimelineAssetLoadBatchSize;
|
||||||
} else {
|
} else {
|
||||||
offset = _bufferOffset;
|
offset = _bufferOffset;
|
||||||
count = math.min(
|
count = math.min(_buffer.length, totalAssets - _bufferOffset);
|
||||||
_buffer.length,
|
|
||||||
totalAssets - _bufferOffset,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
_buffer = await _assetSource(offset, count);
|
_buffer = await _assetSource(offset, count);
|
||||||
_bufferOffset = offset;
|
_bufferOffset = offset;
|
||||||
|
|
@ -134,10 +117,7 @@ class TimelineService {
|
||||||
// make sure to load a meaningful amount of data (and not only the requested slice)
|
// make sure to load a meaningful amount of data (and not only the requested slice)
|
||||||
// otherwise, each call to [loadAssets] would result in DB call trashing performance
|
// otherwise, each call to [loadAssets] would result in DB call trashing performance
|
||||||
// fills small requests to [kTimelineAssetLoadBatchSize], adds some legroom into the opposite scroll direction for large requests
|
// fills small requests to [kTimelineAssetLoadBatchSize], adds some legroom into the opposite scroll direction for large requests
|
||||||
final len = math.max(
|
final len = math.max(kTimelineAssetLoadBatchSize, count + kTimelineAssetLoadOppositeSize);
|
||||||
kTimelineAssetLoadBatchSize,
|
|
||||||
count + kTimelineAssetLoadOppositeSize,
|
|
||||||
);
|
|
||||||
// when scrolling forward, start shortly before the requested offset
|
// when scrolling forward, start shortly before the requested offset
|
||||||
// when scrolling backward, end shortly after the requested offset to guard against the user scrolling
|
// when scrolling backward, end shortly after the requested offset to guard against the user scrolling
|
||||||
// in the other direction a tiny bit resulting in another required load from the DB
|
// in the other direction a tiny bit resulting in another required load from the DB
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,9 @@ class UserService {
|
||||||
required IsarUserRepository isarUserRepository,
|
required IsarUserRepository isarUserRepository,
|
||||||
required UserApiRepository userApiRepository,
|
required UserApiRepository userApiRepository,
|
||||||
required StoreService storeService,
|
required StoreService storeService,
|
||||||
}) : _isarUserRepository = isarUserRepository,
|
}) : _isarUserRepository = isarUserRepository,
|
||||||
_userApiRepository = userApiRepository,
|
_userApiRepository = userApiRepository,
|
||||||
_storeService = storeService;
|
_storeService = storeService;
|
||||||
|
|
||||||
UserDto getMyUser() {
|
UserDto getMyUser() {
|
||||||
return _storeService.get(StoreKey.currentUser);
|
return _storeService.get(StoreKey.currentUser);
|
||||||
|
|
@ -44,10 +44,7 @@ class UserService {
|
||||||
|
|
||||||
Future<String?> createProfileImage(String name, Uint8List image) async {
|
Future<String?> createProfileImage(String name, Uint8List image) async {
|
||||||
try {
|
try {
|
||||||
final path = await _userApiRepository.createProfileImage(
|
final path = await _userApiRepository.createProfileImage(name: name, data: image);
|
||||||
name: name,
|
|
||||||
data: image,
|
|
||||||
);
|
|
||||||
final updatedUser = getMyUser().copyWith(profileImagePath: path);
|
final updatedUser = getMyUser().copyWith(profileImagePath: path);
|
||||||
await _storeService.put(StoreKey.currentUser, updatedUser);
|
await _storeService.put(StoreKey.currentUser, updatedUser);
|
||||||
await _isarUserRepository.update(updatedUser);
|
await _isarUserRepository.update(updatedUser);
|
||||||
|
|
|
||||||
|
|
@ -66,23 +66,21 @@ class BackgroundSyncManager {
|
||||||
// We use a ternary operator to avoid [_deviceAlbumSyncTask] from being
|
// We use a ternary operator to avoid [_deviceAlbumSyncTask] from being
|
||||||
// captured by the closure passed to [runInIsolateGentle].
|
// captured by the closure passed to [runInIsolateGentle].
|
||||||
_deviceAlbumSyncTask = full
|
_deviceAlbumSyncTask = full
|
||||||
? runInIsolateGentle(
|
? runInIsolateGentle(computation: (ref) => ref.read(localSyncServiceProvider).sync(full: true))
|
||||||
computation: (ref) => ref.read(localSyncServiceProvider).sync(full: true),
|
: runInIsolateGentle(computation: (ref) => ref.read(localSyncServiceProvider).sync(full: false));
|
||||||
)
|
|
||||||
: runInIsolateGentle(
|
|
||||||
computation: (ref) => ref.read(localSyncServiceProvider).sync(full: false),
|
|
||||||
);
|
|
||||||
|
|
||||||
return _deviceAlbumSyncTask!.whenComplete(() {
|
return _deviceAlbumSyncTask!
|
||||||
_deviceAlbumSyncTask = null;
|
.whenComplete(() {
|
||||||
onLocalSyncComplete?.call();
|
_deviceAlbumSyncTask = null;
|
||||||
}).catchError((error) {
|
onLocalSyncComplete?.call();
|
||||||
onLocalSyncError?.call(error.toString());
|
})
|
||||||
_deviceAlbumSyncTask = null;
|
.catchError((error) {
|
||||||
});
|
onLocalSyncError?.call(error.toString());
|
||||||
|
_deviceAlbumSyncTask = null;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// No need to cancel the task, as it can also be run when the user logs out
|
// No need to cancel the task, as it can also be run when the user logs out
|
||||||
Future<void> hashAssets() {
|
Future<void> hashAssets() {
|
||||||
if (_hashTask != null) {
|
if (_hashTask != null) {
|
||||||
return _hashTask!.future;
|
return _hashTask!.future;
|
||||||
|
|
@ -90,17 +88,17 @@ class BackgroundSyncManager {
|
||||||
|
|
||||||
onHashingStart?.call();
|
onHashingStart?.call();
|
||||||
|
|
||||||
_hashTask = runInIsolateGentle(
|
_hashTask = runInIsolateGentle(computation: (ref) => ref.read(hashServiceProvider).hashAssets());
|
||||||
computation: (ref) => ref.read(hashServiceProvider).hashAssets(),
|
|
||||||
);
|
|
||||||
|
|
||||||
return _hashTask!.whenComplete(() {
|
return _hashTask!
|
||||||
onHashingComplete?.call();
|
.whenComplete(() {
|
||||||
_hashTask = null;
|
onHashingComplete?.call();
|
||||||
}).catchError((error) {
|
_hashTask = null;
|
||||||
onHashingError?.call(error.toString());
|
})
|
||||||
_hashTask = null;
|
.catchError((error) {
|
||||||
});
|
onHashingError?.call(error.toString());
|
||||||
|
_hashTask = null;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> syncRemote() {
|
Future<void> syncRemote() {
|
||||||
|
|
@ -110,16 +108,16 @@ class BackgroundSyncManager {
|
||||||
|
|
||||||
onRemoteSyncStart?.call();
|
onRemoteSyncStart?.call();
|
||||||
|
|
||||||
_syncTask = runInIsolateGentle(
|
_syncTask = runInIsolateGentle(computation: (ref) => ref.read(syncStreamServiceProvider).sync());
|
||||||
computation: (ref) => ref.read(syncStreamServiceProvider).sync(),
|
return _syncTask!
|
||||||
);
|
.whenComplete(() {
|
||||||
return _syncTask!.whenComplete(() {
|
onRemoteSyncComplete?.call();
|
||||||
onRemoteSyncComplete?.call();
|
_syncTask = null;
|
||||||
_syncTask = null;
|
})
|
||||||
}).catchError((error) {
|
.catchError((error) {
|
||||||
onRemoteSyncError?.call(error.toString());
|
onRemoteSyncError?.call(error.toString());
|
||||||
_syncTask = null;
|
_syncTask = null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> syncWebsocketBatch(List<dynamic> batchData) {
|
Future<void> syncWebsocketBatch(List<dynamic> batchData) {
|
||||||
|
|
@ -133,9 +131,6 @@ class BackgroundSyncManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Cancelable<void> _handleWsAssetUploadReadyV1Batch(
|
Cancelable<void> _handleWsAssetUploadReadyV1Batch(List<dynamic> batchData) => runInIsolateGentle(
|
||||||
List<dynamic> batchData,
|
computation: (ref) => ref.read(syncStreamServiceProvider).handleWsAssetUploadReadyV1Batch(batchData),
|
||||||
) =>
|
);
|
||||||
runInIsolateGentle(
|
|
||||||
computation: (ref) => ref.read(syncStreamServiceProvider).handleWsAssetUploadReadyV1Batch(batchData),
|
|
||||||
);
|
|
||||||
|
|
|
||||||
|
|
@ -28,12 +28,7 @@ class EventStream {
|
||||||
void Function()? onDone,
|
void Function()? onDone,
|
||||||
bool? cancelOnError,
|
bool? cancelOnError,
|
||||||
}) {
|
}) {
|
||||||
return where<T>().listen(
|
return where<T>().listen(onData, onError: onError, onDone: onDone, cancelOnError: cancelOnError);
|
||||||
onData,
|
|
||||||
onError: onError,
|
|
||||||
onDone: onDone,
|
|
||||||
cancelOnError: cancelOnError,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Closes the stream controller
|
/// Closes the stream controller
|
||||||
|
|
|
||||||
|
|
@ -113,10 +113,7 @@ class Album {
|
||||||
modifiedAt.isAtSameMomentAs(other.modifiedAt) &&
|
modifiedAt.isAtSameMomentAs(other.modifiedAt) &&
|
||||||
isAtSameMomentAs(startDate, other.startDate) &&
|
isAtSameMomentAs(startDate, other.startDate) &&
|
||||||
isAtSameMomentAs(endDate, other.endDate) &&
|
isAtSameMomentAs(endDate, other.endDate) &&
|
||||||
isAtSameMomentAs(
|
isAtSameMomentAs(lastModifiedAssetTimestamp, other.lastModifiedAssetTimestamp) &&
|
||||||
lastModifiedAssetTimestamp,
|
|
||||||
other.lastModifiedAssetTimestamp,
|
|
||||||
) &&
|
|
||||||
shared == other.shared &&
|
shared == other.shared &&
|
||||||
activityEnabled == other.activityEnabled &&
|
activityEnabled == other.activityEnabled &&
|
||||||
owner.value == other.owner.value &&
|
owner.value == other.owner.value &&
|
||||||
|
|
@ -169,9 +166,7 @@ class Album {
|
||||||
a.thumbnail.value = await db.assets.where().remoteIdEqualTo(dto.albumThumbnailAssetId).findFirst();
|
a.thumbnail.value = await db.assets.where().remoteIdEqualTo(dto.albumThumbnailAssetId).findFirst();
|
||||||
}
|
}
|
||||||
if (dto.albumUsers.isNotEmpty) {
|
if (dto.albumUsers.isNotEmpty) {
|
||||||
final users = await db.users.getAllById(
|
final users = await db.users.getAllById(dto.albumUsers.map((e) => e.user.id).toList(growable: false));
|
||||||
dto.albumUsers.map((e) => e.user.id).toList(growable: false),
|
|
||||||
);
|
|
||||||
a.sharedUsers.addAll(users.cast());
|
a.sharedUsers.addAll(users.cast());
|
||||||
}
|
}
|
||||||
if (dto.assets.isNotEmpty) {
|
if (dto.assets.isNotEmpty) {
|
||||||
|
|
|
||||||
1299
mobile/lib/entities/album.entity.g.dart
generated
1299
mobile/lib/entities/album.entity.g.dart
generated
File diff suppressed because it is too large
Load diff
310
mobile/lib/entities/android_device_asset.entity.g.dart
generated
310
mobile/lib/entities/android_device_asset.entity.g.dart
generated
|
|
@ -18,12 +18,9 @@ const AndroidDeviceAssetSchema = CollectionSchema(
|
||||||
name: r'AndroidDeviceAsset',
|
name: r'AndroidDeviceAsset',
|
||||||
id: -6758387181232899335,
|
id: -6758387181232899335,
|
||||||
properties: {
|
properties: {
|
||||||
r'hash': PropertySchema(
|
r'hash': PropertySchema(id: 0, name: r'hash', type: IsarType.byteList),
|
||||||
id: 0,
|
|
||||||
name: r'hash',
|
|
||||||
type: IsarType.byteList,
|
|
||||||
)
|
|
||||||
},
|
},
|
||||||
|
|
||||||
estimateSize: _androidDeviceAssetEstimateSize,
|
estimateSize: _androidDeviceAssetEstimateSize,
|
||||||
serialize: _androidDeviceAssetSerialize,
|
serialize: _androidDeviceAssetSerialize,
|
||||||
deserialize: _androidDeviceAssetDeserialize,
|
deserialize: _androidDeviceAssetDeserialize,
|
||||||
|
|
@ -40,12 +37,13 @@ const AndroidDeviceAssetSchema = CollectionSchema(
|
||||||
name: r'hash',
|
name: r'hash',
|
||||||
type: IndexType.hash,
|
type: IndexType.hash,
|
||||||
caseSensitive: false,
|
caseSensitive: false,
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
)
|
),
|
||||||
},
|
},
|
||||||
links: {},
|
links: {},
|
||||||
embeddedSchemas: {},
|
embeddedSchemas: {},
|
||||||
|
|
||||||
getId: _androidDeviceAssetGetId,
|
getId: _androidDeviceAssetGetId,
|
||||||
getLinks: _androidDeviceAssetGetLinks,
|
getLinks: _androidDeviceAssetGetLinks,
|
||||||
attach: _androidDeviceAssetAttach,
|
attach: _androidDeviceAssetAttach,
|
||||||
|
|
@ -103,12 +101,16 @@ Id _androidDeviceAssetGetId(AndroidDeviceAsset object) {
|
||||||
}
|
}
|
||||||
|
|
||||||
List<IsarLinkBase<dynamic>> _androidDeviceAssetGetLinks(
|
List<IsarLinkBase<dynamic>> _androidDeviceAssetGetLinks(
|
||||||
AndroidDeviceAsset object) {
|
AndroidDeviceAsset object,
|
||||||
|
) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
void _androidDeviceAssetAttach(
|
void _androidDeviceAssetAttach(
|
||||||
IsarCollection<dynamic> col, Id id, AndroidDeviceAsset object) {
|
IsarCollection<dynamic> col,
|
||||||
|
Id id,
|
||||||
|
AndroidDeviceAsset object,
|
||||||
|
) {
|
||||||
object.id = id;
|
object.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -124,17 +126,14 @@ extension AndroidDeviceAssetQueryWhereSort
|
||||||
extension AndroidDeviceAssetQueryWhere
|
extension AndroidDeviceAssetQueryWhere
|
||||||
on QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QWhereClause> {
|
on QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QWhereClause> {
|
||||||
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterWhereClause>
|
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterWhereClause>
|
||||||
idEqualTo(Id id) {
|
idEqualTo(Id id) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(IdWhereClause.between(
|
return query.addWhereClause(IdWhereClause.between(lower: id, upper: id));
|
||||||
lower: id,
|
|
||||||
upper: id,
|
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterWhereClause>
|
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterWhereClause>
|
||||||
idNotEqualTo(Id id) {
|
idNotEqualTo(Id id) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
if (query.whereSort == Sort.asc) {
|
if (query.whereSort == Sort.asc) {
|
||||||
return query
|
return query
|
||||||
|
|
@ -157,7 +156,7 @@ extension AndroidDeviceAssetQueryWhere
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterWhereClause>
|
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterWhereClause>
|
||||||
idGreaterThan(Id id, {bool include = false}) {
|
idGreaterThan(Id id, {bool include = false}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(
|
return query.addWhereClause(
|
||||||
IdWhereClause.greaterThan(lower: id, includeLower: include),
|
IdWhereClause.greaterThan(lower: id, includeLower: include),
|
||||||
|
|
@ -166,7 +165,7 @@ extension AndroidDeviceAssetQueryWhere
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterWhereClause>
|
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterWhereClause>
|
||||||
idLessThan(Id id, {bool include = false}) {
|
idLessThan(Id id, {bool include = false}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(
|
return query.addWhereClause(
|
||||||
IdWhereClause.lessThan(upper: id, includeUpper: include),
|
IdWhereClause.lessThan(upper: id, includeUpper: include),
|
||||||
|
|
@ -175,63 +174,72 @@ extension AndroidDeviceAssetQueryWhere
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterWhereClause>
|
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterWhereClause>
|
||||||
idBetween(
|
idBetween(
|
||||||
Id lowerId,
|
Id lowerId,
|
||||||
Id upperId, {
|
Id upperId, {
|
||||||
bool includeLower = true,
|
bool includeLower = true,
|
||||||
bool includeUpper = true,
|
bool includeUpper = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(IdWhereClause.between(
|
return query.addWhereClause(
|
||||||
lower: lowerId,
|
IdWhereClause.between(
|
||||||
includeLower: includeLower,
|
lower: lowerId,
|
||||||
upper: upperId,
|
includeLower: includeLower,
|
||||||
includeUpper: includeUpper,
|
upper: upperId,
|
||||||
));
|
includeUpper: includeUpper,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterWhereClause>
|
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterWhereClause>
|
||||||
hashEqualTo(List<int> hash) {
|
hashEqualTo(List<int> hash) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(IndexWhereClause.equalTo(
|
return query.addWhereClause(
|
||||||
indexName: r'hash',
|
IndexWhereClause.equalTo(indexName: r'hash', value: [hash]),
|
||||||
value: [hash],
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterWhereClause>
|
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterWhereClause>
|
||||||
hashNotEqualTo(List<int> hash) {
|
hashNotEqualTo(List<int> hash) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
if (query.whereSort == Sort.asc) {
|
if (query.whereSort == Sort.asc) {
|
||||||
return query
|
return query
|
||||||
.addWhereClause(IndexWhereClause.between(
|
.addWhereClause(
|
||||||
indexName: r'hash',
|
IndexWhereClause.between(
|
||||||
lower: [],
|
indexName: r'hash',
|
||||||
upper: [hash],
|
lower: [],
|
||||||
includeUpper: false,
|
upper: [hash],
|
||||||
))
|
includeUpper: false,
|
||||||
.addWhereClause(IndexWhereClause.between(
|
),
|
||||||
indexName: r'hash',
|
)
|
||||||
lower: [hash],
|
.addWhereClause(
|
||||||
includeLower: false,
|
IndexWhereClause.between(
|
||||||
upper: [],
|
indexName: r'hash',
|
||||||
));
|
lower: [hash],
|
||||||
|
includeLower: false,
|
||||||
|
upper: [],
|
||||||
|
),
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
return query
|
return query
|
||||||
.addWhereClause(IndexWhereClause.between(
|
.addWhereClause(
|
||||||
indexName: r'hash',
|
IndexWhereClause.between(
|
||||||
lower: [hash],
|
indexName: r'hash',
|
||||||
includeLower: false,
|
lower: [hash],
|
||||||
upper: [],
|
includeLower: false,
|
||||||
))
|
upper: [],
|
||||||
.addWhereClause(IndexWhereClause.between(
|
),
|
||||||
indexName: r'hash',
|
)
|
||||||
lower: [],
|
.addWhereClause(
|
||||||
upper: [hash],
|
IndexWhereClause.between(
|
||||||
includeUpper: false,
|
indexName: r'hash',
|
||||||
));
|
lower: [],
|
||||||
|
upper: [hash],
|
||||||
|
includeUpper: false,
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -240,134 +248,97 @@ extension AndroidDeviceAssetQueryWhere
|
||||||
extension AndroidDeviceAssetQueryFilter
|
extension AndroidDeviceAssetQueryFilter
|
||||||
on QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QFilterCondition> {
|
on QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QFilterCondition> {
|
||||||
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
|
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
|
||||||
hashElementEqualTo(int value) {
|
hashElementEqualTo(int value) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
return query.addFilterCondition(
|
||||||
property: r'hash',
|
FilterCondition.equalTo(property: r'hash', value: value),
|
||||||
value: value,
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
|
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
|
||||||
hashElementGreaterThan(
|
hashElementGreaterThan(int value, {bool include = false}) {
|
||||||
int value, {
|
|
||||||
bool include = false,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.greaterThan(
|
||||||
property: r'hash',
|
include: include,
|
||||||
value: value,
|
property: r'hash',
|
||||||
));
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
|
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
|
||||||
hashElementLessThan(
|
hashElementLessThan(int value, {bool include = false}) {
|
||||||
int value, {
|
|
||||||
bool include = false,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.lessThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.lessThan(
|
||||||
property: r'hash',
|
include: include,
|
||||||
value: value,
|
property: r'hash',
|
||||||
));
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
|
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
|
||||||
hashElementBetween(
|
hashElementBetween(
|
||||||
int lower,
|
int lower,
|
||||||
int upper, {
|
int upper, {
|
||||||
bool includeLower = true,
|
bool includeLower = true,
|
||||||
bool includeUpper = true,
|
bool includeUpper = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.between(
|
return query.addFilterCondition(
|
||||||
property: r'hash',
|
FilterCondition.between(
|
||||||
lower: lower,
|
property: r'hash',
|
||||||
includeLower: includeLower,
|
lower: lower,
|
||||||
upper: upper,
|
includeLower: includeLower,
|
||||||
includeUpper: includeUpper,
|
upper: upper,
|
||||||
));
|
includeUpper: includeUpper,
|
||||||
});
|
),
|
||||||
}
|
|
||||||
|
|
||||||
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
|
|
||||||
hashLengthEqualTo(int length) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
|
||||||
return query.listLength(
|
|
||||||
r'hash',
|
|
||||||
length,
|
|
||||||
true,
|
|
||||||
length,
|
|
||||||
true,
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
|
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
|
||||||
hashIsEmpty() {
|
hashLengthEqualTo(int length) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.listLength(
|
return query.listLength(r'hash', length, true, length, true);
|
||||||
r'hash',
|
|
||||||
0,
|
|
||||||
true,
|
|
||||||
0,
|
|
||||||
true,
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
|
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
|
||||||
hashIsNotEmpty() {
|
hashIsEmpty() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.listLength(
|
return query.listLength(r'hash', 0, true, 0, true);
|
||||||
r'hash',
|
|
||||||
0,
|
|
||||||
false,
|
|
||||||
999999,
|
|
||||||
true,
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
|
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
|
||||||
hashLengthLessThan(
|
hashIsNotEmpty() {
|
||||||
int length, {
|
|
||||||
bool include = false,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.listLength(
|
return query.listLength(r'hash', 0, false, 999999, true);
|
||||||
r'hash',
|
|
||||||
0,
|
|
||||||
true,
|
|
||||||
length,
|
|
||||||
include,
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
|
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
|
||||||
hashLengthGreaterThan(
|
hashLengthLessThan(int length, {bool include = false}) {
|
||||||
int length, {
|
|
||||||
bool include = false,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.listLength(
|
return query.listLength(r'hash', 0, true, length, include);
|
||||||
r'hash',
|
|
||||||
length,
|
|
||||||
include,
|
|
||||||
999999,
|
|
||||||
true,
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
|
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
|
||||||
hashLengthBetween(
|
hashLengthGreaterThan(int length, {bool include = false}) {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.listLength(r'hash', length, include, 999999, true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
|
||||||
|
hashLengthBetween(
|
||||||
int lower,
|
int lower,
|
||||||
int upper, {
|
int upper, {
|
||||||
bool includeLower = true,
|
bool includeLower = true,
|
||||||
|
|
@ -385,58 +356,57 @@ extension AndroidDeviceAssetQueryFilter
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
|
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
|
||||||
idEqualTo(Id value) {
|
idEqualTo(Id value) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.equalTo(property: r'id', value: value),
|
||||||
value: value,
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
|
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
|
||||||
idGreaterThan(
|
idGreaterThan(Id value, {bool include = false}) {
|
||||||
Id value, {
|
|
||||||
bool include = false,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.greaterThan(
|
||||||
property: r'id',
|
include: include,
|
||||||
value: value,
|
property: r'id',
|
||||||
));
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
|
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
|
||||||
idLessThan(
|
idLessThan(Id value, {bool include = false}) {
|
||||||
Id value, {
|
|
||||||
bool include = false,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.lessThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.lessThan(
|
||||||
property: r'id',
|
include: include,
|
||||||
value: value,
|
property: r'id',
|
||||||
));
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
|
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterFilterCondition>
|
||||||
idBetween(
|
idBetween(
|
||||||
Id lower,
|
Id lower,
|
||||||
Id upper, {
|
Id upper, {
|
||||||
bool includeLower = true,
|
bool includeLower = true,
|
||||||
bool includeUpper = true,
|
bool includeUpper = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.between(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.between(
|
||||||
lower: lower,
|
property: r'id',
|
||||||
includeLower: includeLower,
|
lower: lower,
|
||||||
upper: upper,
|
includeLower: includeLower,
|
||||||
includeUpper: includeUpper,
|
upper: upper,
|
||||||
));
|
includeUpper: includeUpper,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -453,14 +423,14 @@ extension AndroidDeviceAssetQuerySortBy
|
||||||
extension AndroidDeviceAssetQuerySortThenBy
|
extension AndroidDeviceAssetQuerySortThenBy
|
||||||
on QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QSortThenBy> {
|
on QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QSortThenBy> {
|
||||||
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterSortBy>
|
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterSortBy>
|
||||||
thenById() {
|
thenById() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addSortBy(r'id', Sort.asc);
|
return query.addSortBy(r'id', Sort.asc);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterSortBy>
|
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QAfterSortBy>
|
||||||
thenByIdDesc() {
|
thenByIdDesc() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addSortBy(r'id', Sort.desc);
|
return query.addSortBy(r'id', Sort.desc);
|
||||||
});
|
});
|
||||||
|
|
@ -470,7 +440,7 @@ extension AndroidDeviceAssetQuerySortThenBy
|
||||||
extension AndroidDeviceAssetQueryWhereDistinct
|
extension AndroidDeviceAssetQueryWhereDistinct
|
||||||
on QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QDistinct> {
|
on QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QDistinct> {
|
||||||
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QDistinct>
|
QueryBuilder<AndroidDeviceAsset, AndroidDeviceAsset, QDistinct>
|
||||||
distinctByHash() {
|
distinctByHash() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addDistinctBy(r'hash');
|
return query.addDistinctBy(r'hash');
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -19,30 +19,30 @@ part 'asset.entity.g.dart';
|
||||||
@Collection(inheritance: false)
|
@Collection(inheritance: false)
|
||||||
class Asset {
|
class Asset {
|
||||||
Asset.remote(AssetResponseDto remote)
|
Asset.remote(AssetResponseDto remote)
|
||||||
: remoteId = remote.id,
|
: remoteId = remote.id,
|
||||||
checksum = remote.checksum,
|
checksum = remote.checksum,
|
||||||
fileCreatedAt = remote.fileCreatedAt,
|
fileCreatedAt = remote.fileCreatedAt,
|
||||||
fileModifiedAt = remote.fileModifiedAt,
|
fileModifiedAt = remote.fileModifiedAt,
|
||||||
updatedAt = remote.updatedAt,
|
updatedAt = remote.updatedAt,
|
||||||
durationInSeconds = remote.duration.toDuration()?.inSeconds ?? 0,
|
durationInSeconds = remote.duration.toDuration()?.inSeconds ?? 0,
|
||||||
type = remote.type.toAssetType(),
|
type = remote.type.toAssetType(),
|
||||||
fileName = remote.originalFileName,
|
fileName = remote.originalFileName,
|
||||||
height = remote.exifInfo?.exifImageHeight?.toInt(),
|
height = remote.exifInfo?.exifImageHeight?.toInt(),
|
||||||
width = remote.exifInfo?.exifImageWidth?.toInt(),
|
width = remote.exifInfo?.exifImageWidth?.toInt(),
|
||||||
livePhotoVideoId = remote.livePhotoVideoId,
|
livePhotoVideoId = remote.livePhotoVideoId,
|
||||||
ownerId = fastHash(remote.ownerId),
|
ownerId = fastHash(remote.ownerId),
|
||||||
exifInfo = remote.exifInfo == null ? null : ExifDtoConverter.fromDto(remote.exifInfo!),
|
exifInfo = remote.exifInfo == null ? null : ExifDtoConverter.fromDto(remote.exifInfo!),
|
||||||
isFavorite = remote.isFavorite,
|
isFavorite = remote.isFavorite,
|
||||||
isArchived = remote.isArchived,
|
isArchived = remote.isArchived,
|
||||||
isTrashed = remote.isTrashed,
|
isTrashed = remote.isTrashed,
|
||||||
isOffline = remote.isOffline,
|
isOffline = remote.isOffline,
|
||||||
// workaround to nullify stackPrimaryAssetId for the parent asset until we refactor the mobile app
|
// workaround to nullify stackPrimaryAssetId for the parent asset until we refactor the mobile app
|
||||||
// stack handling to properly handle it
|
// stack handling to properly handle it
|
||||||
stackPrimaryAssetId = remote.stack?.primaryAssetId == remote.id ? null : remote.stack?.primaryAssetId,
|
stackPrimaryAssetId = remote.stack?.primaryAssetId == remote.id ? null : remote.stack?.primaryAssetId,
|
||||||
stackCount = remote.stack?.assetCount ?? 0,
|
stackCount = remote.stack?.assetCount ?? 0,
|
||||||
stackId = remote.stack?.id,
|
stackId = remote.stack?.id,
|
||||||
thumbhash = remote.thumbhash,
|
thumbhash = remote.thumbhash,
|
||||||
visibility = getVisibility(remote.visibility);
|
visibility = getVisibility(remote.visibility);
|
||||||
|
|
||||||
Asset({
|
Asset({
|
||||||
this.id = Isar.autoIncrement,
|
this.id = Isar.autoIncrement,
|
||||||
|
|
@ -127,11 +127,7 @@ class Asset {
|
||||||
@Index(unique: false, replace: false, type: IndexType.hash)
|
@Index(unique: false, replace: false, type: IndexType.hash)
|
||||||
String? localId;
|
String? localId;
|
||||||
|
|
||||||
@Index(
|
@Index(unique: true, replace: false, composite: [CompositeIndex("checksum", type: IndexType.hash)])
|
||||||
unique: true,
|
|
||||||
replace: false,
|
|
||||||
composite: [CompositeIndex("checksum", type: IndexType.hash)],
|
|
||||||
)
|
|
||||||
int ownerId;
|
int ownerId;
|
||||||
|
|
||||||
DateTime fileCreatedAt;
|
DateTime fileCreatedAt;
|
||||||
|
|
@ -447,33 +443,32 @@ class Asset {
|
||||||
int? stackCount,
|
int? stackCount,
|
||||||
String? thumbhash,
|
String? thumbhash,
|
||||||
AssetVisibilityEnum? visibility,
|
AssetVisibilityEnum? visibility,
|
||||||
}) =>
|
}) => Asset(
|
||||||
Asset(
|
id: id ?? this.id,
|
||||||
id: id ?? this.id,
|
checksum: checksum ?? this.checksum,
|
||||||
checksum: checksum ?? this.checksum,
|
remoteId: remoteId ?? this.remoteId,
|
||||||
remoteId: remoteId ?? this.remoteId,
|
localId: localId ?? this.localId,
|
||||||
localId: localId ?? this.localId,
|
ownerId: ownerId ?? this.ownerId,
|
||||||
ownerId: ownerId ?? this.ownerId,
|
fileCreatedAt: fileCreatedAt ?? this.fileCreatedAt,
|
||||||
fileCreatedAt: fileCreatedAt ?? this.fileCreatedAt,
|
fileModifiedAt: fileModifiedAt ?? this.fileModifiedAt,
|
||||||
fileModifiedAt: fileModifiedAt ?? this.fileModifiedAt,
|
updatedAt: updatedAt ?? this.updatedAt,
|
||||||
updatedAt: updatedAt ?? this.updatedAt,
|
durationInSeconds: durationInSeconds ?? this.durationInSeconds,
|
||||||
durationInSeconds: durationInSeconds ?? this.durationInSeconds,
|
type: type ?? this.type,
|
||||||
type: type ?? this.type,
|
width: width ?? this.width,
|
||||||
width: width ?? this.width,
|
height: height ?? this.height,
|
||||||
height: height ?? this.height,
|
fileName: fileName ?? this.fileName,
|
||||||
fileName: fileName ?? this.fileName,
|
livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId,
|
||||||
livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId,
|
isFavorite: isFavorite ?? this.isFavorite,
|
||||||
isFavorite: isFavorite ?? this.isFavorite,
|
isArchived: isArchived ?? this.isArchived,
|
||||||
isArchived: isArchived ?? this.isArchived,
|
isTrashed: isTrashed ?? this.isTrashed,
|
||||||
isTrashed: isTrashed ?? this.isTrashed,
|
isOffline: isOffline ?? this.isOffline,
|
||||||
isOffline: isOffline ?? this.isOffline,
|
exifInfo: exifInfo ?? this.exifInfo,
|
||||||
exifInfo: exifInfo ?? this.exifInfo,
|
stackId: stackId ?? this.stackId,
|
||||||
stackId: stackId ?? this.stackId,
|
stackPrimaryAssetId: stackPrimaryAssetId ?? this.stackPrimaryAssetId,
|
||||||
stackPrimaryAssetId: stackPrimaryAssetId ?? this.stackPrimaryAssetId,
|
stackCount: stackCount ?? this.stackCount,
|
||||||
stackCount: stackCount ?? this.stackCount,
|
thumbhash: thumbhash ?? this.thumbhash,
|
||||||
thumbhash: thumbhash ?? this.thumbhash,
|
visibility: visibility ?? this.visibility,
|
||||||
visibility: visibility ?? this.visibility,
|
);
|
||||||
);
|
|
||||||
|
|
||||||
Future<void> put(Isar db) async {
|
Future<void> put(Isar db) async {
|
||||||
await db.assets.put(this);
|
await db.assets.put(this);
|
||||||
|
|
@ -494,10 +489,7 @@ class Asset {
|
||||||
return compareByChecksum(a, b);
|
return compareByChecksum(a, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int compareByOwnerChecksumCreatedModified(
|
static int compareByOwnerChecksumCreatedModified(Asset a, Asset b) {
|
||||||
Asset a,
|
|
||||||
Asset b,
|
|
||||||
) {
|
|
||||||
final int ownerIdOrder = a.ownerId.compareTo(b.ownerId);
|
final int ownerIdOrder = a.ownerId.compareTo(b.ownerId);
|
||||||
if (ownerIdOrder != 0) return ownerIdOrder;
|
if (ownerIdOrder != 0) return ownerIdOrder;
|
||||||
final int checksumOrder = compareByChecksum(a, b);
|
final int checksumOrder = compareByChecksum(a, b);
|
||||||
|
|
@ -539,11 +531,11 @@ class Asset {
|
||||||
}
|
}
|
||||||
|
|
||||||
static getVisibility(AssetVisibility visibility) => switch (visibility) {
|
static getVisibility(AssetVisibility visibility) => switch (visibility) {
|
||||||
AssetVisibility.archive => AssetVisibilityEnum.archive,
|
AssetVisibility.archive => AssetVisibilityEnum.archive,
|
||||||
AssetVisibility.hidden => AssetVisibilityEnum.hidden,
|
AssetVisibility.hidden => AssetVisibilityEnum.hidden,
|
||||||
AssetVisibility.locked => AssetVisibilityEnum.locked,
|
AssetVisibility.locked => AssetVisibilityEnum.locked,
|
||||||
AssetVisibility.timeline || _ => AssetVisibilityEnum.timeline,
|
AssetVisibility.timeline || _ => AssetVisibilityEnum.timeline,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
enum AssetType {
|
enum AssetType {
|
||||||
|
|
@ -556,21 +548,17 @@ enum AssetType {
|
||||||
|
|
||||||
extension AssetTypeEnumHelper on AssetTypeEnum {
|
extension AssetTypeEnumHelper on AssetTypeEnum {
|
||||||
AssetType toAssetType() => switch (this) {
|
AssetType toAssetType() => switch (this) {
|
||||||
AssetTypeEnum.IMAGE => AssetType.image,
|
AssetTypeEnum.IMAGE => AssetType.image,
|
||||||
AssetTypeEnum.VIDEO => AssetType.video,
|
AssetTypeEnum.VIDEO => AssetType.video,
|
||||||
AssetTypeEnum.AUDIO => AssetType.audio,
|
AssetTypeEnum.AUDIO => AssetType.audio,
|
||||||
AssetTypeEnum.OTHER => AssetType.other,
|
AssetTypeEnum.OTHER => AssetType.other,
|
||||||
_ => throw Exception(),
|
_ => throw Exception(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Describes where the information of this asset came from:
|
/// Describes where the information of this asset came from:
|
||||||
/// only from the local device, only from the remote server or merged from both
|
/// only from the local device, only from the remote server or merged from both
|
||||||
enum AssetState {
|
enum AssetState { local, remote, merged }
|
||||||
local,
|
|
||||||
remote,
|
|
||||||
merged,
|
|
||||||
}
|
|
||||||
|
|
||||||
extension AssetsHelper on IsarCollection<Asset> {
|
extension AssetsHelper on IsarCollection<Asset> {
|
||||||
Future<int> deleteAllByRemoteId(Iterable<String> ids) => ids.isEmpty ? Future.value(0) : remote(ids).deleteAll();
|
Future<int> deleteAllByRemoteId(Iterable<String> ids) => ids.isEmpty ? Future.value(0) : remote(ids).deleteAll();
|
||||||
|
|
@ -579,13 +567,9 @@ extension AssetsHelper on IsarCollection<Asset> {
|
||||||
Future<List<Asset>> getAllByLocalId(Iterable<String> ids) => ids.isEmpty ? Future.value([]) : local(ids).findAll();
|
Future<List<Asset>> getAllByLocalId(Iterable<String> ids) => ids.isEmpty ? Future.value([]) : local(ids).findAll();
|
||||||
Future<Asset?> getByRemoteId(String id) => where().remoteIdEqualTo(id).findFirst();
|
Future<Asset?> getByRemoteId(String id) => where().remoteIdEqualTo(id).findFirst();
|
||||||
|
|
||||||
QueryBuilder<Asset, Asset, QAfterWhereClause> remote(
|
QueryBuilder<Asset, Asset, QAfterWhereClause> remote(Iterable<String> ids) =>
|
||||||
Iterable<String> ids,
|
|
||||||
) =>
|
|
||||||
where().anyOf(ids, (q, String e) => q.remoteIdEqualTo(e));
|
where().anyOf(ids, (q, String e) => q.remoteIdEqualTo(e));
|
||||||
QueryBuilder<Asset, Asset, QAfterWhereClause> local(
|
QueryBuilder<Asset, Asset, QAfterWhereClause> local(Iterable<String> ids) {
|
||||||
Iterable<String> ids,
|
|
||||||
) {
|
|
||||||
return where().anyOf(ids, (q, String e) => q.localIdEqualTo(e));
|
return where().anyOf(ids, (q, String e) => q.localIdEqualTo(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2305
mobile/lib/entities/asset.entity.g.dart
generated
2305
mobile/lib/entities/asset.entity.g.dart
generated
File diff suppressed because it is too large
Load diff
|
|
@ -14,21 +14,9 @@ class BackupAlbum {
|
||||||
|
|
||||||
Id get isarId => fastHash(id);
|
Id get isarId => fastHash(id);
|
||||||
|
|
||||||
BackupAlbum copyWith({
|
BackupAlbum copyWith({String? id, DateTime? lastBackup, BackupSelection? selection}) {
|
||||||
String? id,
|
return BackupAlbum(id ?? this.id, lastBackup ?? this.lastBackup, selection ?? this.selection);
|
||||||
DateTime? lastBackup,
|
|
||||||
BackupSelection? selection,
|
|
||||||
}) {
|
|
||||||
return BackupAlbum(
|
|
||||||
id ?? this.id,
|
|
||||||
lastBackup ?? this.lastBackup,
|
|
||||||
selection ?? this.selection,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum BackupSelection {
|
enum BackupSelection { none, select, exclude }
|
||||||
none,
|
|
||||||
select,
|
|
||||||
exclude;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
374
mobile/lib/entities/backup_album.entity.g.dart
generated
374
mobile/lib/entities/backup_album.entity.g.dart
generated
|
|
@ -17,11 +17,7 @@ const BackupAlbumSchema = CollectionSchema(
|
||||||
name: r'BackupAlbum',
|
name: r'BackupAlbum',
|
||||||
id: 8308487201128361847,
|
id: 8308487201128361847,
|
||||||
properties: {
|
properties: {
|
||||||
r'id': PropertySchema(
|
r'id': PropertySchema(id: 0, name: r'id', type: IsarType.string),
|
||||||
id: 0,
|
|
||||||
name: r'id',
|
|
||||||
type: IsarType.string,
|
|
||||||
),
|
|
||||||
r'lastBackup': PropertySchema(
|
r'lastBackup': PropertySchema(
|
||||||
id: 1,
|
id: 1,
|
||||||
name: r'lastBackup',
|
name: r'lastBackup',
|
||||||
|
|
@ -32,8 +28,9 @@ const BackupAlbumSchema = CollectionSchema(
|
||||||
name: r'selection',
|
name: r'selection',
|
||||||
type: IsarType.byte,
|
type: IsarType.byte,
|
||||||
enumMap: _BackupAlbumselectionEnumValueMap,
|
enumMap: _BackupAlbumselectionEnumValueMap,
|
||||||
)
|
),
|
||||||
},
|
},
|
||||||
|
|
||||||
estimateSize: _backupAlbumEstimateSize,
|
estimateSize: _backupAlbumEstimateSize,
|
||||||
serialize: _backupAlbumSerialize,
|
serialize: _backupAlbumSerialize,
|
||||||
deserialize: _backupAlbumDeserialize,
|
deserialize: _backupAlbumDeserialize,
|
||||||
|
|
@ -42,6 +39,7 @@ const BackupAlbumSchema = CollectionSchema(
|
||||||
indexes: {},
|
indexes: {},
|
||||||
links: {},
|
links: {},
|
||||||
embeddedSchemas: {},
|
embeddedSchemas: {},
|
||||||
|
|
||||||
getId: _backupAlbumGetId,
|
getId: _backupAlbumGetId,
|
||||||
getLinks: _backupAlbumGetLinks,
|
getLinks: _backupAlbumGetLinks,
|
||||||
attach: _backupAlbumAttach,
|
attach: _backupAlbumAttach,
|
||||||
|
|
@ -96,9 +94,11 @@ P _backupAlbumDeserializeProp<P>(
|
||||||
case 1:
|
case 1:
|
||||||
return (reader.readDateTime(offset)) as P;
|
return (reader.readDateTime(offset)) as P;
|
||||||
case 2:
|
case 2:
|
||||||
return (_BackupAlbumselectionValueEnumMap[
|
return (_BackupAlbumselectionValueEnumMap[reader.readByteOrNull(
|
||||||
reader.readByteOrNull(offset)] ??
|
offset,
|
||||||
BackupSelection.none) as P;
|
)] ??
|
||||||
|
BackupSelection.none)
|
||||||
|
as P;
|
||||||
default:
|
default:
|
||||||
throw IsarError('Unknown property with id $propertyId');
|
throw IsarError('Unknown property with id $propertyId');
|
||||||
}
|
}
|
||||||
|
|
@ -124,7 +124,10 @@ List<IsarLinkBase<dynamic>> _backupAlbumGetLinks(BackupAlbum object) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void _backupAlbumAttach(
|
void _backupAlbumAttach(
|
||||||
IsarCollection<dynamic> col, Id id, BackupAlbum object) {}
|
IsarCollection<dynamic> col,
|
||||||
|
Id id,
|
||||||
|
BackupAlbum object,
|
||||||
|
) {}
|
||||||
|
|
||||||
extension BackupAlbumQueryWhereSort
|
extension BackupAlbumQueryWhereSort
|
||||||
on QueryBuilder<BackupAlbum, BackupAlbum, QWhere> {
|
on QueryBuilder<BackupAlbum, BackupAlbum, QWhere> {
|
||||||
|
|
@ -138,17 +141,18 @@ extension BackupAlbumQueryWhereSort
|
||||||
extension BackupAlbumQueryWhere
|
extension BackupAlbumQueryWhere
|
||||||
on QueryBuilder<BackupAlbum, BackupAlbum, QWhereClause> {
|
on QueryBuilder<BackupAlbum, BackupAlbum, QWhereClause> {
|
||||||
QueryBuilder<BackupAlbum, BackupAlbum, QAfterWhereClause> isarIdEqualTo(
|
QueryBuilder<BackupAlbum, BackupAlbum, QAfterWhereClause> isarIdEqualTo(
|
||||||
Id isarId) {
|
Id isarId,
|
||||||
|
) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(IdWhereClause.between(
|
return query.addWhereClause(
|
||||||
lower: isarId,
|
IdWhereClause.between(lower: isarId, upper: isarId),
|
||||||
upper: isarId,
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<BackupAlbum, BackupAlbum, QAfterWhereClause> isarIdNotEqualTo(
|
QueryBuilder<BackupAlbum, BackupAlbum, QAfterWhereClause> isarIdNotEqualTo(
|
||||||
Id isarId) {
|
Id isarId,
|
||||||
|
) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
if (query.whereSort == Sort.asc) {
|
if (query.whereSort == Sort.asc) {
|
||||||
return query
|
return query
|
||||||
|
|
@ -171,8 +175,9 @@ extension BackupAlbumQueryWhere
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<BackupAlbum, BackupAlbum, QAfterWhereClause> isarIdGreaterThan(
|
QueryBuilder<BackupAlbum, BackupAlbum, QAfterWhereClause> isarIdGreaterThan(
|
||||||
Id isarId,
|
Id isarId, {
|
||||||
{bool include = false}) {
|
bool include = false,
|
||||||
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(
|
return query.addWhereClause(
|
||||||
IdWhereClause.greaterThan(lower: isarId, includeLower: include),
|
IdWhereClause.greaterThan(lower: isarId, includeLower: include),
|
||||||
|
|
@ -181,8 +186,9 @@ extension BackupAlbumQueryWhere
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<BackupAlbum, BackupAlbum, QAfterWhereClause> isarIdLessThan(
|
QueryBuilder<BackupAlbum, BackupAlbum, QAfterWhereClause> isarIdLessThan(
|
||||||
Id isarId,
|
Id isarId, {
|
||||||
{bool include = false}) {
|
bool include = false,
|
||||||
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(
|
return query.addWhereClause(
|
||||||
IdWhereClause.lessThan(upper: isarId, includeUpper: include),
|
IdWhereClause.lessThan(upper: isarId, includeUpper: include),
|
||||||
|
|
@ -197,12 +203,14 @@ extension BackupAlbumQueryWhere
|
||||||
bool includeUpper = true,
|
bool includeUpper = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(IdWhereClause.between(
|
return query.addWhereClause(
|
||||||
lower: lowerIsarId,
|
IdWhereClause.between(
|
||||||
includeLower: includeLower,
|
lower: lowerIsarId,
|
||||||
upper: upperIsarId,
|
includeLower: includeLower,
|
||||||
includeUpper: includeUpper,
|
upper: upperIsarId,
|
||||||
));
|
includeUpper: includeUpper,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -214,11 +222,13 @@ extension BackupAlbumQueryFilter
|
||||||
bool caseSensitive = true,
|
bool caseSensitive = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.equalTo(
|
||||||
value: value,
|
property: r'id',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -228,12 +238,14 @@ extension BackupAlbumQueryFilter
|
||||||
bool caseSensitive = true,
|
bool caseSensitive = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.greaterThan(
|
||||||
property: r'id',
|
include: include,
|
||||||
value: value,
|
property: r'id',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -243,12 +255,14 @@ extension BackupAlbumQueryFilter
|
||||||
bool caseSensitive = true,
|
bool caseSensitive = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.lessThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.lessThan(
|
||||||
property: r'id',
|
include: include,
|
||||||
value: value,
|
property: r'id',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -260,14 +274,16 @@ extension BackupAlbumQueryFilter
|
||||||
bool caseSensitive = true,
|
bool caseSensitive = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.between(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.between(
|
||||||
lower: lower,
|
property: r'id',
|
||||||
includeLower: includeLower,
|
lower: lower,
|
||||||
upper: upper,
|
includeLower: includeLower,
|
||||||
includeUpper: includeUpper,
|
upper: upper,
|
||||||
caseSensitive: caseSensitive,
|
includeUpper: includeUpper,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -276,11 +292,13 @@ extension BackupAlbumQueryFilter
|
||||||
bool caseSensitive = true,
|
bool caseSensitive = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.startsWith(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.startsWith(
|
||||||
value: value,
|
property: r'id',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -289,77 +307,82 @@ extension BackupAlbumQueryFilter
|
||||||
bool caseSensitive = true,
|
bool caseSensitive = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.endsWith(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.endsWith(
|
||||||
value: value,
|
property: r'id',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> idContains(
|
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> idContains(
|
||||||
String value,
|
String value, {
|
||||||
{bool caseSensitive = true}) {
|
bool caseSensitive = true,
|
||||||
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.contains(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.contains(
|
||||||
value: value,
|
property: r'id',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> idMatches(
|
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> idMatches(
|
||||||
String pattern,
|
String pattern, {
|
||||||
{bool caseSensitive = true}) {
|
bool caseSensitive = true,
|
||||||
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.matches(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.matches(
|
||||||
wildcard: pattern,
|
property: r'id',
|
||||||
caseSensitive: caseSensitive,
|
wildcard: pattern,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> idIsEmpty() {
|
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> idIsEmpty() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.equalTo(property: r'id', value: ''),
|
||||||
value: '',
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> idIsNotEmpty() {
|
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> idIsNotEmpty() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.greaterThan(property: r'id', value: ''),
|
||||||
value: '',
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> isarIdEqualTo(
|
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition> isarIdEqualTo(
|
||||||
Id value) {
|
Id value,
|
||||||
|
) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
return query.addFilterCondition(
|
||||||
property: r'isarId',
|
FilterCondition.equalTo(property: r'isarId', value: value),
|
||||||
value: value,
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
|
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
|
||||||
isarIdGreaterThan(
|
isarIdGreaterThan(Id value, {bool include = false}) {
|
||||||
Id value, {
|
|
||||||
bool include = false,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.greaterThan(
|
||||||
property: r'isarId',
|
include: include,
|
||||||
value: value,
|
property: r'isarId',
|
||||||
));
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -368,11 +391,13 @@ extension BackupAlbumQueryFilter
|
||||||
bool include = false,
|
bool include = false,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.lessThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.lessThan(
|
||||||
property: r'isarId',
|
include: include,
|
||||||
value: value,
|
property: r'isarId',
|
||||||
));
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -383,125 +408,125 @@ extension BackupAlbumQueryFilter
|
||||||
bool includeUpper = true,
|
bool includeUpper = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.between(
|
return query.addFilterCondition(
|
||||||
property: r'isarId',
|
FilterCondition.between(
|
||||||
lower: lower,
|
property: r'isarId',
|
||||||
includeLower: includeLower,
|
lower: lower,
|
||||||
upper: upper,
|
includeLower: includeLower,
|
||||||
includeUpper: includeUpper,
|
upper: upper,
|
||||||
));
|
includeUpper: includeUpper,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
|
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
|
||||||
lastBackupEqualTo(DateTime value) {
|
lastBackupEqualTo(DateTime value) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
return query.addFilterCondition(
|
||||||
property: r'lastBackup',
|
FilterCondition.equalTo(property: r'lastBackup', value: value),
|
||||||
value: value,
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
|
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
|
||||||
lastBackupGreaterThan(
|
lastBackupGreaterThan(DateTime value, {bool include = false}) {
|
||||||
DateTime value, {
|
|
||||||
bool include = false,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.greaterThan(
|
||||||
property: r'lastBackup',
|
include: include,
|
||||||
value: value,
|
property: r'lastBackup',
|
||||||
));
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
|
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
|
||||||
lastBackupLessThan(
|
lastBackupLessThan(DateTime value, {bool include = false}) {
|
||||||
DateTime value, {
|
|
||||||
bool include = false,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.lessThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.lessThan(
|
||||||
property: r'lastBackup',
|
include: include,
|
||||||
value: value,
|
property: r'lastBackup',
|
||||||
));
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
|
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
|
||||||
lastBackupBetween(
|
lastBackupBetween(
|
||||||
DateTime lower,
|
DateTime lower,
|
||||||
DateTime upper, {
|
DateTime upper, {
|
||||||
bool includeLower = true,
|
bool includeLower = true,
|
||||||
bool includeUpper = true,
|
bool includeUpper = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.between(
|
return query.addFilterCondition(
|
||||||
property: r'lastBackup',
|
FilterCondition.between(
|
||||||
lower: lower,
|
property: r'lastBackup',
|
||||||
includeLower: includeLower,
|
lower: lower,
|
||||||
upper: upper,
|
includeLower: includeLower,
|
||||||
includeUpper: includeUpper,
|
upper: upper,
|
||||||
));
|
includeUpper: includeUpper,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
|
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
|
||||||
selectionEqualTo(BackupSelection value) {
|
selectionEqualTo(BackupSelection value) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
return query.addFilterCondition(
|
||||||
property: r'selection',
|
FilterCondition.equalTo(property: r'selection', value: value),
|
||||||
value: value,
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
|
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
|
||||||
selectionGreaterThan(
|
selectionGreaterThan(BackupSelection value, {bool include = false}) {
|
||||||
BackupSelection value, {
|
|
||||||
bool include = false,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.greaterThan(
|
||||||
property: r'selection',
|
include: include,
|
||||||
value: value,
|
property: r'selection',
|
||||||
));
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
|
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
|
||||||
selectionLessThan(
|
selectionLessThan(BackupSelection value, {bool include = false}) {
|
||||||
BackupSelection value, {
|
|
||||||
bool include = false,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.lessThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.lessThan(
|
||||||
property: r'selection',
|
include: include,
|
||||||
value: value,
|
property: r'selection',
|
||||||
));
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
|
QueryBuilder<BackupAlbum, BackupAlbum, QAfterFilterCondition>
|
||||||
selectionBetween(
|
selectionBetween(
|
||||||
BackupSelection lower,
|
BackupSelection lower,
|
||||||
BackupSelection upper, {
|
BackupSelection upper, {
|
||||||
bool includeLower = true,
|
bool includeLower = true,
|
||||||
bool includeUpper = true,
|
bool includeUpper = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.between(
|
return query.addFilterCondition(
|
||||||
property: r'selection',
|
FilterCondition.between(
|
||||||
lower: lower,
|
property: r'selection',
|
||||||
includeLower: includeLower,
|
lower: lower,
|
||||||
upper: upper,
|
includeLower: includeLower,
|
||||||
includeUpper: includeUpper,
|
upper: upper,
|
||||||
));
|
includeUpper: includeUpper,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -604,8 +629,9 @@ extension BackupAlbumQuerySortThenBy
|
||||||
|
|
||||||
extension BackupAlbumQueryWhereDistinct
|
extension BackupAlbumQueryWhereDistinct
|
||||||
on QueryBuilder<BackupAlbum, BackupAlbum, QDistinct> {
|
on QueryBuilder<BackupAlbum, BackupAlbum, QDistinct> {
|
||||||
QueryBuilder<BackupAlbum, BackupAlbum, QDistinct> distinctById(
|
QueryBuilder<BackupAlbum, BackupAlbum, QDistinct> distinctById({
|
||||||
{bool caseSensitive = true}) {
|
bool caseSensitive = true,
|
||||||
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addDistinctBy(r'id', caseSensitive: caseSensitive);
|
return query.addDistinctBy(r'id', caseSensitive: caseSensitive);
|
||||||
});
|
});
|
||||||
|
|
@ -645,7 +671,7 @@ extension BackupAlbumQueryProperty
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<BackupAlbum, BackupSelection, QQueryOperations>
|
QueryBuilder<BackupAlbum, BackupSelection, QQueryOperations>
|
||||||
selectionProperty() {
|
selectionProperty() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addPropertyName(r'selection');
|
return query.addPropertyName(r'selection');
|
||||||
});
|
});
|
||||||
|
|
|
||||||
269
mobile/lib/entities/duplicated_asset.entity.g.dart
generated
269
mobile/lib/entities/duplicated_asset.entity.g.dart
generated
|
|
@ -17,12 +17,9 @@ const DuplicatedAssetSchema = CollectionSchema(
|
||||||
name: r'DuplicatedAsset',
|
name: r'DuplicatedAsset',
|
||||||
id: -2679334728174694496,
|
id: -2679334728174694496,
|
||||||
properties: {
|
properties: {
|
||||||
r'id': PropertySchema(
|
r'id': PropertySchema(id: 0, name: r'id', type: IsarType.string),
|
||||||
id: 0,
|
|
||||||
name: r'id',
|
|
||||||
type: IsarType.string,
|
|
||||||
)
|
|
||||||
},
|
},
|
||||||
|
|
||||||
estimateSize: _duplicatedAssetEstimateSize,
|
estimateSize: _duplicatedAssetEstimateSize,
|
||||||
serialize: _duplicatedAssetSerialize,
|
serialize: _duplicatedAssetSerialize,
|
||||||
deserialize: _duplicatedAssetDeserialize,
|
deserialize: _duplicatedAssetDeserialize,
|
||||||
|
|
@ -31,6 +28,7 @@ const DuplicatedAssetSchema = CollectionSchema(
|
||||||
indexes: {},
|
indexes: {},
|
||||||
links: {},
|
links: {},
|
||||||
embeddedSchemas: {},
|
embeddedSchemas: {},
|
||||||
|
|
||||||
getId: _duplicatedAssetGetId,
|
getId: _duplicatedAssetGetId,
|
||||||
getLinks: _duplicatedAssetGetLinks,
|
getLinks: _duplicatedAssetGetLinks,
|
||||||
attach: _duplicatedAssetAttach,
|
attach: _duplicatedAssetAttach,
|
||||||
|
|
@ -62,9 +60,7 @@ DuplicatedAsset _duplicatedAssetDeserialize(
|
||||||
List<int> offsets,
|
List<int> offsets,
|
||||||
Map<Type, List<int>> allOffsets,
|
Map<Type, List<int>> allOffsets,
|
||||||
) {
|
) {
|
||||||
final object = DuplicatedAsset(
|
final object = DuplicatedAsset(reader.readString(offsets[0]));
|
||||||
reader.readString(offsets[0]),
|
|
||||||
);
|
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -91,7 +87,10 @@ List<IsarLinkBase<dynamic>> _duplicatedAssetGetLinks(DuplicatedAsset object) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void _duplicatedAssetAttach(
|
void _duplicatedAssetAttach(
|
||||||
IsarCollection<dynamic> col, Id id, DuplicatedAsset object) {}
|
IsarCollection<dynamic> col,
|
||||||
|
Id id,
|
||||||
|
DuplicatedAsset object,
|
||||||
|
) {}
|
||||||
|
|
||||||
extension DuplicatedAssetQueryWhereSort
|
extension DuplicatedAssetQueryWhereSort
|
||||||
on QueryBuilder<DuplicatedAsset, DuplicatedAsset, QWhere> {
|
on QueryBuilder<DuplicatedAsset, DuplicatedAsset, QWhere> {
|
||||||
|
|
@ -105,17 +104,16 @@ extension DuplicatedAssetQueryWhereSort
|
||||||
extension DuplicatedAssetQueryWhere
|
extension DuplicatedAssetQueryWhere
|
||||||
on QueryBuilder<DuplicatedAsset, DuplicatedAsset, QWhereClause> {
|
on QueryBuilder<DuplicatedAsset, DuplicatedAsset, QWhereClause> {
|
||||||
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterWhereClause>
|
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterWhereClause>
|
||||||
isarIdEqualTo(Id isarId) {
|
isarIdEqualTo(Id isarId) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(IdWhereClause.between(
|
return query.addWhereClause(
|
||||||
lower: isarId,
|
IdWhereClause.between(lower: isarId, upper: isarId),
|
||||||
upper: isarId,
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterWhereClause>
|
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterWhereClause>
|
||||||
isarIdNotEqualTo(Id isarId) {
|
isarIdNotEqualTo(Id isarId) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
if (query.whereSort == Sort.asc) {
|
if (query.whereSort == Sort.asc) {
|
||||||
return query
|
return query
|
||||||
|
|
@ -138,7 +136,7 @@ extension DuplicatedAssetQueryWhere
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterWhereClause>
|
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterWhereClause>
|
||||||
isarIdGreaterThan(Id isarId, {bool include = false}) {
|
isarIdGreaterThan(Id isarId, {bool include = false}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(
|
return query.addWhereClause(
|
||||||
IdWhereClause.greaterThan(lower: isarId, includeLower: include),
|
IdWhereClause.greaterThan(lower: isarId, includeLower: include),
|
||||||
|
|
@ -147,7 +145,7 @@ extension DuplicatedAssetQueryWhere
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterWhereClause>
|
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterWhereClause>
|
||||||
isarIdLessThan(Id isarId, {bool include = false}) {
|
isarIdLessThan(Id isarId, {bool include = false}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(
|
return query.addWhereClause(
|
||||||
IdWhereClause.lessThan(upper: isarId, includeUpper: include),
|
IdWhereClause.lessThan(upper: isarId, includeUpper: include),
|
||||||
|
|
@ -156,19 +154,21 @@ extension DuplicatedAssetQueryWhere
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterWhereClause>
|
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterWhereClause>
|
||||||
isarIdBetween(
|
isarIdBetween(
|
||||||
Id lowerIsarId,
|
Id lowerIsarId,
|
||||||
Id upperIsarId, {
|
Id upperIsarId, {
|
||||||
bool includeLower = true,
|
bool includeLower = true,
|
||||||
bool includeUpper = true,
|
bool includeUpper = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(IdWhereClause.between(
|
return query.addWhereClause(
|
||||||
lower: lowerIsarId,
|
IdWhereClause.between(
|
||||||
includeLower: includeLower,
|
lower: lowerIsarId,
|
||||||
upper: upperIsarId,
|
includeLower: includeLower,
|
||||||
includeUpper: includeUpper,
|
upper: upperIsarId,
|
||||||
));
|
includeUpper: includeUpper,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -176,53 +176,52 @@ extension DuplicatedAssetQueryWhere
|
||||||
extension DuplicatedAssetQueryFilter
|
extension DuplicatedAssetQueryFilter
|
||||||
on QueryBuilder<DuplicatedAsset, DuplicatedAsset, QFilterCondition> {
|
on QueryBuilder<DuplicatedAsset, DuplicatedAsset, QFilterCondition> {
|
||||||
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
|
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
|
||||||
idEqualTo(
|
idEqualTo(String value, {bool caseSensitive = true}) {
|
||||||
String value, {
|
|
||||||
bool caseSensitive = true,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.equalTo(
|
||||||
value: value,
|
property: r'id',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
|
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
|
||||||
idGreaterThan(
|
idGreaterThan(
|
||||||
String value, {
|
String value, {
|
||||||
bool include = false,
|
bool include = false,
|
||||||
bool caseSensitive = true,
|
bool caseSensitive = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.greaterThan(
|
||||||
property: r'id',
|
include: include,
|
||||||
value: value,
|
property: r'id',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
|
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
|
||||||
idLessThan(
|
idLessThan(String value, {bool include = false, bool caseSensitive = true}) {
|
||||||
String value, {
|
|
||||||
bool include = false,
|
|
||||||
bool caseSensitive = true,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.lessThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.lessThan(
|
||||||
property: r'id',
|
include: include,
|
||||||
value: value,
|
property: r'id',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
|
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
|
||||||
idBetween(
|
idBetween(
|
||||||
String lower,
|
String lower,
|
||||||
String upper, {
|
String upper, {
|
||||||
bool includeLower = true,
|
bool includeLower = true,
|
||||||
|
|
@ -230,140 +229,141 @@ extension DuplicatedAssetQueryFilter
|
||||||
bool caseSensitive = true,
|
bool caseSensitive = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.between(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.between(
|
||||||
lower: lower,
|
property: r'id',
|
||||||
includeLower: includeLower,
|
lower: lower,
|
||||||
upper: upper,
|
includeLower: includeLower,
|
||||||
includeUpper: includeUpper,
|
upper: upper,
|
||||||
caseSensitive: caseSensitive,
|
includeUpper: includeUpper,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
|
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
|
||||||
idStartsWith(
|
idStartsWith(String value, {bool caseSensitive = true}) {
|
||||||
String value, {
|
|
||||||
bool caseSensitive = true,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.startsWith(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.startsWith(
|
||||||
value: value,
|
property: r'id',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
|
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
|
||||||
idEndsWith(
|
idEndsWith(String value, {bool caseSensitive = true}) {
|
||||||
String value, {
|
|
||||||
bool caseSensitive = true,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.endsWith(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.endsWith(
|
||||||
value: value,
|
property: r'id',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
|
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
|
||||||
idContains(String value, {bool caseSensitive = true}) {
|
idContains(String value, {bool caseSensitive = true}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.contains(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.contains(
|
||||||
value: value,
|
property: r'id',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
|
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
|
||||||
idMatches(String pattern, {bool caseSensitive = true}) {
|
idMatches(String pattern, {bool caseSensitive = true}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.matches(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.matches(
|
||||||
wildcard: pattern,
|
property: r'id',
|
||||||
caseSensitive: caseSensitive,
|
wildcard: pattern,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
|
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
|
||||||
idIsEmpty() {
|
idIsEmpty() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.equalTo(property: r'id', value: ''),
|
||||||
value: '',
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
|
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
|
||||||
idIsNotEmpty() {
|
idIsNotEmpty() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.greaterThan(property: r'id', value: ''),
|
||||||
value: '',
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
|
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
|
||||||
isarIdEqualTo(Id value) {
|
isarIdEqualTo(Id value) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
return query.addFilterCondition(
|
||||||
property: r'isarId',
|
FilterCondition.equalTo(property: r'isarId', value: value),
|
||||||
value: value,
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
|
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
|
||||||
isarIdGreaterThan(
|
isarIdGreaterThan(Id value, {bool include = false}) {
|
||||||
Id value, {
|
|
||||||
bool include = false,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.greaterThan(
|
||||||
property: r'isarId',
|
include: include,
|
||||||
value: value,
|
property: r'isarId',
|
||||||
));
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
|
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
|
||||||
isarIdLessThan(
|
isarIdLessThan(Id value, {bool include = false}) {
|
||||||
Id value, {
|
|
||||||
bool include = false,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.lessThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.lessThan(
|
||||||
property: r'isarId',
|
include: include,
|
||||||
value: value,
|
property: r'isarId',
|
||||||
));
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
|
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterFilterCondition>
|
||||||
isarIdBetween(
|
isarIdBetween(
|
||||||
Id lower,
|
Id lower,
|
||||||
Id upper, {
|
Id upper, {
|
||||||
bool includeLower = true,
|
bool includeLower = true,
|
||||||
bool includeUpper = true,
|
bool includeUpper = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.between(
|
return query.addFilterCondition(
|
||||||
property: r'isarId',
|
FilterCondition.between(
|
||||||
lower: lower,
|
property: r'isarId',
|
||||||
includeLower: includeLower,
|
lower: lower,
|
||||||
upper: upper,
|
includeLower: includeLower,
|
||||||
includeUpper: includeUpper,
|
upper: upper,
|
||||||
));
|
includeUpper: includeUpper,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -410,7 +410,7 @@ extension DuplicatedAssetQuerySortThenBy
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterSortBy>
|
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QAfterSortBy>
|
||||||
thenByIsarIdDesc() {
|
thenByIsarIdDesc() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addSortBy(r'isarId', Sort.desc);
|
return query.addSortBy(r'isarId', Sort.desc);
|
||||||
});
|
});
|
||||||
|
|
@ -419,8 +419,9 @@ extension DuplicatedAssetQuerySortThenBy
|
||||||
|
|
||||||
extension DuplicatedAssetQueryWhereDistinct
|
extension DuplicatedAssetQueryWhereDistinct
|
||||||
on QueryBuilder<DuplicatedAsset, DuplicatedAsset, QDistinct> {
|
on QueryBuilder<DuplicatedAsset, DuplicatedAsset, QDistinct> {
|
||||||
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QDistinct> distinctById(
|
QueryBuilder<DuplicatedAsset, DuplicatedAsset, QDistinct> distinctById({
|
||||||
{bool caseSensitive = true}) {
|
bool caseSensitive = true,
|
||||||
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addDistinctBy(r'id', caseSensitive: caseSensitive);
|
return query.addDistinctBy(r'id', caseSensitive: caseSensitive);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
419
mobile/lib/entities/etag.entity.g.dart
generated
419
mobile/lib/entities/etag.entity.g.dart
generated
|
|
@ -22,17 +22,10 @@ const ETagSchema = CollectionSchema(
|
||||||
name: r'assetCount',
|
name: r'assetCount',
|
||||||
type: IsarType.long,
|
type: IsarType.long,
|
||||||
),
|
),
|
||||||
r'id': PropertySchema(
|
r'id': PropertySchema(id: 1, name: r'id', type: IsarType.string),
|
||||||
id: 1,
|
r'time': PropertySchema(id: 2, name: r'time', type: IsarType.dateTime),
|
||||||
name: r'id',
|
|
||||||
type: IsarType.string,
|
|
||||||
),
|
|
||||||
r'time': PropertySchema(
|
|
||||||
id: 2,
|
|
||||||
name: r'time',
|
|
||||||
type: IsarType.dateTime,
|
|
||||||
)
|
|
||||||
},
|
},
|
||||||
|
|
||||||
estimateSize: _eTagEstimateSize,
|
estimateSize: _eTagEstimateSize,
|
||||||
serialize: _eTagSerialize,
|
serialize: _eTagSerialize,
|
||||||
deserialize: _eTagDeserialize,
|
deserialize: _eTagDeserialize,
|
||||||
|
|
@ -49,12 +42,13 @@ const ETagSchema = CollectionSchema(
|
||||||
name: r'id',
|
name: r'id',
|
||||||
type: IndexType.hash,
|
type: IndexType.hash,
|
||||||
caseSensitive: true,
|
caseSensitive: true,
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
)
|
),
|
||||||
},
|
},
|
||||||
links: {},
|
links: {},
|
||||||
embeddedSchemas: {},
|
embeddedSchemas: {},
|
||||||
|
|
||||||
getId: _eTagGetId,
|
getId: _eTagGetId,
|
||||||
getLinks: _eTagGetLinks,
|
getLinks: _eTagGetLinks,
|
||||||
attach: _eTagAttach,
|
attach: _eTagAttach,
|
||||||
|
|
@ -189,10 +183,9 @@ extension ETagQueryWhereSort on QueryBuilder<ETag, ETag, QWhere> {
|
||||||
extension ETagQueryWhere on QueryBuilder<ETag, ETag, QWhereClause> {
|
extension ETagQueryWhere on QueryBuilder<ETag, ETag, QWhereClause> {
|
||||||
QueryBuilder<ETag, ETag, QAfterWhereClause> isarIdEqualTo(Id isarId) {
|
QueryBuilder<ETag, ETag, QAfterWhereClause> isarIdEqualTo(Id isarId) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(IdWhereClause.between(
|
return query.addWhereClause(
|
||||||
lower: isarId,
|
IdWhereClause.between(lower: isarId, upper: isarId),
|
||||||
upper: isarId,
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -218,8 +211,10 @@ extension ETagQueryWhere on QueryBuilder<ETag, ETag, QWhereClause> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<ETag, ETag, QAfterWhereClause> isarIdGreaterThan(Id isarId,
|
QueryBuilder<ETag, ETag, QAfterWhereClause> isarIdGreaterThan(
|
||||||
{bool include = false}) {
|
Id isarId, {
|
||||||
|
bool include = false,
|
||||||
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(
|
return query.addWhereClause(
|
||||||
IdWhereClause.greaterThan(lower: isarId, includeLower: include),
|
IdWhereClause.greaterThan(lower: isarId, includeLower: include),
|
||||||
|
|
@ -227,8 +222,10 @@ extension ETagQueryWhere on QueryBuilder<ETag, ETag, QWhereClause> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<ETag, ETag, QAfterWhereClause> isarIdLessThan(Id isarId,
|
QueryBuilder<ETag, ETag, QAfterWhereClause> isarIdLessThan(
|
||||||
{bool include = false}) {
|
Id isarId, {
|
||||||
|
bool include = false,
|
||||||
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(
|
return query.addWhereClause(
|
||||||
IdWhereClause.lessThan(upper: isarId, includeUpper: include),
|
IdWhereClause.lessThan(upper: isarId, includeUpper: include),
|
||||||
|
|
@ -243,21 +240,22 @@ extension ETagQueryWhere on QueryBuilder<ETag, ETag, QWhereClause> {
|
||||||
bool includeUpper = true,
|
bool includeUpper = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(IdWhereClause.between(
|
return query.addWhereClause(
|
||||||
lower: lowerIsarId,
|
IdWhereClause.between(
|
||||||
includeLower: includeLower,
|
lower: lowerIsarId,
|
||||||
upper: upperIsarId,
|
includeLower: includeLower,
|
||||||
includeUpper: includeUpper,
|
upper: upperIsarId,
|
||||||
));
|
includeUpper: includeUpper,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<ETag, ETag, QAfterWhereClause> idEqualTo(String id) {
|
QueryBuilder<ETag, ETag, QAfterWhereClause> idEqualTo(String id) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(IndexWhereClause.equalTo(
|
return query.addWhereClause(
|
||||||
indexName: r'id',
|
IndexWhereClause.equalTo(indexName: r'id', value: [id]),
|
||||||
value: [id],
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -265,32 +263,40 @@ extension ETagQueryWhere on QueryBuilder<ETag, ETag, QWhereClause> {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
if (query.whereSort == Sort.asc) {
|
if (query.whereSort == Sort.asc) {
|
||||||
return query
|
return query
|
||||||
.addWhereClause(IndexWhereClause.between(
|
.addWhereClause(
|
||||||
indexName: r'id',
|
IndexWhereClause.between(
|
||||||
lower: [],
|
indexName: r'id',
|
||||||
upper: [id],
|
lower: [],
|
||||||
includeUpper: false,
|
upper: [id],
|
||||||
))
|
includeUpper: false,
|
||||||
.addWhereClause(IndexWhereClause.between(
|
),
|
||||||
indexName: r'id',
|
)
|
||||||
lower: [id],
|
.addWhereClause(
|
||||||
includeLower: false,
|
IndexWhereClause.between(
|
||||||
upper: [],
|
indexName: r'id',
|
||||||
));
|
lower: [id],
|
||||||
|
includeLower: false,
|
||||||
|
upper: [],
|
||||||
|
),
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
return query
|
return query
|
||||||
.addWhereClause(IndexWhereClause.between(
|
.addWhereClause(
|
||||||
indexName: r'id',
|
IndexWhereClause.between(
|
||||||
lower: [id],
|
indexName: r'id',
|
||||||
includeLower: false,
|
lower: [id],
|
||||||
upper: [],
|
includeLower: false,
|
||||||
))
|
upper: [],
|
||||||
.addWhereClause(IndexWhereClause.between(
|
),
|
||||||
indexName: r'id',
|
)
|
||||||
lower: [],
|
.addWhereClause(
|
||||||
upper: [id],
|
IndexWhereClause.between(
|
||||||
includeUpper: false,
|
indexName: r'id',
|
||||||
));
|
lower: [],
|
||||||
|
upper: [id],
|
||||||
|
includeUpper: false,
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -299,27 +305,27 @@ extension ETagQueryWhere on QueryBuilder<ETag, ETag, QWhereClause> {
|
||||||
extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
|
extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
|
||||||
QueryBuilder<ETag, ETag, QAfterFilterCondition> assetCountIsNull() {
|
QueryBuilder<ETag, ETag, QAfterFilterCondition> assetCountIsNull() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(const FilterCondition.isNull(
|
return query.addFilterCondition(
|
||||||
property: r'assetCount',
|
const FilterCondition.isNull(property: r'assetCount'),
|
||||||
));
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<ETag, ETag, QAfterFilterCondition> assetCountIsNotNull() {
|
QueryBuilder<ETag, ETag, QAfterFilterCondition> assetCountIsNotNull() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(const FilterCondition.isNotNull(
|
return query.addFilterCondition(
|
||||||
property: r'assetCount',
|
const FilterCondition.isNotNull(property: r'assetCount'),
|
||||||
));
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<ETag, ETag, QAfterFilterCondition> assetCountEqualTo(
|
QueryBuilder<ETag, ETag, QAfterFilterCondition> assetCountEqualTo(
|
||||||
int? value) {
|
int? value,
|
||||||
|
) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
return query.addFilterCondition(
|
||||||
property: r'assetCount',
|
FilterCondition.equalTo(property: r'assetCount', value: value),
|
||||||
value: value,
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -328,11 +334,13 @@ extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
|
||||||
bool include = false,
|
bool include = false,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.greaterThan(
|
||||||
property: r'assetCount',
|
include: include,
|
||||||
value: value,
|
property: r'assetCount',
|
||||||
));
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -341,11 +349,13 @@ extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
|
||||||
bool include = false,
|
bool include = false,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.lessThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.lessThan(
|
||||||
property: r'assetCount',
|
include: include,
|
||||||
value: value,
|
property: r'assetCount',
|
||||||
));
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -356,13 +366,15 @@ extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
|
||||||
bool includeUpper = true,
|
bool includeUpper = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.between(
|
return query.addFilterCondition(
|
||||||
property: r'assetCount',
|
FilterCondition.between(
|
||||||
lower: lower,
|
property: r'assetCount',
|
||||||
includeLower: includeLower,
|
lower: lower,
|
||||||
upper: upper,
|
includeLower: includeLower,
|
||||||
includeUpper: includeUpper,
|
upper: upper,
|
||||||
));
|
includeUpper: includeUpper,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -371,11 +383,13 @@ extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
|
||||||
bool caseSensitive = true,
|
bool caseSensitive = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.equalTo(
|
||||||
value: value,
|
property: r'id',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -385,12 +399,14 @@ extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
|
||||||
bool caseSensitive = true,
|
bool caseSensitive = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.greaterThan(
|
||||||
property: r'id',
|
include: include,
|
||||||
value: value,
|
property: r'id',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -400,12 +416,14 @@ extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
|
||||||
bool caseSensitive = true,
|
bool caseSensitive = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.lessThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.lessThan(
|
||||||
property: r'id',
|
include: include,
|
||||||
value: value,
|
property: r'id',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -417,14 +435,16 @@ extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
|
||||||
bool caseSensitive = true,
|
bool caseSensitive = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.between(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.between(
|
||||||
lower: lower,
|
property: r'id',
|
||||||
includeLower: includeLower,
|
lower: lower,
|
||||||
upper: upper,
|
includeLower: includeLower,
|
||||||
includeUpper: includeUpper,
|
upper: upper,
|
||||||
caseSensitive: caseSensitive,
|
includeUpper: includeUpper,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -433,11 +453,13 @@ extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
|
||||||
bool caseSensitive = true,
|
bool caseSensitive = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.startsWith(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.startsWith(
|
||||||
value: value,
|
property: r'id',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -446,60 +468,67 @@ extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
|
||||||
bool caseSensitive = true,
|
bool caseSensitive = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.endsWith(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.endsWith(
|
||||||
value: value,
|
property: r'id',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<ETag, ETag, QAfterFilterCondition> idContains(String value,
|
QueryBuilder<ETag, ETag, QAfterFilterCondition> idContains(
|
||||||
{bool caseSensitive = true}) {
|
String value, {
|
||||||
|
bool caseSensitive = true,
|
||||||
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.contains(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.contains(
|
||||||
value: value,
|
property: r'id',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<ETag, ETag, QAfterFilterCondition> idMatches(String pattern,
|
QueryBuilder<ETag, ETag, QAfterFilterCondition> idMatches(
|
||||||
{bool caseSensitive = true}) {
|
String pattern, {
|
||||||
|
bool caseSensitive = true,
|
||||||
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.matches(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.matches(
|
||||||
wildcard: pattern,
|
property: r'id',
|
||||||
caseSensitive: caseSensitive,
|
wildcard: pattern,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<ETag, ETag, QAfterFilterCondition> idIsEmpty() {
|
QueryBuilder<ETag, ETag, QAfterFilterCondition> idIsEmpty() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.equalTo(property: r'id', value: ''),
|
||||||
value: '',
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<ETag, ETag, QAfterFilterCondition> idIsNotEmpty() {
|
QueryBuilder<ETag, ETag, QAfterFilterCondition> idIsNotEmpty() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.greaterThan(property: r'id', value: ''),
|
||||||
value: '',
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<ETag, ETag, QAfterFilterCondition> isarIdEqualTo(Id value) {
|
QueryBuilder<ETag, ETag, QAfterFilterCondition> isarIdEqualTo(Id value) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
return query.addFilterCondition(
|
||||||
property: r'isarId',
|
FilterCondition.equalTo(property: r'isarId', value: value),
|
||||||
value: value,
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -508,11 +537,13 @@ extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
|
||||||
bool include = false,
|
bool include = false,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.greaterThan(
|
||||||
property: r'isarId',
|
include: include,
|
||||||
value: value,
|
property: r'isarId',
|
||||||
));
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -521,11 +552,13 @@ extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
|
||||||
bool include = false,
|
bool include = false,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.lessThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.lessThan(
|
||||||
property: r'isarId',
|
include: include,
|
||||||
value: value,
|
property: r'isarId',
|
||||||
));
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -536,38 +569,39 @@ extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
|
||||||
bool includeUpper = true,
|
bool includeUpper = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.between(
|
return query.addFilterCondition(
|
||||||
property: r'isarId',
|
FilterCondition.between(
|
||||||
lower: lower,
|
property: r'isarId',
|
||||||
includeLower: includeLower,
|
lower: lower,
|
||||||
upper: upper,
|
includeLower: includeLower,
|
||||||
includeUpper: includeUpper,
|
upper: upper,
|
||||||
));
|
includeUpper: includeUpper,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<ETag, ETag, QAfterFilterCondition> timeIsNull() {
|
QueryBuilder<ETag, ETag, QAfterFilterCondition> timeIsNull() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(const FilterCondition.isNull(
|
return query.addFilterCondition(
|
||||||
property: r'time',
|
const FilterCondition.isNull(property: r'time'),
|
||||||
));
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<ETag, ETag, QAfterFilterCondition> timeIsNotNull() {
|
QueryBuilder<ETag, ETag, QAfterFilterCondition> timeIsNotNull() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(const FilterCondition.isNotNull(
|
return query.addFilterCondition(
|
||||||
property: r'time',
|
const FilterCondition.isNotNull(property: r'time'),
|
||||||
));
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<ETag, ETag, QAfterFilterCondition> timeEqualTo(DateTime? value) {
|
QueryBuilder<ETag, ETag, QAfterFilterCondition> timeEqualTo(DateTime? value) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
return query.addFilterCondition(
|
||||||
property: r'time',
|
FilterCondition.equalTo(property: r'time', value: value),
|
||||||
value: value,
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -576,11 +610,13 @@ extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
|
||||||
bool include = false,
|
bool include = false,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.greaterThan(
|
||||||
property: r'time',
|
include: include,
|
||||||
value: value,
|
property: r'time',
|
||||||
));
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -589,11 +625,13 @@ extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
|
||||||
bool include = false,
|
bool include = false,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.lessThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.lessThan(
|
||||||
property: r'time',
|
include: include,
|
||||||
value: value,
|
property: r'time',
|
||||||
));
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -604,13 +642,15 @@ extension ETagQueryFilter on QueryBuilder<ETag, ETag, QFilterCondition> {
|
||||||
bool includeUpper = true,
|
bool includeUpper = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.between(
|
return query.addFilterCondition(
|
||||||
property: r'time',
|
FilterCondition.between(
|
||||||
lower: lower,
|
property: r'time',
|
||||||
includeLower: includeLower,
|
lower: lower,
|
||||||
upper: upper,
|
includeLower: includeLower,
|
||||||
includeUpper: includeUpper,
|
upper: upper,
|
||||||
));
|
includeUpper: includeUpper,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -714,8 +754,9 @@ extension ETagQueryWhereDistinct on QueryBuilder<ETag, ETag, QDistinct> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<ETag, ETag, QDistinct> distinctById(
|
QueryBuilder<ETag, ETag, QDistinct> distinctById({
|
||||||
{bool caseSensitive = true}) {
|
bool caseSensitive = true,
|
||||||
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addDistinctBy(r'id', caseSensitive: caseSensitive);
|
return query.addDistinctBy(r'id', caseSensitive: caseSensitive);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
580
mobile/lib/entities/ios_device_asset.entity.g.dart
generated
580
mobile/lib/entities/ios_device_asset.entity.g.dart
generated
|
|
@ -17,17 +17,10 @@ const IOSDeviceAssetSchema = CollectionSchema(
|
||||||
name: r'IOSDeviceAsset',
|
name: r'IOSDeviceAsset',
|
||||||
id: -1671546753821948030,
|
id: -1671546753821948030,
|
||||||
properties: {
|
properties: {
|
||||||
r'hash': PropertySchema(
|
r'hash': PropertySchema(id: 0, name: r'hash', type: IsarType.byteList),
|
||||||
id: 0,
|
r'id': PropertySchema(id: 1, name: r'id', type: IsarType.string),
|
||||||
name: r'hash',
|
|
||||||
type: IsarType.byteList,
|
|
||||||
),
|
|
||||||
r'id': PropertySchema(
|
|
||||||
id: 1,
|
|
||||||
name: r'id',
|
|
||||||
type: IsarType.string,
|
|
||||||
)
|
|
||||||
},
|
},
|
||||||
|
|
||||||
estimateSize: _iOSDeviceAssetEstimateSize,
|
estimateSize: _iOSDeviceAssetEstimateSize,
|
||||||
serialize: _iOSDeviceAssetSerialize,
|
serialize: _iOSDeviceAssetSerialize,
|
||||||
deserialize: _iOSDeviceAssetDeserialize,
|
deserialize: _iOSDeviceAssetDeserialize,
|
||||||
|
|
@ -44,7 +37,7 @@ const IOSDeviceAssetSchema = CollectionSchema(
|
||||||
name: r'id',
|
name: r'id',
|
||||||
type: IndexType.hash,
|
type: IndexType.hash,
|
||||||
caseSensitive: true,
|
caseSensitive: true,
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
r'hash': IndexSchema(
|
r'hash': IndexSchema(
|
||||||
|
|
@ -57,12 +50,13 @@ const IOSDeviceAssetSchema = CollectionSchema(
|
||||||
name: r'hash',
|
name: r'hash',
|
||||||
type: IndexType.hash,
|
type: IndexType.hash,
|
||||||
caseSensitive: false,
|
caseSensitive: false,
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
)
|
),
|
||||||
},
|
},
|
||||||
links: {},
|
links: {},
|
||||||
embeddedSchemas: {},
|
embeddedSchemas: {},
|
||||||
|
|
||||||
getId: _iOSDeviceAssetGetId,
|
getId: _iOSDeviceAssetGetId,
|
||||||
getLinks: _iOSDeviceAssetGetLinks,
|
getLinks: _iOSDeviceAssetGetLinks,
|
||||||
attach: _iOSDeviceAssetAttach,
|
attach: _iOSDeviceAssetAttach,
|
||||||
|
|
@ -128,7 +122,10 @@ List<IsarLinkBase<dynamic>> _iOSDeviceAssetGetLinks(IOSDeviceAsset object) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void _iOSDeviceAssetAttach(
|
void _iOSDeviceAssetAttach(
|
||||||
IsarCollection<dynamic> col, Id id, IOSDeviceAsset object) {}
|
IsarCollection<dynamic> col,
|
||||||
|
Id id,
|
||||||
|
IOSDeviceAsset object,
|
||||||
|
) {}
|
||||||
|
|
||||||
extension IOSDeviceAssetByIndex on IsarCollection<IOSDeviceAsset> {
|
extension IOSDeviceAssetByIndex on IsarCollection<IOSDeviceAsset> {
|
||||||
Future<IOSDeviceAsset?> getById(String id) {
|
Future<IOSDeviceAsset?> getById(String id) {
|
||||||
|
|
@ -179,8 +176,10 @@ extension IOSDeviceAssetByIndex on IsarCollection<IOSDeviceAsset> {
|
||||||
return putAllByIndex(r'id', objects);
|
return putAllByIndex(r'id', objects);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Id> putAllByIdSync(List<IOSDeviceAsset> objects,
|
List<Id> putAllByIdSync(
|
||||||
{bool saveLinks = true}) {
|
List<IOSDeviceAsset> objects, {
|
||||||
|
bool saveLinks = true,
|
||||||
|
}) {
|
||||||
return putAllByIndexSync(r'id', objects, saveLinks: saveLinks);
|
return putAllByIndexSync(r'id', objects, saveLinks: saveLinks);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -197,17 +196,17 @@ extension IOSDeviceAssetQueryWhereSort
|
||||||
extension IOSDeviceAssetQueryWhere
|
extension IOSDeviceAssetQueryWhere
|
||||||
on QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QWhereClause> {
|
on QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QWhereClause> {
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause> isarIdEqualTo(
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause> isarIdEqualTo(
|
||||||
Id isarId) {
|
Id isarId,
|
||||||
|
) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(IdWhereClause.between(
|
return query.addWhereClause(
|
||||||
lower: isarId,
|
IdWhereClause.between(lower: isarId, upper: isarId),
|
||||||
upper: isarId,
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause>
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause>
|
||||||
isarIdNotEqualTo(Id isarId) {
|
isarIdNotEqualTo(Id isarId) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
if (query.whereSort == Sort.asc) {
|
if (query.whereSort == Sort.asc) {
|
||||||
return query
|
return query
|
||||||
|
|
@ -230,7 +229,7 @@ extension IOSDeviceAssetQueryWhere
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause>
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause>
|
||||||
isarIdGreaterThan(Id isarId, {bool include = false}) {
|
isarIdGreaterThan(Id isarId, {bool include = false}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(
|
return query.addWhereClause(
|
||||||
IdWhereClause.greaterThan(lower: isarId, includeLower: include),
|
IdWhereClause.greaterThan(lower: isarId, includeLower: include),
|
||||||
|
|
@ -239,7 +238,7 @@ extension IOSDeviceAssetQueryWhere
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause>
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause>
|
||||||
isarIdLessThan(Id isarId, {bool include = false}) {
|
isarIdLessThan(Id isarId, {bool include = false}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(
|
return query.addWhereClause(
|
||||||
IdWhereClause.lessThan(upper: isarId, includeUpper: include),
|
IdWhereClause.lessThan(upper: isarId, includeUpper: include),
|
||||||
|
|
@ -254,101 +253,120 @@ extension IOSDeviceAssetQueryWhere
|
||||||
bool includeUpper = true,
|
bool includeUpper = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(IdWhereClause.between(
|
return query.addWhereClause(
|
||||||
lower: lowerIsarId,
|
IdWhereClause.between(
|
||||||
includeLower: includeLower,
|
lower: lowerIsarId,
|
||||||
upper: upperIsarId,
|
includeLower: includeLower,
|
||||||
includeUpper: includeUpper,
|
upper: upperIsarId,
|
||||||
));
|
includeUpper: includeUpper,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause> idEqualTo(
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause> idEqualTo(
|
||||||
String id) {
|
String id,
|
||||||
|
) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(IndexWhereClause.equalTo(
|
return query.addWhereClause(
|
||||||
indexName: r'id',
|
IndexWhereClause.equalTo(indexName: r'id', value: [id]),
|
||||||
value: [id],
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause> idNotEqualTo(
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause> idNotEqualTo(
|
||||||
String id) {
|
String id,
|
||||||
|
) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
if (query.whereSort == Sort.asc) {
|
if (query.whereSort == Sort.asc) {
|
||||||
return query
|
return query
|
||||||
.addWhereClause(IndexWhereClause.between(
|
.addWhereClause(
|
||||||
indexName: r'id',
|
IndexWhereClause.between(
|
||||||
lower: [],
|
indexName: r'id',
|
||||||
upper: [id],
|
lower: [],
|
||||||
includeUpper: false,
|
upper: [id],
|
||||||
))
|
includeUpper: false,
|
||||||
.addWhereClause(IndexWhereClause.between(
|
),
|
||||||
indexName: r'id',
|
)
|
||||||
lower: [id],
|
.addWhereClause(
|
||||||
includeLower: false,
|
IndexWhereClause.between(
|
||||||
upper: [],
|
indexName: r'id',
|
||||||
));
|
lower: [id],
|
||||||
|
includeLower: false,
|
||||||
|
upper: [],
|
||||||
|
),
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
return query
|
return query
|
||||||
.addWhereClause(IndexWhereClause.between(
|
.addWhereClause(
|
||||||
indexName: r'id',
|
IndexWhereClause.between(
|
||||||
lower: [id],
|
indexName: r'id',
|
||||||
includeLower: false,
|
lower: [id],
|
||||||
upper: [],
|
includeLower: false,
|
||||||
))
|
upper: [],
|
||||||
.addWhereClause(IndexWhereClause.between(
|
),
|
||||||
indexName: r'id',
|
)
|
||||||
lower: [],
|
.addWhereClause(
|
||||||
upper: [id],
|
IndexWhereClause.between(
|
||||||
includeUpper: false,
|
indexName: r'id',
|
||||||
));
|
lower: [],
|
||||||
|
upper: [id],
|
||||||
|
includeUpper: false,
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause> hashEqualTo(
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause> hashEqualTo(
|
||||||
List<int> hash) {
|
List<int> hash,
|
||||||
|
) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(IndexWhereClause.equalTo(
|
return query.addWhereClause(
|
||||||
indexName: r'hash',
|
IndexWhereClause.equalTo(indexName: r'hash', value: [hash]),
|
||||||
value: [hash],
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause>
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterWhereClause>
|
||||||
hashNotEqualTo(List<int> hash) {
|
hashNotEqualTo(List<int> hash) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
if (query.whereSort == Sort.asc) {
|
if (query.whereSort == Sort.asc) {
|
||||||
return query
|
return query
|
||||||
.addWhereClause(IndexWhereClause.between(
|
.addWhereClause(
|
||||||
indexName: r'hash',
|
IndexWhereClause.between(
|
||||||
lower: [],
|
indexName: r'hash',
|
||||||
upper: [hash],
|
lower: [],
|
||||||
includeUpper: false,
|
upper: [hash],
|
||||||
))
|
includeUpper: false,
|
||||||
.addWhereClause(IndexWhereClause.between(
|
),
|
||||||
indexName: r'hash',
|
)
|
||||||
lower: [hash],
|
.addWhereClause(
|
||||||
includeLower: false,
|
IndexWhereClause.between(
|
||||||
upper: [],
|
indexName: r'hash',
|
||||||
));
|
lower: [hash],
|
||||||
|
includeLower: false,
|
||||||
|
upper: [],
|
||||||
|
),
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
return query
|
return query
|
||||||
.addWhereClause(IndexWhereClause.between(
|
.addWhereClause(
|
||||||
indexName: r'hash',
|
IndexWhereClause.between(
|
||||||
lower: [hash],
|
indexName: r'hash',
|
||||||
includeLower: false,
|
lower: [hash],
|
||||||
upper: [],
|
includeLower: false,
|
||||||
))
|
upper: [],
|
||||||
.addWhereClause(IndexWhereClause.between(
|
),
|
||||||
indexName: r'hash',
|
)
|
||||||
lower: [],
|
.addWhereClause(
|
||||||
upper: [hash],
|
IndexWhereClause.between(
|
||||||
includeUpper: false,
|
indexName: r'hash',
|
||||||
));
|
lower: [],
|
||||||
|
upper: [hash],
|
||||||
|
includeUpper: false,
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -357,134 +375,97 @@ extension IOSDeviceAssetQueryWhere
|
||||||
extension IOSDeviceAssetQueryFilter
|
extension IOSDeviceAssetQueryFilter
|
||||||
on QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QFilterCondition> {
|
on QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QFilterCondition> {
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
||||||
hashElementEqualTo(int value) {
|
hashElementEqualTo(int value) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
return query.addFilterCondition(
|
||||||
property: r'hash',
|
FilterCondition.equalTo(property: r'hash', value: value),
|
||||||
value: value,
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
||||||
hashElementGreaterThan(
|
hashElementGreaterThan(int value, {bool include = false}) {
|
||||||
int value, {
|
|
||||||
bool include = false,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.greaterThan(
|
||||||
property: r'hash',
|
include: include,
|
||||||
value: value,
|
property: r'hash',
|
||||||
));
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
||||||
hashElementLessThan(
|
hashElementLessThan(int value, {bool include = false}) {
|
||||||
int value, {
|
|
||||||
bool include = false,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.lessThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.lessThan(
|
||||||
property: r'hash',
|
include: include,
|
||||||
value: value,
|
property: r'hash',
|
||||||
));
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
||||||
hashElementBetween(
|
hashElementBetween(
|
||||||
int lower,
|
int lower,
|
||||||
int upper, {
|
int upper, {
|
||||||
bool includeLower = true,
|
bool includeLower = true,
|
||||||
bool includeUpper = true,
|
bool includeUpper = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.between(
|
return query.addFilterCondition(
|
||||||
property: r'hash',
|
FilterCondition.between(
|
||||||
lower: lower,
|
property: r'hash',
|
||||||
includeLower: includeLower,
|
lower: lower,
|
||||||
upper: upper,
|
includeLower: includeLower,
|
||||||
includeUpper: includeUpper,
|
upper: upper,
|
||||||
));
|
includeUpper: includeUpper,
|
||||||
});
|
),
|
||||||
}
|
|
||||||
|
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
|
||||||
hashLengthEqualTo(int length) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
|
||||||
return query.listLength(
|
|
||||||
r'hash',
|
|
||||||
length,
|
|
||||||
true,
|
|
||||||
length,
|
|
||||||
true,
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
||||||
hashIsEmpty() {
|
hashLengthEqualTo(int length) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.listLength(
|
return query.listLength(r'hash', length, true, length, true);
|
||||||
r'hash',
|
|
||||||
0,
|
|
||||||
true,
|
|
||||||
0,
|
|
||||||
true,
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
||||||
hashIsNotEmpty() {
|
hashIsEmpty() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.listLength(
|
return query.listLength(r'hash', 0, true, 0, true);
|
||||||
r'hash',
|
|
||||||
0,
|
|
||||||
false,
|
|
||||||
999999,
|
|
||||||
true,
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
||||||
hashLengthLessThan(
|
hashIsNotEmpty() {
|
||||||
int length, {
|
|
||||||
bool include = false,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.listLength(
|
return query.listLength(r'hash', 0, false, 999999, true);
|
||||||
r'hash',
|
|
||||||
0,
|
|
||||||
true,
|
|
||||||
length,
|
|
||||||
include,
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
||||||
hashLengthGreaterThan(
|
hashLengthLessThan(int length, {bool include = false}) {
|
||||||
int length, {
|
|
||||||
bool include = false,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.listLength(
|
return query.listLength(r'hash', 0, true, length, include);
|
||||||
r'hash',
|
|
||||||
length,
|
|
||||||
include,
|
|
||||||
999999,
|
|
||||||
true,
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
||||||
hashLengthBetween(
|
hashLengthGreaterThan(int length, {bool include = false}) {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.listLength(r'hash', length, include, 999999, true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
||||||
|
hashLengthBetween(
|
||||||
int lower,
|
int lower,
|
||||||
int upper, {
|
int upper, {
|
||||||
bool includeLower = true,
|
bool includeLower = true,
|
||||||
|
|
@ -506,43 +487,45 @@ extension IOSDeviceAssetQueryFilter
|
||||||
bool caseSensitive = true,
|
bool caseSensitive = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.equalTo(
|
||||||
value: value,
|
property: r'id',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
||||||
idGreaterThan(
|
idGreaterThan(
|
||||||
String value, {
|
String value, {
|
||||||
bool include = false,
|
bool include = false,
|
||||||
bool caseSensitive = true,
|
bool caseSensitive = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.greaterThan(
|
||||||
property: r'id',
|
include: include,
|
||||||
value: value,
|
property: r'id',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
||||||
idLessThan(
|
idLessThan(String value, {bool include = false, bool caseSensitive = true}) {
|
||||||
String value, {
|
|
||||||
bool include = false,
|
|
||||||
bool caseSensitive = true,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.lessThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.lessThan(
|
||||||
property: r'id',
|
include: include,
|
||||||
value: value,
|
property: r'id',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -554,141 +537,143 @@ extension IOSDeviceAssetQueryFilter
|
||||||
bool caseSensitive = true,
|
bool caseSensitive = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.between(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.between(
|
||||||
lower: lower,
|
property: r'id',
|
||||||
includeLower: includeLower,
|
lower: lower,
|
||||||
upper: upper,
|
includeLower: includeLower,
|
||||||
includeUpper: includeUpper,
|
upper: upper,
|
||||||
caseSensitive: caseSensitive,
|
includeUpper: includeUpper,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
||||||
idStartsWith(
|
idStartsWith(String value, {bool caseSensitive = true}) {
|
||||||
String value, {
|
|
||||||
bool caseSensitive = true,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.startsWith(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.startsWith(
|
||||||
value: value,
|
property: r'id',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
||||||
idEndsWith(
|
idEndsWith(String value, {bool caseSensitive = true}) {
|
||||||
String value, {
|
|
||||||
bool caseSensitive = true,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.endsWith(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.endsWith(
|
||||||
value: value,
|
property: r'id',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
||||||
idContains(String value, {bool caseSensitive = true}) {
|
idContains(String value, {bool caseSensitive = true}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.contains(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.contains(
|
||||||
value: value,
|
property: r'id',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> idMatches(
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition> idMatches(
|
||||||
String pattern,
|
String pattern, {
|
||||||
{bool caseSensitive = true}) {
|
bool caseSensitive = true,
|
||||||
return QueryBuilder.apply(this, (query) {
|
|
||||||
return query.addFilterCondition(FilterCondition.matches(
|
|
||||||
property: r'id',
|
|
||||||
wildcard: pattern,
|
|
||||||
caseSensitive: caseSensitive,
|
|
||||||
));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
|
||||||
idIsEmpty() {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
|
||||||
property: r'id',
|
|
||||||
value: '',
|
|
||||||
));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
|
||||||
idIsNotEmpty() {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
|
||||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
|
||||||
property: r'id',
|
|
||||||
value: '',
|
|
||||||
));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
|
||||||
isarIdEqualTo(Id value) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
|
||||||
property: r'isarId',
|
|
||||||
value: value,
|
|
||||||
));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
|
||||||
isarIdGreaterThan(
|
|
||||||
Id value, {
|
|
||||||
bool include = false,
|
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.matches(
|
||||||
property: r'isarId',
|
property: r'id',
|
||||||
value: value,
|
wildcard: pattern,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
||||||
isarIdLessThan(
|
idIsEmpty() {
|
||||||
Id value, {
|
|
||||||
bool include = false,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.lessThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.equalTo(property: r'id', value: ''),
|
||||||
property: r'isarId',
|
);
|
||||||
value: value,
|
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
||||||
isarIdBetween(
|
idIsNotEmpty() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addFilterCondition(
|
||||||
|
FilterCondition.greaterThan(property: r'id', value: ''),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
||||||
|
isarIdEqualTo(Id value) {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addFilterCondition(
|
||||||
|
FilterCondition.equalTo(property: r'isarId', value: value),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
||||||
|
isarIdGreaterThan(Id value, {bool include = false}) {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addFilterCondition(
|
||||||
|
FilterCondition.greaterThan(
|
||||||
|
include: include,
|
||||||
|
property: r'isarId',
|
||||||
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
||||||
|
isarIdLessThan(Id value, {bool include = false}) {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addFilterCondition(
|
||||||
|
FilterCondition.lessThan(
|
||||||
|
include: include,
|
||||||
|
property: r'isarId',
|
||||||
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterFilterCondition>
|
||||||
|
isarIdBetween(
|
||||||
Id lower,
|
Id lower,
|
||||||
Id upper, {
|
Id upper, {
|
||||||
bool includeLower = true,
|
bool includeLower = true,
|
||||||
bool includeUpper = true,
|
bool includeUpper = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.between(
|
return query.addFilterCondition(
|
||||||
property: r'isarId',
|
FilterCondition.between(
|
||||||
lower: lower,
|
property: r'isarId',
|
||||||
includeLower: includeLower,
|
lower: lower,
|
||||||
upper: upper,
|
includeLower: includeLower,
|
||||||
includeUpper: includeUpper,
|
upper: upper,
|
||||||
));
|
includeUpper: includeUpper,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -735,7 +720,7 @@ extension IOSDeviceAssetQuerySortThenBy
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterSortBy>
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QAfterSortBy>
|
||||||
thenByIsarIdDesc() {
|
thenByIsarIdDesc() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addSortBy(r'isarId', Sort.desc);
|
return query.addSortBy(r'isarId', Sort.desc);
|
||||||
});
|
});
|
||||||
|
|
@ -750,8 +735,9 @@ extension IOSDeviceAssetQueryWhereDistinct
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QDistinct> distinctById(
|
QueryBuilder<IOSDeviceAsset, IOSDeviceAsset, QDistinct> distinctById({
|
||||||
{bool caseSensitive = true}) {
|
bool caseSensitive = true,
|
||||||
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addDistinctBy(r'id', caseSensitive: caseSensitive);
|
return query.addDistinctBy(r'id', caseSensitive: caseSensitive);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -15,16 +15,10 @@ extension TZExtension on Asset {
|
||||||
final location = getLocation(exifInfo!.timeZone!);
|
final location = getLocation(exifInfo!.timeZone!);
|
||||||
dt = TZDateTime.from(dt, location);
|
dt = TZDateTime.from(dt, location);
|
||||||
} on LocationNotFoundException {
|
} on LocationNotFoundException {
|
||||||
RegExp re = RegExp(
|
RegExp re = RegExp(r'^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$', caseSensitive: false);
|
||||||
r'^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$',
|
|
||||||
caseSensitive: false,
|
|
||||||
);
|
|
||||||
final m = re.firstMatch(exifInfo!.timeZone!);
|
final m = re.firstMatch(exifInfo!.timeZone!);
|
||||||
if (m != null) {
|
if (m != null) {
|
||||||
final duration = Duration(
|
final duration = Duration(hours: int.parse(m.group(1) ?? '0'), minutes: int.parse(m.group(2) ?? '0'));
|
||||||
hours: int.parse(m.group(1) ?? '0'),
|
|
||||||
minutes: int.parse(m.group(2) ?? '0'),
|
|
||||||
);
|
|
||||||
dt = dt.add(duration);
|
dt = dt.add(duration);
|
||||||
return (dt, duration);
|
return (dt, duration);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,7 @@ import 'package:immich_mobile/entities/asset.entity.dart';
|
||||||
import 'package:immich_mobile/utils/hash.dart';
|
import 'package:immich_mobile/utils/hash.dart';
|
||||||
|
|
||||||
extension ListExtension<E> on List<E> {
|
extension ListExtension<E> on List<E> {
|
||||||
List<E> uniqueConsecutive({
|
List<E> uniqueConsecutive({int Function(E a, E b)? compare, void Function(E a, E b)? onDuplicate}) {
|
||||||
int Function(E a, E b)? compare,
|
|
||||||
void Function(E a, E b)? onDuplicate,
|
|
||||||
}) {
|
|
||||||
compare ??= (E a, E b) => a == b ? 0 : 1;
|
compare ??= (E a, E b) => a == b ? 0 : 1;
|
||||||
int i = 1, j = 1;
|
int i = 1, j = 1;
|
||||||
for (; i < length; i++) {
|
for (; i < length; i++) {
|
||||||
|
|
@ -45,9 +42,7 @@ extension IntListExtension on Iterable<int> {
|
||||||
|
|
||||||
extension AssetListExtension on Iterable<Asset> {
|
extension AssetListExtension on Iterable<Asset> {
|
||||||
/// Returns the assets that are already available in the Immich server
|
/// Returns the assets that are already available in the Immich server
|
||||||
Iterable<Asset> remoteOnly({
|
Iterable<Asset> remoteOnly({void Function()? errorCallback}) {
|
||||||
void Function()? errorCallback,
|
|
||||||
}) {
|
|
||||||
final bool onlyRemote = every((e) => e.isRemote);
|
final bool onlyRemote = every((e) => e.isRemote);
|
||||||
if (!onlyRemote) {
|
if (!onlyRemote) {
|
||||||
if (errorCallback != null) errorCallback();
|
if (errorCallback != null) errorCallback();
|
||||||
|
|
@ -58,10 +53,7 @@ extension AssetListExtension on Iterable<Asset> {
|
||||||
|
|
||||||
/// Returns the assets that are owned by the user passed to the [owner] param
|
/// Returns the assets that are owned by the user passed to the [owner] param
|
||||||
/// If [owner] is null, an empty list is returned
|
/// If [owner] is null, an empty list is returned
|
||||||
Iterable<Asset> ownedOnly(
|
Iterable<Asset> ownedOnly(UserDto? owner, {void Function()? errorCallback}) {
|
||||||
UserDto? owner, {
|
|
||||||
void Function()? errorCallback,
|
|
||||||
}) {
|
|
||||||
if (owner == null) return [];
|
if (owner == null) return [];
|
||||||
final isarUserId = fastHash(owner.id);
|
final isarUserId = fastHash(owner.id);
|
||||||
final bool onlyOwned = every((e) => e.ownerId == isarUserId);
|
final bool onlyOwned = every((e) => e.ownerId == isarUserId);
|
||||||
|
|
|
||||||
|
|
@ -47,11 +47,7 @@ extension DateRangeFormatting on DateTime {
|
||||||
/// - Date range of this year: "Mar 23-May 31"
|
/// - Date range of this year: "Mar 23-May 31"
|
||||||
/// - Date range of other year: "Aug 28 - Sep 30, 2023"
|
/// - Date range of other year: "Aug 28 - Sep 30, 2023"
|
||||||
/// - Date range over multiple years: "Apr 17, 2021 - Apr 9, 2022"
|
/// - Date range over multiple years: "Apr 17, 2021 - Apr 9, 2022"
|
||||||
static String formatDateRange(
|
static String formatDateRange(DateTime startDate, DateTime endDate, Locale? locale) {
|
||||||
DateTime startDate,
|
|
||||||
DateTime endDate,
|
|
||||||
Locale? locale,
|
|
||||||
) {
|
|
||||||
final now = DateTime.now();
|
final now = DateTime.now();
|
||||||
final currentYear = now.year;
|
final currentYear = now.year;
|
||||||
final localeString = locale?.toString() ?? 'en_US';
|
final localeString = locale?.toString() ?? 'en_US';
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,7 @@ extension MapMarkers on MapLibreMapController {
|
||||||
Future<void> addGeoJSONSourceForMarkers(List<MapMarker> markers) async {
|
Future<void> addGeoJSONSourceForMarkers(List<MapMarker> markers) async {
|
||||||
return addSource(
|
return addSource(
|
||||||
MapUtils.defaultSourceId,
|
MapUtils.defaultSourceId,
|
||||||
GeojsonSourceProperties(
|
GeojsonSourceProperties(data: MapUtils.generateGeoJsonForMarkers(markers.toList())),
|
||||||
data: MapUtils.generateGeoJsonForMarkers(markers.toList()),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -73,23 +71,13 @@ extension MapMarkers on MapLibreMapController {
|
||||||
try {
|
try {
|
||||||
final ByteData bytes = await rootBundle.load("assets/location-pin.png");
|
final ByteData bytes = await rootBundle.load("assets/location-pin.png");
|
||||||
await addImage("mapMarker", bytes.buffer.asUint8List());
|
await addImage("mapMarker", bytes.buffer.asUint8List());
|
||||||
return addSymbol(
|
return addSymbol(SymbolOptions(geometry: centre, iconImage: "mapMarker", iconSize: 0.15, iconAnchor: "bottom"));
|
||||||
SymbolOptions(
|
|
||||||
geometry: centre,
|
|
||||||
iconImage: "mapMarker",
|
|
||||||
iconSize: 0.15,
|
|
||||||
iconAnchor: "bottom",
|
|
||||||
),
|
|
||||||
);
|
|
||||||
} finally {
|
} finally {
|
||||||
// no-op
|
// no-op
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<LatLngBounds> getBoundsFromPoint(
|
Future<LatLngBounds> getBoundsFromPoint(Point<double> point, double distance) async {
|
||||||
Point<double> point,
|
|
||||||
double distance,
|
|
||||||
) async {
|
|
||||||
final southWestPx = Point(point.x - distance, point.y + distance);
|
final southWestPx = Point(point.x - distance, point.y + distance);
|
||||||
final northEastPx = Point(point.x + distance, point.y - distance);
|
final northEastPx = Point(point.x + distance, point.y - distance);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,11 +10,7 @@ class FastScrollPhysics extends ScrollPhysics {
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
SpringDescription get spring => const SpringDescription(
|
SpringDescription get spring => const SpringDescription(mass: 1, stiffness: 402.49984375, damping: 40);
|
||||||
mass: 1,
|
|
||||||
stiffness: 402.49984375,
|
|
||||||
damping: 40,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class FastClampingScrollPhysics extends ClampingScrollPhysics {
|
class FastClampingScrollPhysics extends ClampingScrollPhysics {
|
||||||
|
|
@ -27,12 +23,12 @@ class FastClampingScrollPhysics extends ClampingScrollPhysics {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
SpringDescription get spring => const SpringDescription(
|
SpringDescription get spring => const SpringDescription(
|
||||||
// When swiping between videos on Android, the placeholder of the first opened video
|
// When swiping between videos on Android, the placeholder of the first opened video
|
||||||
// can briefly be seen and cause a flicker effect if the video begins to initialize
|
// can briefly be seen and cause a flicker effect if the video begins to initialize
|
||||||
// before the animation finishes - probably a bug in PhotoViewGallery's animation handling
|
// before the animation finishes - probably a bug in PhotoViewGallery's animation handling
|
||||||
// Making the animation faster is not just stylistic, but also helps to avoid this flicker
|
// Making the animation faster is not just stylistic, but also helps to avoid this flicker
|
||||||
mass: 1,
|
mass: 1,
|
||||||
stiffness: 1601.2499609375,
|
stiffness: 1601.2499609375,
|
||||||
damping: 80,
|
damping: 80,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,6 @@
|
||||||
extension StringExtension on String {
|
extension StringExtension on String {
|
||||||
String capitalize() {
|
String capitalize() {
|
||||||
return split(" ")
|
return split(" ").map((str) => str.isEmpty ? str : str[0].toUpperCase() + str.substring(1)).join(" ");
|
||||||
.map(
|
|
||||||
(str) => str.isEmpty ? str : str[0].toUpperCase() + str.substring(1),
|
|
||||||
)
|
|
||||||
.join(" ");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,16 +7,10 @@ extension ImmichColorSchemeExtensions on ColorScheme {
|
||||||
|
|
||||||
extension ColorExtensions on Color {
|
extension ColorExtensions on Color {
|
||||||
Color lighten({double amount = 0.1}) {
|
Color lighten({double amount = 0.1}) {
|
||||||
return Color.alphaBlend(
|
return Color.alphaBlend(Colors.white.withValues(alpha: amount), this);
|
||||||
Colors.white.withValues(alpha: amount),
|
|
||||||
this,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Color darken({double amount = 0.1}) {
|
Color darken({double amount = 0.1}) {
|
||||||
return Color.alphaBlend(
|
return Color.alphaBlend(Colors.black.withValues(alpha: amount), this);
|
||||||
Colors.black.withValues(alpha: amount),
|
|
||||||
this,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,11 +29,7 @@ extension TextTranslateExtension on Text {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String _translateHelper(
|
String _translateHelper(BuildContext? context, String key, [Map<String, Object>? args]) {
|
||||||
BuildContext? context,
|
|
||||||
String key, [
|
|
||||||
Map<String, Object>? args,
|
|
||||||
]) {
|
|
||||||
if (key.isEmpty) {
|
if (key.isEmpty) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -16,21 +16,10 @@ class DeviceAssetEntity {
|
||||||
final List<byte> hash;
|
final List<byte> hash;
|
||||||
final DateTime modifiedTime;
|
final DateTime modifiedTime;
|
||||||
|
|
||||||
const DeviceAssetEntity({
|
const DeviceAssetEntity({required this.assetId, required this.hash, required this.modifiedTime});
|
||||||
required this.assetId,
|
|
||||||
required this.hash,
|
|
||||||
required this.modifiedTime,
|
|
||||||
});
|
|
||||||
|
|
||||||
DeviceAsset toModel() => DeviceAsset(
|
DeviceAsset toModel() => DeviceAsset(assetId: assetId, hash: Uint8List.fromList(hash), modifiedTime: modifiedTime);
|
||||||
assetId: assetId,
|
|
||||||
hash: Uint8List.fromList(hash),
|
|
||||||
modifiedTime: modifiedTime,
|
|
||||||
);
|
|
||||||
|
|
||||||
static DeviceAssetEntity fromDto(DeviceAsset dto) => DeviceAssetEntity(
|
static DeviceAssetEntity fromDto(DeviceAsset dto) =>
|
||||||
assetId: dto.assetId,
|
DeviceAssetEntity(assetId: dto.assetId, hash: dto.hash, modifiedTime: dto.modifiedTime);
|
||||||
hash: dto.hash,
|
|
||||||
modifiedTime: dto.modifiedTime,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,22 +17,15 @@ const DeviceAssetEntitySchema = CollectionSchema(
|
||||||
name: r'DeviceAssetEntity',
|
name: r'DeviceAssetEntity',
|
||||||
id: 6967030785073446271,
|
id: 6967030785073446271,
|
||||||
properties: {
|
properties: {
|
||||||
r'assetId': PropertySchema(
|
r'assetId': PropertySchema(id: 0, name: r'assetId', type: IsarType.string),
|
||||||
id: 0,
|
r'hash': PropertySchema(id: 1, name: r'hash', type: IsarType.byteList),
|
||||||
name: r'assetId',
|
|
||||||
type: IsarType.string,
|
|
||||||
),
|
|
||||||
r'hash': PropertySchema(
|
|
||||||
id: 1,
|
|
||||||
name: r'hash',
|
|
||||||
type: IsarType.byteList,
|
|
||||||
),
|
|
||||||
r'modifiedTime': PropertySchema(
|
r'modifiedTime': PropertySchema(
|
||||||
id: 2,
|
id: 2,
|
||||||
name: r'modifiedTime',
|
name: r'modifiedTime',
|
||||||
type: IsarType.dateTime,
|
type: IsarType.dateTime,
|
||||||
)
|
),
|
||||||
},
|
},
|
||||||
|
|
||||||
estimateSize: _deviceAssetEntityEstimateSize,
|
estimateSize: _deviceAssetEntityEstimateSize,
|
||||||
serialize: _deviceAssetEntitySerialize,
|
serialize: _deviceAssetEntitySerialize,
|
||||||
deserialize: _deviceAssetEntityDeserialize,
|
deserialize: _deviceAssetEntityDeserialize,
|
||||||
|
|
@ -49,7 +42,7 @@ const DeviceAssetEntitySchema = CollectionSchema(
|
||||||
name: r'assetId',
|
name: r'assetId',
|
||||||
type: IndexType.hash,
|
type: IndexType.hash,
|
||||||
caseSensitive: true,
|
caseSensitive: true,
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
r'hash': IndexSchema(
|
r'hash': IndexSchema(
|
||||||
|
|
@ -62,12 +55,13 @@ const DeviceAssetEntitySchema = CollectionSchema(
|
||||||
name: r'hash',
|
name: r'hash',
|
||||||
type: IndexType.hash,
|
type: IndexType.hash,
|
||||||
caseSensitive: false,
|
caseSensitive: false,
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
)
|
),
|
||||||
},
|
},
|
||||||
links: {},
|
links: {},
|
||||||
embeddedSchemas: {},
|
embeddedSchemas: {},
|
||||||
|
|
||||||
getId: _deviceAssetEntityGetId,
|
getId: _deviceAssetEntityGetId,
|
||||||
getLinks: _deviceAssetEntityGetLinks,
|
getLinks: _deviceAssetEntityGetLinks,
|
||||||
attach: _deviceAssetEntityAttach,
|
attach: _deviceAssetEntityAttach,
|
||||||
|
|
@ -133,12 +127,16 @@ Id _deviceAssetEntityGetId(DeviceAssetEntity object) {
|
||||||
}
|
}
|
||||||
|
|
||||||
List<IsarLinkBase<dynamic>> _deviceAssetEntityGetLinks(
|
List<IsarLinkBase<dynamic>> _deviceAssetEntityGetLinks(
|
||||||
DeviceAssetEntity object) {
|
DeviceAssetEntity object,
|
||||||
|
) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
void _deviceAssetEntityAttach(
|
void _deviceAssetEntityAttach(
|
||||||
IsarCollection<dynamic> col, Id id, DeviceAssetEntity object) {}
|
IsarCollection<dynamic> col,
|
||||||
|
Id id,
|
||||||
|
DeviceAssetEntity object,
|
||||||
|
) {}
|
||||||
|
|
||||||
extension DeviceAssetEntityByIndex on IsarCollection<DeviceAssetEntity> {
|
extension DeviceAssetEntityByIndex on IsarCollection<DeviceAssetEntity> {
|
||||||
Future<DeviceAssetEntity?> getByAssetId(String assetId) {
|
Future<DeviceAssetEntity?> getByAssetId(String assetId) {
|
||||||
|
|
@ -189,8 +187,10 @@ extension DeviceAssetEntityByIndex on IsarCollection<DeviceAssetEntity> {
|
||||||
return putAllByIndex(r'assetId', objects);
|
return putAllByIndex(r'assetId', objects);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Id> putAllByAssetIdSync(List<DeviceAssetEntity> objects,
|
List<Id> putAllByAssetIdSync(
|
||||||
{bool saveLinks = true}) {
|
List<DeviceAssetEntity> objects, {
|
||||||
|
bool saveLinks = true,
|
||||||
|
}) {
|
||||||
return putAllByIndexSync(r'assetId', objects, saveLinks: saveLinks);
|
return putAllByIndexSync(r'assetId', objects, saveLinks: saveLinks);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -207,17 +207,14 @@ extension DeviceAssetEntityQueryWhereSort
|
||||||
extension DeviceAssetEntityQueryWhere
|
extension DeviceAssetEntityQueryWhere
|
||||||
on QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QWhereClause> {
|
on QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QWhereClause> {
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterWhereClause>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterWhereClause>
|
||||||
idEqualTo(Id id) {
|
idEqualTo(Id id) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(IdWhereClause.between(
|
return query.addWhereClause(IdWhereClause.between(lower: id, upper: id));
|
||||||
lower: id,
|
|
||||||
upper: id,
|
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterWhereClause>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterWhereClause>
|
||||||
idNotEqualTo(Id id) {
|
idNotEqualTo(Id id) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
if (query.whereSort == Sort.asc) {
|
if (query.whereSort == Sort.asc) {
|
||||||
return query
|
return query
|
||||||
|
|
@ -240,7 +237,7 @@ extension DeviceAssetEntityQueryWhere
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterWhereClause>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterWhereClause>
|
||||||
idGreaterThan(Id id, {bool include = false}) {
|
idGreaterThan(Id id, {bool include = false}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(
|
return query.addWhereClause(
|
||||||
IdWhereClause.greaterThan(lower: id, includeLower: include),
|
IdWhereClause.greaterThan(lower: id, includeLower: include),
|
||||||
|
|
@ -249,7 +246,7 @@ extension DeviceAssetEntityQueryWhere
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterWhereClause>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterWhereClause>
|
||||||
idLessThan(Id id, {bool include = false}) {
|
idLessThan(Id id, {bool include = false}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(
|
return query.addWhereClause(
|
||||||
IdWhereClause.lessThan(upper: id, includeUpper: include),
|
IdWhereClause.lessThan(upper: id, includeUpper: include),
|
||||||
|
|
@ -258,108 +255,124 @@ extension DeviceAssetEntityQueryWhere
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterWhereClause>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterWhereClause>
|
||||||
idBetween(
|
idBetween(
|
||||||
Id lowerId,
|
Id lowerId,
|
||||||
Id upperId, {
|
Id upperId, {
|
||||||
bool includeLower = true,
|
bool includeLower = true,
|
||||||
bool includeUpper = true,
|
bool includeUpper = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(IdWhereClause.between(
|
return query.addWhereClause(
|
||||||
lower: lowerId,
|
IdWhereClause.between(
|
||||||
includeLower: includeLower,
|
lower: lowerId,
|
||||||
upper: upperId,
|
includeLower: includeLower,
|
||||||
includeUpper: includeUpper,
|
upper: upperId,
|
||||||
));
|
includeUpper: includeUpper,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterWhereClause>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterWhereClause>
|
||||||
assetIdEqualTo(String assetId) {
|
assetIdEqualTo(String assetId) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(IndexWhereClause.equalTo(
|
return query.addWhereClause(
|
||||||
indexName: r'assetId',
|
IndexWhereClause.equalTo(indexName: r'assetId', value: [assetId]),
|
||||||
value: [assetId],
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterWhereClause>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterWhereClause>
|
||||||
assetIdNotEqualTo(String assetId) {
|
assetIdNotEqualTo(String assetId) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
if (query.whereSort == Sort.asc) {
|
if (query.whereSort == Sort.asc) {
|
||||||
return query
|
return query
|
||||||
.addWhereClause(IndexWhereClause.between(
|
.addWhereClause(
|
||||||
indexName: r'assetId',
|
IndexWhereClause.between(
|
||||||
lower: [],
|
indexName: r'assetId',
|
||||||
upper: [assetId],
|
lower: [],
|
||||||
includeUpper: false,
|
upper: [assetId],
|
||||||
))
|
includeUpper: false,
|
||||||
.addWhereClause(IndexWhereClause.between(
|
),
|
||||||
indexName: r'assetId',
|
)
|
||||||
lower: [assetId],
|
.addWhereClause(
|
||||||
includeLower: false,
|
IndexWhereClause.between(
|
||||||
upper: [],
|
indexName: r'assetId',
|
||||||
));
|
lower: [assetId],
|
||||||
|
includeLower: false,
|
||||||
|
upper: [],
|
||||||
|
),
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
return query
|
return query
|
||||||
.addWhereClause(IndexWhereClause.between(
|
.addWhereClause(
|
||||||
indexName: r'assetId',
|
IndexWhereClause.between(
|
||||||
lower: [assetId],
|
indexName: r'assetId',
|
||||||
includeLower: false,
|
lower: [assetId],
|
||||||
upper: [],
|
includeLower: false,
|
||||||
))
|
upper: [],
|
||||||
.addWhereClause(IndexWhereClause.between(
|
),
|
||||||
indexName: r'assetId',
|
)
|
||||||
lower: [],
|
.addWhereClause(
|
||||||
upper: [assetId],
|
IndexWhereClause.between(
|
||||||
includeUpper: false,
|
indexName: r'assetId',
|
||||||
));
|
lower: [],
|
||||||
|
upper: [assetId],
|
||||||
|
includeUpper: false,
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterWhereClause>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterWhereClause>
|
||||||
hashEqualTo(List<int> hash) {
|
hashEqualTo(List<int> hash) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(IndexWhereClause.equalTo(
|
return query.addWhereClause(
|
||||||
indexName: r'hash',
|
IndexWhereClause.equalTo(indexName: r'hash', value: [hash]),
|
||||||
value: [hash],
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterWhereClause>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterWhereClause>
|
||||||
hashNotEqualTo(List<int> hash) {
|
hashNotEqualTo(List<int> hash) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
if (query.whereSort == Sort.asc) {
|
if (query.whereSort == Sort.asc) {
|
||||||
return query
|
return query
|
||||||
.addWhereClause(IndexWhereClause.between(
|
.addWhereClause(
|
||||||
indexName: r'hash',
|
IndexWhereClause.between(
|
||||||
lower: [],
|
indexName: r'hash',
|
||||||
upper: [hash],
|
lower: [],
|
||||||
includeUpper: false,
|
upper: [hash],
|
||||||
))
|
includeUpper: false,
|
||||||
.addWhereClause(IndexWhereClause.between(
|
),
|
||||||
indexName: r'hash',
|
)
|
||||||
lower: [hash],
|
.addWhereClause(
|
||||||
includeLower: false,
|
IndexWhereClause.between(
|
||||||
upper: [],
|
indexName: r'hash',
|
||||||
));
|
lower: [hash],
|
||||||
|
includeLower: false,
|
||||||
|
upper: [],
|
||||||
|
),
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
return query
|
return query
|
||||||
.addWhereClause(IndexWhereClause.between(
|
.addWhereClause(
|
||||||
indexName: r'hash',
|
IndexWhereClause.between(
|
||||||
lower: [hash],
|
indexName: r'hash',
|
||||||
includeLower: false,
|
lower: [hash],
|
||||||
upper: [],
|
includeLower: false,
|
||||||
))
|
upper: [],
|
||||||
.addWhereClause(IndexWhereClause.between(
|
),
|
||||||
indexName: r'hash',
|
)
|
||||||
lower: [],
|
.addWhereClause(
|
||||||
upper: [hash],
|
IndexWhereClause.between(
|
||||||
includeUpper: false,
|
indexName: r'hash',
|
||||||
));
|
lower: [],
|
||||||
|
upper: [hash],
|
||||||
|
includeUpper: false,
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -368,53 +381,56 @@ extension DeviceAssetEntityQueryWhere
|
||||||
extension DeviceAssetEntityQueryFilter
|
extension DeviceAssetEntityQueryFilter
|
||||||
on QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QFilterCondition> {
|
on QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QFilterCondition> {
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
||||||
assetIdEqualTo(
|
assetIdEqualTo(String value, {bool caseSensitive = true}) {
|
||||||
String value, {
|
|
||||||
bool caseSensitive = true,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
return query.addFilterCondition(
|
||||||
property: r'assetId',
|
FilterCondition.equalTo(
|
||||||
value: value,
|
property: r'assetId',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
||||||
assetIdGreaterThan(
|
assetIdGreaterThan(
|
||||||
String value, {
|
String value, {
|
||||||
bool include = false,
|
bool include = false,
|
||||||
bool caseSensitive = true,
|
bool caseSensitive = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.greaterThan(
|
||||||
property: r'assetId',
|
include: include,
|
||||||
value: value,
|
property: r'assetId',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
||||||
assetIdLessThan(
|
assetIdLessThan(
|
||||||
String value, {
|
String value, {
|
||||||
bool include = false,
|
bool include = false,
|
||||||
bool caseSensitive = true,
|
bool caseSensitive = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.lessThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.lessThan(
|
||||||
property: r'assetId',
|
include: include,
|
||||||
value: value,
|
property: r'assetId',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
||||||
assetIdBetween(
|
assetIdBetween(
|
||||||
String lower,
|
String lower,
|
||||||
String upper, {
|
String upper, {
|
||||||
bool includeLower = true,
|
bool includeLower = true,
|
||||||
|
|
@ -422,216 +438,181 @@ extension DeviceAssetEntityQueryFilter
|
||||||
bool caseSensitive = true,
|
bool caseSensitive = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.between(
|
return query.addFilterCondition(
|
||||||
property: r'assetId',
|
FilterCondition.between(
|
||||||
lower: lower,
|
property: r'assetId',
|
||||||
includeLower: includeLower,
|
lower: lower,
|
||||||
upper: upper,
|
includeLower: includeLower,
|
||||||
includeUpper: includeUpper,
|
upper: upper,
|
||||||
caseSensitive: caseSensitive,
|
includeUpper: includeUpper,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
||||||
assetIdStartsWith(
|
assetIdStartsWith(String value, {bool caseSensitive = true}) {
|
||||||
String value, {
|
|
||||||
bool caseSensitive = true,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.startsWith(
|
return query.addFilterCondition(
|
||||||
property: r'assetId',
|
FilterCondition.startsWith(
|
||||||
value: value,
|
property: r'assetId',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
||||||
assetIdEndsWith(
|
assetIdEndsWith(String value, {bool caseSensitive = true}) {
|
||||||
String value, {
|
|
||||||
bool caseSensitive = true,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.endsWith(
|
return query.addFilterCondition(
|
||||||
property: r'assetId',
|
FilterCondition.endsWith(
|
||||||
value: value,
|
property: r'assetId',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
||||||
assetIdContains(String value, {bool caseSensitive = true}) {
|
assetIdContains(String value, {bool caseSensitive = true}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.contains(
|
return query.addFilterCondition(
|
||||||
property: r'assetId',
|
FilterCondition.contains(
|
||||||
value: value,
|
property: r'assetId',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
||||||
assetIdMatches(String pattern, {bool caseSensitive = true}) {
|
assetIdMatches(String pattern, {bool caseSensitive = true}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.matches(
|
return query.addFilterCondition(
|
||||||
property: r'assetId',
|
FilterCondition.matches(
|
||||||
wildcard: pattern,
|
property: r'assetId',
|
||||||
caseSensitive: caseSensitive,
|
wildcard: pattern,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
||||||
assetIdIsEmpty() {
|
assetIdIsEmpty() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
return query.addFilterCondition(
|
||||||
property: r'assetId',
|
FilterCondition.equalTo(property: r'assetId', value: ''),
|
||||||
value: '',
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
||||||
assetIdIsNotEmpty() {
|
assetIdIsNotEmpty() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
return query.addFilterCondition(
|
||||||
property: r'assetId',
|
FilterCondition.greaterThan(property: r'assetId', value: ''),
|
||||||
value: '',
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
||||||
hashElementEqualTo(int value) {
|
hashElementEqualTo(int value) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
return query.addFilterCondition(
|
||||||
property: r'hash',
|
FilterCondition.equalTo(property: r'hash', value: value),
|
||||||
value: value,
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
||||||
hashElementGreaterThan(
|
hashElementGreaterThan(int value, {bool include = false}) {
|
||||||
int value, {
|
|
||||||
bool include = false,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.greaterThan(
|
||||||
property: r'hash',
|
include: include,
|
||||||
value: value,
|
property: r'hash',
|
||||||
));
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
||||||
hashElementLessThan(
|
hashElementLessThan(int value, {bool include = false}) {
|
||||||
int value, {
|
|
||||||
bool include = false,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.lessThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.lessThan(
|
||||||
property: r'hash',
|
include: include,
|
||||||
value: value,
|
property: r'hash',
|
||||||
));
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
||||||
hashElementBetween(
|
hashElementBetween(
|
||||||
int lower,
|
int lower,
|
||||||
int upper, {
|
int upper, {
|
||||||
bool includeLower = true,
|
bool includeLower = true,
|
||||||
bool includeUpper = true,
|
bool includeUpper = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.between(
|
return query.addFilterCondition(
|
||||||
property: r'hash',
|
FilterCondition.between(
|
||||||
lower: lower,
|
property: r'hash',
|
||||||
includeLower: includeLower,
|
lower: lower,
|
||||||
upper: upper,
|
includeLower: includeLower,
|
||||||
includeUpper: includeUpper,
|
upper: upper,
|
||||||
));
|
includeUpper: includeUpper,
|
||||||
});
|
),
|
||||||
}
|
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
|
||||||
hashLengthEqualTo(int length) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
|
||||||
return query.listLength(
|
|
||||||
r'hash',
|
|
||||||
length,
|
|
||||||
true,
|
|
||||||
length,
|
|
||||||
true,
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
||||||
hashIsEmpty() {
|
hashLengthEqualTo(int length) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.listLength(
|
return query.listLength(r'hash', length, true, length, true);
|
||||||
r'hash',
|
|
||||||
0,
|
|
||||||
true,
|
|
||||||
0,
|
|
||||||
true,
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
||||||
hashIsNotEmpty() {
|
hashIsEmpty() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.listLength(
|
return query.listLength(r'hash', 0, true, 0, true);
|
||||||
r'hash',
|
|
||||||
0,
|
|
||||||
false,
|
|
||||||
999999,
|
|
||||||
true,
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
||||||
hashLengthLessThan(
|
hashIsNotEmpty() {
|
||||||
int length, {
|
|
||||||
bool include = false,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.listLength(
|
return query.listLength(r'hash', 0, false, 999999, true);
|
||||||
r'hash',
|
|
||||||
0,
|
|
||||||
true,
|
|
||||||
length,
|
|
||||||
include,
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
||||||
hashLengthGreaterThan(
|
hashLengthLessThan(int length, {bool include = false}) {
|
||||||
int length, {
|
|
||||||
bool include = false,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.listLength(
|
return query.listLength(r'hash', 0, true, length, include);
|
||||||
r'hash',
|
|
||||||
length,
|
|
||||||
include,
|
|
||||||
999999,
|
|
||||||
true,
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
||||||
hashLengthBetween(
|
hashLengthGreaterThan(int length, {bool include = false}) {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.listLength(r'hash', length, include, 999999, true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
||||||
|
hashLengthBetween(
|
||||||
int lower,
|
int lower,
|
||||||
int upper, {
|
int upper, {
|
||||||
bool includeLower = true,
|
bool includeLower = true,
|
||||||
|
|
@ -649,114 +630,112 @@ extension DeviceAssetEntityQueryFilter
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
||||||
idEqualTo(Id value) {
|
idEqualTo(Id value) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.equalTo(property: r'id', value: value),
|
||||||
value: value,
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
||||||
idGreaterThan(
|
idGreaterThan(Id value, {bool include = false}) {
|
||||||
Id value, {
|
|
||||||
bool include = false,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.greaterThan(
|
||||||
property: r'id',
|
include: include,
|
||||||
value: value,
|
property: r'id',
|
||||||
));
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
||||||
idLessThan(
|
idLessThan(Id value, {bool include = false}) {
|
||||||
Id value, {
|
|
||||||
bool include = false,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.lessThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.lessThan(
|
||||||
property: r'id',
|
include: include,
|
||||||
value: value,
|
property: r'id',
|
||||||
));
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
||||||
idBetween(
|
idBetween(
|
||||||
Id lower,
|
Id lower,
|
||||||
Id upper, {
|
Id upper, {
|
||||||
bool includeLower = true,
|
bool includeLower = true,
|
||||||
bool includeUpper = true,
|
bool includeUpper = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.between(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.between(
|
||||||
lower: lower,
|
property: r'id',
|
||||||
includeLower: includeLower,
|
lower: lower,
|
||||||
upper: upper,
|
includeLower: includeLower,
|
||||||
includeUpper: includeUpper,
|
upper: upper,
|
||||||
));
|
includeUpper: includeUpper,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
||||||
modifiedTimeEqualTo(DateTime value) {
|
modifiedTimeEqualTo(DateTime value) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
return query.addFilterCondition(
|
||||||
property: r'modifiedTime',
|
FilterCondition.equalTo(property: r'modifiedTime', value: value),
|
||||||
value: value,
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
||||||
modifiedTimeGreaterThan(
|
modifiedTimeGreaterThan(DateTime value, {bool include = false}) {
|
||||||
DateTime value, {
|
|
||||||
bool include = false,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.greaterThan(
|
||||||
property: r'modifiedTime',
|
include: include,
|
||||||
value: value,
|
property: r'modifiedTime',
|
||||||
));
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
||||||
modifiedTimeLessThan(
|
modifiedTimeLessThan(DateTime value, {bool include = false}) {
|
||||||
DateTime value, {
|
|
||||||
bool include = false,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.lessThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.lessThan(
|
||||||
property: r'modifiedTime',
|
include: include,
|
||||||
value: value,
|
property: r'modifiedTime',
|
||||||
));
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterFilterCondition>
|
||||||
modifiedTimeBetween(
|
modifiedTimeBetween(
|
||||||
DateTime lower,
|
DateTime lower,
|
||||||
DateTime upper, {
|
DateTime upper, {
|
||||||
bool includeLower = true,
|
bool includeLower = true,
|
||||||
bool includeUpper = true,
|
bool includeUpper = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.between(
|
return query.addFilterCondition(
|
||||||
property: r'modifiedTime',
|
FilterCondition.between(
|
||||||
lower: lower,
|
property: r'modifiedTime',
|
||||||
includeLower: includeLower,
|
lower: lower,
|
||||||
upper: upper,
|
includeLower: includeLower,
|
||||||
includeUpper: includeUpper,
|
upper: upper,
|
||||||
));
|
includeUpper: includeUpper,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -770,28 +749,28 @@ extension DeviceAssetEntityQueryLinks
|
||||||
extension DeviceAssetEntityQuerySortBy
|
extension DeviceAssetEntityQuerySortBy
|
||||||
on QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QSortBy> {
|
on QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QSortBy> {
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy>
|
||||||
sortByAssetId() {
|
sortByAssetId() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addSortBy(r'assetId', Sort.asc);
|
return query.addSortBy(r'assetId', Sort.asc);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy>
|
||||||
sortByAssetIdDesc() {
|
sortByAssetIdDesc() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addSortBy(r'assetId', Sort.desc);
|
return query.addSortBy(r'assetId', Sort.desc);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy>
|
||||||
sortByModifiedTime() {
|
sortByModifiedTime() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addSortBy(r'modifiedTime', Sort.asc);
|
return query.addSortBy(r'modifiedTime', Sort.asc);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy>
|
||||||
sortByModifiedTimeDesc() {
|
sortByModifiedTimeDesc() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addSortBy(r'modifiedTime', Sort.desc);
|
return query.addSortBy(r'modifiedTime', Sort.desc);
|
||||||
});
|
});
|
||||||
|
|
@ -801,14 +780,14 @@ extension DeviceAssetEntityQuerySortBy
|
||||||
extension DeviceAssetEntityQuerySortThenBy
|
extension DeviceAssetEntityQuerySortThenBy
|
||||||
on QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QSortThenBy> {
|
on QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QSortThenBy> {
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy>
|
||||||
thenByAssetId() {
|
thenByAssetId() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addSortBy(r'assetId', Sort.asc);
|
return query.addSortBy(r'assetId', Sort.asc);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy>
|
||||||
thenByAssetIdDesc() {
|
thenByAssetIdDesc() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addSortBy(r'assetId', Sort.desc);
|
return query.addSortBy(r'assetId', Sort.desc);
|
||||||
});
|
});
|
||||||
|
|
@ -821,21 +800,21 @@ extension DeviceAssetEntityQuerySortThenBy
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy>
|
||||||
thenByIdDesc() {
|
thenByIdDesc() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addSortBy(r'id', Sort.desc);
|
return query.addSortBy(r'id', Sort.desc);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy>
|
||||||
thenByModifiedTime() {
|
thenByModifiedTime() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addSortBy(r'modifiedTime', Sort.asc);
|
return query.addSortBy(r'modifiedTime', Sort.asc);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QAfterSortBy>
|
||||||
thenByModifiedTimeDesc() {
|
thenByModifiedTimeDesc() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addSortBy(r'modifiedTime', Sort.desc);
|
return query.addSortBy(r'modifiedTime', Sort.desc);
|
||||||
});
|
});
|
||||||
|
|
@ -845,21 +824,21 @@ extension DeviceAssetEntityQuerySortThenBy
|
||||||
extension DeviceAssetEntityQueryWhereDistinct
|
extension DeviceAssetEntityQueryWhereDistinct
|
||||||
on QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QDistinct> {
|
on QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QDistinct> {
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QDistinct>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QDistinct>
|
||||||
distinctByAssetId({bool caseSensitive = true}) {
|
distinctByAssetId({bool caseSensitive = true}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addDistinctBy(r'assetId', caseSensitive: caseSensitive);
|
return query.addDistinctBy(r'assetId', caseSensitive: caseSensitive);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QDistinct>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QDistinct>
|
||||||
distinctByHash() {
|
distinctByHash() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addDistinctBy(r'hash');
|
return query.addDistinctBy(r'hash');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QDistinct>
|
QueryBuilder<DeviceAssetEntity, DeviceAssetEntity, QDistinct>
|
||||||
distinctByModifiedTime() {
|
distinctByModifiedTime() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addDistinctBy(r'modifiedTime');
|
return query.addDistinctBy(r'modifiedTime');
|
||||||
});
|
});
|
||||||
|
|
@ -887,7 +866,7 @@ extension DeviceAssetEntityQueryProperty
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<DeviceAssetEntity, DateTime, QQueryOperations>
|
QueryBuilder<DeviceAssetEntity, DateTime, QQueryOperations>
|
||||||
modifiedTimeProperty() {
|
modifiedTimeProperty() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addPropertyName(r'modifiedTime');
|
return query.addPropertyName(r'modifiedTime');
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -52,47 +52,47 @@ class ExifInfo {
|
||||||
});
|
});
|
||||||
|
|
||||||
static ExifInfo fromDto(domain.ExifInfo dto) => ExifInfo(
|
static ExifInfo fromDto(domain.ExifInfo dto) => ExifInfo(
|
||||||
id: dto.assetId,
|
id: dto.assetId,
|
||||||
fileSize: dto.fileSize,
|
fileSize: dto.fileSize,
|
||||||
dateTimeOriginal: dto.dateTimeOriginal,
|
dateTimeOriginal: dto.dateTimeOriginal,
|
||||||
timeZone: dto.timeZone,
|
timeZone: dto.timeZone,
|
||||||
make: dto.make,
|
make: dto.make,
|
||||||
model: dto.model,
|
model: dto.model,
|
||||||
lens: dto.lens,
|
lens: dto.lens,
|
||||||
f: dto.f,
|
f: dto.f,
|
||||||
mm: dto.mm,
|
mm: dto.mm,
|
||||||
iso: dto.iso?.toInt(),
|
iso: dto.iso?.toInt(),
|
||||||
exposureSeconds: dto.exposureSeconds,
|
exposureSeconds: dto.exposureSeconds,
|
||||||
lat: dto.latitude,
|
lat: dto.latitude,
|
||||||
long: dto.longitude,
|
long: dto.longitude,
|
||||||
city: dto.city,
|
city: dto.city,
|
||||||
state: dto.state,
|
state: dto.state,
|
||||||
country: dto.country,
|
country: dto.country,
|
||||||
description: dto.description,
|
description: dto.description,
|
||||||
orientation: dto.orientation,
|
orientation: dto.orientation,
|
||||||
);
|
);
|
||||||
|
|
||||||
domain.ExifInfo toDto() => domain.ExifInfo(
|
domain.ExifInfo toDto() => domain.ExifInfo(
|
||||||
assetId: id,
|
assetId: id,
|
||||||
fileSize: fileSize,
|
fileSize: fileSize,
|
||||||
description: description,
|
description: description,
|
||||||
orientation: orientation,
|
orientation: orientation,
|
||||||
timeZone: timeZone,
|
timeZone: timeZone,
|
||||||
dateTimeOriginal: dateTimeOriginal,
|
dateTimeOriginal: dateTimeOriginal,
|
||||||
isFlipped: ExifDtoConverter.isOrientationFlipped(orientation),
|
isFlipped: ExifDtoConverter.isOrientationFlipped(orientation),
|
||||||
latitude: lat,
|
latitude: lat,
|
||||||
longitude: long,
|
longitude: long,
|
||||||
city: city,
|
city: city,
|
||||||
state: state,
|
state: state,
|
||||||
country: country,
|
country: country,
|
||||||
make: make,
|
make: make,
|
||||||
model: model,
|
model: model,
|
||||||
lens: lens,
|
lens: lens,
|
||||||
f: f,
|
f: f,
|
||||||
mm: mm,
|
mm: mm,
|
||||||
iso: iso?.toInt(),
|
iso: iso?.toInt(),
|
||||||
exposureSeconds: exposureSeconds,
|
exposureSeconds: exposureSeconds,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
class RemoteExifEntity extends Table with DriftDefaultsMixin {
|
class RemoteExifEntity extends Table with DriftDefaultsMixin {
|
||||||
|
|
@ -148,24 +148,24 @@ class RemoteExifEntity extends Table with DriftDefaultsMixin {
|
||||||
|
|
||||||
extension RemoteExifEntityDataDomainEx on RemoteExifEntityData {
|
extension RemoteExifEntityDataDomainEx on RemoteExifEntityData {
|
||||||
domain.ExifInfo toDto() => domain.ExifInfo(
|
domain.ExifInfo toDto() => domain.ExifInfo(
|
||||||
fileSize: fileSize,
|
fileSize: fileSize,
|
||||||
dateTimeOriginal: dateTimeOriginal,
|
dateTimeOriginal: dateTimeOriginal,
|
||||||
timeZone: timeZone,
|
timeZone: timeZone,
|
||||||
make: make,
|
make: make,
|
||||||
model: model,
|
model: model,
|
||||||
iso: iso,
|
iso: iso,
|
||||||
city: city,
|
city: city,
|
||||||
state: state,
|
state: state,
|
||||||
country: country,
|
country: country,
|
||||||
description: description,
|
description: description,
|
||||||
orientation: orientation,
|
orientation: orientation,
|
||||||
latitude: latitude,
|
latitude: latitude,
|
||||||
longitude: longitude,
|
longitude: longitude,
|
||||||
f: fNumber?.toDouble(),
|
f: fNumber?.toDouble(),
|
||||||
mm: focalLength?.toDouble(),
|
mm: focalLength?.toDouble(),
|
||||||
lens: lens,
|
lens: lens,
|
||||||
width: width?.toDouble(),
|
width: width?.toDouble(),
|
||||||
height: height?.toDouble(),
|
height: height?.toDouble(),
|
||||||
isFlipped: ExifDtoConverter.isOrientationFlipped(orientation),
|
isFlipped: ExifDtoConverter.isOrientationFlipped(orientation),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
1619
mobile/lib/infrastructure/entities/exif.entity.drift.dart
generated
1619
mobile/lib/infrastructure/entities/exif.entity.drift.dart
generated
File diff suppressed because it is too large
Load diff
2084
mobile/lib/infrastructure/entities/exif.entity.g.dart
generated
2084
mobile/lib/infrastructure/entities/exif.entity.g.dart
generated
File diff suppressed because it is too large
Load diff
|
|
@ -8,24 +8,24 @@ import 'package:immich_mobile/infrastructure/entities/local_album.entity.dart'
|
||||||
as i3;
|
as i3;
|
||||||
import 'package:drift/src/runtime/query_builder/query_builder.dart' as i4;
|
import 'package:drift/src/runtime/query_builder/query_builder.dart' as i4;
|
||||||
|
|
||||||
typedef $$LocalAlbumEntityTableCreateCompanionBuilder
|
typedef $$LocalAlbumEntityTableCreateCompanionBuilder =
|
||||||
= i1.LocalAlbumEntityCompanion Function({
|
i1.LocalAlbumEntityCompanion Function({
|
||||||
required String id,
|
required String id,
|
||||||
required String name,
|
required String name,
|
||||||
i0.Value<DateTime> updatedAt,
|
i0.Value<DateTime> updatedAt,
|
||||||
required i2.BackupSelection backupSelection,
|
required i2.BackupSelection backupSelection,
|
||||||
i0.Value<bool> isIosSharedAlbum,
|
i0.Value<bool> isIosSharedAlbum,
|
||||||
i0.Value<bool?> marker_,
|
i0.Value<bool?> marker_,
|
||||||
});
|
});
|
||||||
typedef $$LocalAlbumEntityTableUpdateCompanionBuilder
|
typedef $$LocalAlbumEntityTableUpdateCompanionBuilder =
|
||||||
= i1.LocalAlbumEntityCompanion Function({
|
i1.LocalAlbumEntityCompanion Function({
|
||||||
i0.Value<String> id,
|
i0.Value<String> id,
|
||||||
i0.Value<String> name,
|
i0.Value<String> name,
|
||||||
i0.Value<DateTime> updatedAt,
|
i0.Value<DateTime> updatedAt,
|
||||||
i0.Value<i2.BackupSelection> backupSelection,
|
i0.Value<i2.BackupSelection> backupSelection,
|
||||||
i0.Value<bool> isIosSharedAlbum,
|
i0.Value<bool> isIosSharedAlbum,
|
||||||
i0.Value<bool?> marker_,
|
i0.Value<bool?> marker_,
|
||||||
});
|
});
|
||||||
|
|
||||||
class $$LocalAlbumEntityTableFilterComposer
|
class $$LocalAlbumEntityTableFilterComposer
|
||||||
extends i0.Composer<i0.GeneratedDatabase, i1.$LocalAlbumEntityTable> {
|
extends i0.Composer<i0.GeneratedDatabase, i1.$LocalAlbumEntityTable> {
|
||||||
|
|
@ -37,25 +37,35 @@ class $$LocalAlbumEntityTableFilterComposer
|
||||||
super.$removeJoinBuilderFromRootComposer,
|
super.$removeJoinBuilderFromRootComposer,
|
||||||
});
|
});
|
||||||
i0.ColumnFilters<String> get id => $composableBuilder(
|
i0.ColumnFilters<String> get id => $composableBuilder(
|
||||||
column: $table.id, builder: (column) => i0.ColumnFilters(column));
|
column: $table.id,
|
||||||
|
builder: (column) => i0.ColumnFilters(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnFilters<String> get name => $composableBuilder(
|
i0.ColumnFilters<String> get name => $composableBuilder(
|
||||||
column: $table.name, builder: (column) => i0.ColumnFilters(column));
|
column: $table.name,
|
||||||
|
builder: (column) => i0.ColumnFilters(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnFilters<DateTime> get updatedAt => $composableBuilder(
|
i0.ColumnFilters<DateTime> get updatedAt => $composableBuilder(
|
||||||
column: $table.updatedAt, builder: (column) => i0.ColumnFilters(column));
|
column: $table.updatedAt,
|
||||||
|
builder: (column) => i0.ColumnFilters(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnWithTypeConverterFilters<i2.BackupSelection, i2.BackupSelection, int>
|
i0.ColumnWithTypeConverterFilters<i2.BackupSelection, i2.BackupSelection, int>
|
||||||
get backupSelection => $composableBuilder(
|
get backupSelection => $composableBuilder(
|
||||||
column: $table.backupSelection,
|
column: $table.backupSelection,
|
||||||
builder: (column) => i0.ColumnWithTypeConverterFilters(column));
|
builder: (column) => i0.ColumnWithTypeConverterFilters(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnFilters<bool> get isIosSharedAlbum => $composableBuilder(
|
i0.ColumnFilters<bool> get isIosSharedAlbum => $composableBuilder(
|
||||||
column: $table.isIosSharedAlbum,
|
column: $table.isIosSharedAlbum,
|
||||||
builder: (column) => i0.ColumnFilters(column));
|
builder: (column) => i0.ColumnFilters(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnFilters<bool> get marker_ => $composableBuilder(
|
i0.ColumnFilters<bool> get marker_ => $composableBuilder(
|
||||||
column: $table.marker_, builder: (column) => i0.ColumnFilters(column));
|
column: $table.marker_,
|
||||||
|
builder: (column) => i0.ColumnFilters(column),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
class $$LocalAlbumEntityTableOrderingComposer
|
class $$LocalAlbumEntityTableOrderingComposer
|
||||||
|
|
@ -68,25 +78,34 @@ class $$LocalAlbumEntityTableOrderingComposer
|
||||||
super.$removeJoinBuilderFromRootComposer,
|
super.$removeJoinBuilderFromRootComposer,
|
||||||
});
|
});
|
||||||
i0.ColumnOrderings<String> get id => $composableBuilder(
|
i0.ColumnOrderings<String> get id => $composableBuilder(
|
||||||
column: $table.id, builder: (column) => i0.ColumnOrderings(column));
|
column: $table.id,
|
||||||
|
builder: (column) => i0.ColumnOrderings(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnOrderings<String> get name => $composableBuilder(
|
i0.ColumnOrderings<String> get name => $composableBuilder(
|
||||||
column: $table.name, builder: (column) => i0.ColumnOrderings(column));
|
column: $table.name,
|
||||||
|
builder: (column) => i0.ColumnOrderings(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnOrderings<DateTime> get updatedAt => $composableBuilder(
|
i0.ColumnOrderings<DateTime> get updatedAt => $composableBuilder(
|
||||||
column: $table.updatedAt,
|
column: $table.updatedAt,
|
||||||
builder: (column) => i0.ColumnOrderings(column));
|
builder: (column) => i0.ColumnOrderings(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnOrderings<int> get backupSelection => $composableBuilder(
|
i0.ColumnOrderings<int> get backupSelection => $composableBuilder(
|
||||||
column: $table.backupSelection,
|
column: $table.backupSelection,
|
||||||
builder: (column) => i0.ColumnOrderings(column));
|
builder: (column) => i0.ColumnOrderings(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnOrderings<bool> get isIosSharedAlbum => $composableBuilder(
|
i0.ColumnOrderings<bool> get isIosSharedAlbum => $composableBuilder(
|
||||||
column: $table.isIosSharedAlbum,
|
column: $table.isIosSharedAlbum,
|
||||||
builder: (column) => i0.ColumnOrderings(column));
|
builder: (column) => i0.ColumnOrderings(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnOrderings<bool> get marker_ => $composableBuilder(
|
i0.ColumnOrderings<bool> get marker_ => $composableBuilder(
|
||||||
column: $table.marker_, builder: (column) => i0.ColumnOrderings(column));
|
column: $table.marker_,
|
||||||
|
builder: (column) => i0.ColumnOrderings(column),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
class $$LocalAlbumEntityTableAnnotationComposer
|
class $$LocalAlbumEntityTableAnnotationComposer
|
||||||
|
|
@ -108,35 +127,47 @@ class $$LocalAlbumEntityTableAnnotationComposer
|
||||||
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
||||||
|
|
||||||
i0.GeneratedColumnWithTypeConverter<i2.BackupSelection, int>
|
i0.GeneratedColumnWithTypeConverter<i2.BackupSelection, int>
|
||||||
get backupSelection => $composableBuilder(
|
get backupSelection => $composableBuilder(
|
||||||
column: $table.backupSelection, builder: (column) => column);
|
column: $table.backupSelection,
|
||||||
|
builder: (column) => column,
|
||||||
|
);
|
||||||
|
|
||||||
i0.GeneratedColumn<bool> get isIosSharedAlbum => $composableBuilder(
|
i0.GeneratedColumn<bool> get isIosSharedAlbum => $composableBuilder(
|
||||||
column: $table.isIosSharedAlbum, builder: (column) => column);
|
column: $table.isIosSharedAlbum,
|
||||||
|
builder: (column) => column,
|
||||||
|
);
|
||||||
|
|
||||||
i0.GeneratedColumn<bool> get marker_ =>
|
i0.GeneratedColumn<bool> get marker_ =>
|
||||||
$composableBuilder(column: $table.marker_, builder: (column) => column);
|
$composableBuilder(column: $table.marker_, builder: (column) => column);
|
||||||
}
|
}
|
||||||
|
|
||||||
class $$LocalAlbumEntityTableTableManager extends i0.RootTableManager<
|
class $$LocalAlbumEntityTableTableManager
|
||||||
i0.GeneratedDatabase,
|
extends
|
||||||
i1.$LocalAlbumEntityTable,
|
i0.RootTableManager<
|
||||||
i1.LocalAlbumEntityData,
|
i0.GeneratedDatabase,
|
||||||
i1.$$LocalAlbumEntityTableFilterComposer,
|
i1.$LocalAlbumEntityTable,
|
||||||
i1.$$LocalAlbumEntityTableOrderingComposer,
|
i1.LocalAlbumEntityData,
|
||||||
i1.$$LocalAlbumEntityTableAnnotationComposer,
|
i1.$$LocalAlbumEntityTableFilterComposer,
|
||||||
$$LocalAlbumEntityTableCreateCompanionBuilder,
|
i1.$$LocalAlbumEntityTableOrderingComposer,
|
||||||
$$LocalAlbumEntityTableUpdateCompanionBuilder,
|
i1.$$LocalAlbumEntityTableAnnotationComposer,
|
||||||
(
|
$$LocalAlbumEntityTableCreateCompanionBuilder,
|
||||||
i1.LocalAlbumEntityData,
|
$$LocalAlbumEntityTableUpdateCompanionBuilder,
|
||||||
i0.BaseReferences<i0.GeneratedDatabase, i1.$LocalAlbumEntityTable,
|
(
|
||||||
i1.LocalAlbumEntityData>
|
i1.LocalAlbumEntityData,
|
||||||
),
|
i0.BaseReferences<
|
||||||
i1.LocalAlbumEntityData,
|
i0.GeneratedDatabase,
|
||||||
i0.PrefetchHooks Function()> {
|
i1.$LocalAlbumEntityTable,
|
||||||
|
i1.LocalAlbumEntityData
|
||||||
|
>,
|
||||||
|
),
|
||||||
|
i1.LocalAlbumEntityData,
|
||||||
|
i0.PrefetchHooks Function()
|
||||||
|
> {
|
||||||
$$LocalAlbumEntityTableTableManager(
|
$$LocalAlbumEntityTableTableManager(
|
||||||
i0.GeneratedDatabase db, i1.$LocalAlbumEntityTable table)
|
i0.GeneratedDatabase db,
|
||||||
: super(i0.TableManagerState(
|
i1.$LocalAlbumEntityTable table,
|
||||||
|
) : super(
|
||||||
|
i0.TableManagerState(
|
||||||
db: db,
|
db: db,
|
||||||
table: table,
|
table: table,
|
||||||
createFilteringComposer: () =>
|
createFilteringComposer: () =>
|
||||||
|
|
@ -145,63 +176,71 @@ class $$LocalAlbumEntityTableTableManager extends i0.RootTableManager<
|
||||||
.$$LocalAlbumEntityTableOrderingComposer($db: db, $table: table),
|
.$$LocalAlbumEntityTableOrderingComposer($db: db, $table: table),
|
||||||
createComputedFieldComposer: () =>
|
createComputedFieldComposer: () =>
|
||||||
i1.$$LocalAlbumEntityTableAnnotationComposer(
|
i1.$$LocalAlbumEntityTableAnnotationComposer(
|
||||||
$db: db, $table: table),
|
$db: db,
|
||||||
updateCompanionCallback: ({
|
$table: table,
|
||||||
i0.Value<String> id = const i0.Value.absent(),
|
),
|
||||||
i0.Value<String> name = const i0.Value.absent(),
|
updateCompanionCallback:
|
||||||
i0.Value<DateTime> updatedAt = const i0.Value.absent(),
|
({
|
||||||
i0.Value<i2.BackupSelection> backupSelection =
|
i0.Value<String> id = const i0.Value.absent(),
|
||||||
const i0.Value.absent(),
|
i0.Value<String> name = const i0.Value.absent(),
|
||||||
i0.Value<bool> isIosSharedAlbum = const i0.Value.absent(),
|
i0.Value<DateTime> updatedAt = const i0.Value.absent(),
|
||||||
i0.Value<bool?> marker_ = const i0.Value.absent(),
|
i0.Value<i2.BackupSelection> backupSelection =
|
||||||
}) =>
|
const i0.Value.absent(),
|
||||||
i1.LocalAlbumEntityCompanion(
|
i0.Value<bool> isIosSharedAlbum = const i0.Value.absent(),
|
||||||
id: id,
|
i0.Value<bool?> marker_ = const i0.Value.absent(),
|
||||||
name: name,
|
}) => i1.LocalAlbumEntityCompanion(
|
||||||
updatedAt: updatedAt,
|
id: id,
|
||||||
backupSelection: backupSelection,
|
name: name,
|
||||||
isIosSharedAlbum: isIosSharedAlbum,
|
updatedAt: updatedAt,
|
||||||
marker_: marker_,
|
backupSelection: backupSelection,
|
||||||
),
|
isIosSharedAlbum: isIosSharedAlbum,
|
||||||
createCompanionCallback: ({
|
marker_: marker_,
|
||||||
required String id,
|
),
|
||||||
required String name,
|
createCompanionCallback:
|
||||||
i0.Value<DateTime> updatedAt = const i0.Value.absent(),
|
({
|
||||||
required i2.BackupSelection backupSelection,
|
required String id,
|
||||||
i0.Value<bool> isIosSharedAlbum = const i0.Value.absent(),
|
required String name,
|
||||||
i0.Value<bool?> marker_ = const i0.Value.absent(),
|
i0.Value<DateTime> updatedAt = const i0.Value.absent(),
|
||||||
}) =>
|
required i2.BackupSelection backupSelection,
|
||||||
i1.LocalAlbumEntityCompanion.insert(
|
i0.Value<bool> isIosSharedAlbum = const i0.Value.absent(),
|
||||||
id: id,
|
i0.Value<bool?> marker_ = const i0.Value.absent(),
|
||||||
name: name,
|
}) => i1.LocalAlbumEntityCompanion.insert(
|
||||||
updatedAt: updatedAt,
|
id: id,
|
||||||
backupSelection: backupSelection,
|
name: name,
|
||||||
isIosSharedAlbum: isIosSharedAlbum,
|
updatedAt: updatedAt,
|
||||||
marker_: marker_,
|
backupSelection: backupSelection,
|
||||||
),
|
isIosSharedAlbum: isIosSharedAlbum,
|
||||||
|
marker_: marker_,
|
||||||
|
),
|
||||||
withReferenceMapper: (p0) => p0
|
withReferenceMapper: (p0) => p0
|
||||||
.map((e) => (e.readTable(table), i0.BaseReferences(db, table, e)))
|
.map((e) => (e.readTable(table), i0.BaseReferences(db, table, e)))
|
||||||
.toList(),
|
.toList(),
|
||||||
prefetchHooksCallback: null,
|
prefetchHooksCallback: null,
|
||||||
));
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef $$LocalAlbumEntityTableProcessedTableManager = i0.ProcessedTableManager<
|
typedef $$LocalAlbumEntityTableProcessedTableManager =
|
||||||
i0.GeneratedDatabase,
|
i0.ProcessedTableManager<
|
||||||
i1.$LocalAlbumEntityTable,
|
i0.GeneratedDatabase,
|
||||||
i1.LocalAlbumEntityData,
|
i1.$LocalAlbumEntityTable,
|
||||||
i1.$$LocalAlbumEntityTableFilterComposer,
|
|
||||||
i1.$$LocalAlbumEntityTableOrderingComposer,
|
|
||||||
i1.$$LocalAlbumEntityTableAnnotationComposer,
|
|
||||||
$$LocalAlbumEntityTableCreateCompanionBuilder,
|
|
||||||
$$LocalAlbumEntityTableUpdateCompanionBuilder,
|
|
||||||
(
|
|
||||||
i1.LocalAlbumEntityData,
|
i1.LocalAlbumEntityData,
|
||||||
i0.BaseReferences<i0.GeneratedDatabase, i1.$LocalAlbumEntityTable,
|
i1.$$LocalAlbumEntityTableFilterComposer,
|
||||||
i1.LocalAlbumEntityData>
|
i1.$$LocalAlbumEntityTableOrderingComposer,
|
||||||
),
|
i1.$$LocalAlbumEntityTableAnnotationComposer,
|
||||||
i1.LocalAlbumEntityData,
|
$$LocalAlbumEntityTableCreateCompanionBuilder,
|
||||||
i0.PrefetchHooks Function()>;
|
$$LocalAlbumEntityTableUpdateCompanionBuilder,
|
||||||
|
(
|
||||||
|
i1.LocalAlbumEntityData,
|
||||||
|
i0.BaseReferences<
|
||||||
|
i0.GeneratedDatabase,
|
||||||
|
i1.$LocalAlbumEntityTable,
|
||||||
|
i1.LocalAlbumEntityData
|
||||||
|
>,
|
||||||
|
),
|
||||||
|
i1.LocalAlbumEntityData,
|
||||||
|
i0.PrefetchHooks Function()
|
||||||
|
>;
|
||||||
|
|
||||||
class $LocalAlbumEntityTable extends i3.LocalAlbumEntity
|
class $LocalAlbumEntityTable extends i3.LocalAlbumEntity
|
||||||
with i0.TableInfo<$LocalAlbumEntityTable, i1.LocalAlbumEntityData> {
|
with i0.TableInfo<$LocalAlbumEntityTable, i1.LocalAlbumEntityData> {
|
||||||
|
|
@ -212,51 +251,86 @@ class $LocalAlbumEntityTable extends i3.LocalAlbumEntity
|
||||||
static const i0.VerificationMeta _idMeta = const i0.VerificationMeta('id');
|
static const i0.VerificationMeta _idMeta = const i0.VerificationMeta('id');
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumn<String> id = i0.GeneratedColumn<String>(
|
late final i0.GeneratedColumn<String> id = i0.GeneratedColumn<String>(
|
||||||
'id', aliasedName, false,
|
'id',
|
||||||
type: i0.DriftSqlType.string, requiredDuringInsert: true);
|
aliasedName,
|
||||||
static const i0.VerificationMeta _nameMeta =
|
false,
|
||||||
const i0.VerificationMeta('name');
|
type: i0.DriftSqlType.string,
|
||||||
|
requiredDuringInsert: true,
|
||||||
|
);
|
||||||
|
static const i0.VerificationMeta _nameMeta = const i0.VerificationMeta(
|
||||||
|
'name',
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumn<String> name = i0.GeneratedColumn<String>(
|
late final i0.GeneratedColumn<String> name = i0.GeneratedColumn<String>(
|
||||||
'name', aliasedName, false,
|
'name',
|
||||||
type: i0.DriftSqlType.string, requiredDuringInsert: true);
|
aliasedName,
|
||||||
static const i0.VerificationMeta _updatedAtMeta =
|
false,
|
||||||
const i0.VerificationMeta('updatedAt');
|
type: i0.DriftSqlType.string,
|
||||||
|
requiredDuringInsert: true,
|
||||||
|
);
|
||||||
|
static const i0.VerificationMeta _updatedAtMeta = const i0.VerificationMeta(
|
||||||
|
'updatedAt',
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumn<DateTime> updatedAt =
|
late final i0.GeneratedColumn<DateTime> updatedAt =
|
||||||
i0.GeneratedColumn<DateTime>('updated_at', aliasedName, false,
|
i0.GeneratedColumn<DateTime>(
|
||||||
type: i0.DriftSqlType.dateTime,
|
'updated_at',
|
||||||
requiredDuringInsert: false,
|
aliasedName,
|
||||||
defaultValue: i4.currentDateAndTime);
|
false,
|
||||||
|
type: i0.DriftSqlType.dateTime,
|
||||||
|
requiredDuringInsert: false,
|
||||||
|
defaultValue: i4.currentDateAndTime,
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumnWithTypeConverter<i2.BackupSelection, int>
|
late final i0.GeneratedColumnWithTypeConverter<i2.BackupSelection, int>
|
||||||
backupSelection = i0.GeneratedColumn<int>(
|
backupSelection =
|
||||||
'backup_selection', aliasedName, false,
|
i0.GeneratedColumn<int>(
|
||||||
type: i0.DriftSqlType.int, requiredDuringInsert: true)
|
'backup_selection',
|
||||||
.withConverter<i2.BackupSelection>(
|
aliasedName,
|
||||||
i1.$LocalAlbumEntityTable.$converterbackupSelection);
|
false,
|
||||||
|
type: i0.DriftSqlType.int,
|
||||||
|
requiredDuringInsert: true,
|
||||||
|
).withConverter<i2.BackupSelection>(
|
||||||
|
i1.$LocalAlbumEntityTable.$converterbackupSelection,
|
||||||
|
);
|
||||||
static const i0.VerificationMeta _isIosSharedAlbumMeta =
|
static const i0.VerificationMeta _isIosSharedAlbumMeta =
|
||||||
const i0.VerificationMeta('isIosSharedAlbum');
|
const i0.VerificationMeta('isIosSharedAlbum');
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumn<bool> isIosSharedAlbum =
|
late final i0.GeneratedColumn<bool> isIosSharedAlbum =
|
||||||
i0.GeneratedColumn<bool>('is_ios_shared_album', aliasedName, false,
|
i0.GeneratedColumn<bool>(
|
||||||
type: i0.DriftSqlType.bool,
|
'is_ios_shared_album',
|
||||||
requiredDuringInsert: false,
|
aliasedName,
|
||||||
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
|
false,
|
||||||
'CHECK ("is_ios_shared_album" IN (0, 1))'),
|
type: i0.DriftSqlType.bool,
|
||||||
defaultValue: const i4.Constant(false));
|
requiredDuringInsert: false,
|
||||||
static const i0.VerificationMeta _marker_Meta =
|
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
|
||||||
const i0.VerificationMeta('marker_');
|
'CHECK ("is_ios_shared_album" IN (0, 1))',
|
||||||
|
),
|
||||||
|
defaultValue: const i4.Constant(false),
|
||||||
|
);
|
||||||
|
static const i0.VerificationMeta _marker_Meta = const i0.VerificationMeta(
|
||||||
|
'marker_',
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumn<bool> marker_ = i0.GeneratedColumn<bool>(
|
late final i0.GeneratedColumn<bool> marker_ = i0.GeneratedColumn<bool>(
|
||||||
'marker', aliasedName, true,
|
'marker',
|
||||||
type: i0.DriftSqlType.bool,
|
aliasedName,
|
||||||
requiredDuringInsert: false,
|
true,
|
||||||
defaultConstraints:
|
type: i0.DriftSqlType.bool,
|
||||||
i0.GeneratedColumn.constraintIsAlways('CHECK ("marker" IN (0, 1))'));
|
requiredDuringInsert: false,
|
||||||
|
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
|
||||||
|
'CHECK ("marker" IN (0, 1))',
|
||||||
|
),
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
List<i0.GeneratedColumn> get $columns =>
|
List<i0.GeneratedColumn> get $columns => [
|
||||||
[id, name, updatedAt, backupSelection, isIosSharedAlbum, marker_];
|
id,
|
||||||
|
name,
|
||||||
|
updatedAt,
|
||||||
|
backupSelection,
|
||||||
|
isIosSharedAlbum,
|
||||||
|
marker_,
|
||||||
|
];
|
||||||
@override
|
@override
|
||||||
String get aliasedName => _alias ?? actualTableName;
|
String get aliasedName => _alias ?? actualTableName;
|
||||||
@override
|
@override
|
||||||
|
|
@ -264,8 +338,9 @@ class $LocalAlbumEntityTable extends i3.LocalAlbumEntity
|
||||||
static const String $name = 'local_album_entity';
|
static const String $name = 'local_album_entity';
|
||||||
@override
|
@override
|
||||||
i0.VerificationContext validateIntegrity(
|
i0.VerificationContext validateIntegrity(
|
||||||
i0.Insertable<i1.LocalAlbumEntityData> instance,
|
i0.Insertable<i1.LocalAlbumEntityData> instance, {
|
||||||
{bool isInserting = false}) {
|
bool isInserting = false,
|
||||||
|
}) {
|
||||||
final context = i0.VerificationContext();
|
final context = i0.VerificationContext();
|
||||||
final data = instance.toColumns(true);
|
final data = instance.toColumns(true);
|
||||||
if (data.containsKey('id')) {
|
if (data.containsKey('id')) {
|
||||||
|
|
@ -275,23 +350,32 @@ class $LocalAlbumEntityTable extends i3.LocalAlbumEntity
|
||||||
}
|
}
|
||||||
if (data.containsKey('name')) {
|
if (data.containsKey('name')) {
|
||||||
context.handle(
|
context.handle(
|
||||||
_nameMeta, name.isAcceptableOrUnknown(data['name']!, _nameMeta));
|
_nameMeta,
|
||||||
|
name.isAcceptableOrUnknown(data['name']!, _nameMeta),
|
||||||
|
);
|
||||||
} else if (isInserting) {
|
} else if (isInserting) {
|
||||||
context.missing(_nameMeta);
|
context.missing(_nameMeta);
|
||||||
}
|
}
|
||||||
if (data.containsKey('updated_at')) {
|
if (data.containsKey('updated_at')) {
|
||||||
context.handle(_updatedAtMeta,
|
context.handle(
|
||||||
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta));
|
_updatedAtMeta,
|
||||||
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (data.containsKey('is_ios_shared_album')) {
|
if (data.containsKey('is_ios_shared_album')) {
|
||||||
context.handle(
|
context.handle(
|
||||||
|
_isIosSharedAlbumMeta,
|
||||||
|
isIosSharedAlbum.isAcceptableOrUnknown(
|
||||||
|
data['is_ios_shared_album']!,
|
||||||
_isIosSharedAlbumMeta,
|
_isIosSharedAlbumMeta,
|
||||||
isIosSharedAlbum.isAcceptableOrUnknown(
|
),
|
||||||
data['is_ios_shared_album']!, _isIosSharedAlbumMeta));
|
);
|
||||||
}
|
}
|
||||||
if (data.containsKey('marker')) {
|
if (data.containsKey('marker')) {
|
||||||
context.handle(_marker_Meta,
|
context.handle(
|
||||||
marker_.isAcceptableOrUnknown(data['marker']!, _marker_Meta));
|
_marker_Meta,
|
||||||
|
marker_.isAcceptableOrUnknown(data['marker']!, _marker_Meta),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
@ -299,23 +383,39 @@ class $LocalAlbumEntityTable extends i3.LocalAlbumEntity
|
||||||
@override
|
@override
|
||||||
Set<i0.GeneratedColumn> get $primaryKey => {id};
|
Set<i0.GeneratedColumn> get $primaryKey => {id};
|
||||||
@override
|
@override
|
||||||
i1.LocalAlbumEntityData map(Map<String, dynamic> data,
|
i1.LocalAlbumEntityData map(
|
||||||
{String? tablePrefix}) {
|
Map<String, dynamic> data, {
|
||||||
|
String? tablePrefix,
|
||||||
|
}) {
|
||||||
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
||||||
return i1.LocalAlbumEntityData(
|
return i1.LocalAlbumEntityData(
|
||||||
id: attachedDatabase.typeMapping
|
id: attachedDatabase.typeMapping.read(
|
||||||
.read(i0.DriftSqlType.string, data['${effectivePrefix}id'])!,
|
i0.DriftSqlType.string,
|
||||||
name: attachedDatabase.typeMapping
|
data['${effectivePrefix}id'],
|
||||||
.read(i0.DriftSqlType.string, data['${effectivePrefix}name'])!,
|
)!,
|
||||||
|
name: attachedDatabase.typeMapping.read(
|
||||||
|
i0.DriftSqlType.string,
|
||||||
|
data['${effectivePrefix}name'],
|
||||||
|
)!,
|
||||||
updatedAt: attachedDatabase.typeMapping.read(
|
updatedAt: attachedDatabase.typeMapping.read(
|
||||||
i0.DriftSqlType.dateTime, data['${effectivePrefix}updated_at'])!,
|
i0.DriftSqlType.dateTime,
|
||||||
|
data['${effectivePrefix}updated_at'],
|
||||||
|
)!,
|
||||||
backupSelection: i1.$LocalAlbumEntityTable.$converterbackupSelection
|
backupSelection: i1.$LocalAlbumEntityTable.$converterbackupSelection
|
||||||
.fromSql(attachedDatabase.typeMapping.read(i0.DriftSqlType.int,
|
.fromSql(
|
||||||
data['${effectivePrefix}backup_selection'])!),
|
attachedDatabase.typeMapping.read(
|
||||||
|
i0.DriftSqlType.int,
|
||||||
|
data['${effectivePrefix}backup_selection'],
|
||||||
|
)!,
|
||||||
|
),
|
||||||
isIosSharedAlbum: attachedDatabase.typeMapping.read(
|
isIosSharedAlbum: attachedDatabase.typeMapping.read(
|
||||||
i0.DriftSqlType.bool, data['${effectivePrefix}is_ios_shared_album'])!,
|
i0.DriftSqlType.bool,
|
||||||
marker_: attachedDatabase.typeMapping
|
data['${effectivePrefix}is_ios_shared_album'],
|
||||||
.read(i0.DriftSqlType.bool, data['${effectivePrefix}marker']),
|
)!,
|
||||||
|
marker_: attachedDatabase.typeMapping.read(
|
||||||
|
i0.DriftSqlType.bool,
|
||||||
|
data['${effectivePrefix}marker'],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -325,9 +425,9 @@ class $LocalAlbumEntityTable extends i3.LocalAlbumEntity
|
||||||
}
|
}
|
||||||
|
|
||||||
static i0.JsonTypeConverter2<i2.BackupSelection, int, int>
|
static i0.JsonTypeConverter2<i2.BackupSelection, int, int>
|
||||||
$converterbackupSelection =
|
$converterbackupSelection = const i0.EnumIndexConverter<i2.BackupSelection>(
|
||||||
const i0.EnumIndexConverter<i2.BackupSelection>(
|
i2.BackupSelection.values,
|
||||||
i2.BackupSelection.values);
|
);
|
||||||
@override
|
@override
|
||||||
bool get withoutRowId => true;
|
bool get withoutRowId => true;
|
||||||
@override
|
@override
|
||||||
|
|
@ -342,13 +442,14 @@ class LocalAlbumEntityData extends i0.DataClass
|
||||||
final i2.BackupSelection backupSelection;
|
final i2.BackupSelection backupSelection;
|
||||||
final bool isIosSharedAlbum;
|
final bool isIosSharedAlbum;
|
||||||
final bool? marker_;
|
final bool? marker_;
|
||||||
const LocalAlbumEntityData(
|
const LocalAlbumEntityData({
|
||||||
{required this.id,
|
required this.id,
|
||||||
required this.name,
|
required this.name,
|
||||||
required this.updatedAt,
|
required this.updatedAt,
|
||||||
required this.backupSelection,
|
required this.backupSelection,
|
||||||
required this.isIosSharedAlbum,
|
required this.isIosSharedAlbum,
|
||||||
this.marker_});
|
this.marker_,
|
||||||
|
});
|
||||||
@override
|
@override
|
||||||
Map<String, i0.Expression> toColumns(bool nullToAbsent) {
|
Map<String, i0.Expression> toColumns(bool nullToAbsent) {
|
||||||
final map = <String, i0.Expression>{};
|
final map = <String, i0.Expression>{};
|
||||||
|
|
@ -356,9 +457,11 @@ class LocalAlbumEntityData extends i0.DataClass
|
||||||
map['name'] = i0.Variable<String>(name);
|
map['name'] = i0.Variable<String>(name);
|
||||||
map['updated_at'] = i0.Variable<DateTime>(updatedAt);
|
map['updated_at'] = i0.Variable<DateTime>(updatedAt);
|
||||||
{
|
{
|
||||||
map['backup_selection'] = i0.Variable<int>(i1
|
map['backup_selection'] = i0.Variable<int>(
|
||||||
.$LocalAlbumEntityTable.$converterbackupSelection
|
i1.$LocalAlbumEntityTable.$converterbackupSelection.toSql(
|
||||||
.toSql(backupSelection));
|
backupSelection,
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
map['is_ios_shared_album'] = i0.Variable<bool>(isIosSharedAlbum);
|
map['is_ios_shared_album'] = i0.Variable<bool>(isIosSharedAlbum);
|
||||||
if (!nullToAbsent || marker_ != null) {
|
if (!nullToAbsent || marker_ != null) {
|
||||||
|
|
@ -367,8 +470,10 @@ class LocalAlbumEntityData extends i0.DataClass
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
factory LocalAlbumEntityData.fromJson(Map<String, dynamic> json,
|
factory LocalAlbumEntityData.fromJson(
|
||||||
{i0.ValueSerializer? serializer}) {
|
Map<String, dynamic> json, {
|
||||||
|
i0.ValueSerializer? serializer,
|
||||||
|
}) {
|
||||||
serializer ??= i0.driftRuntimeOptions.defaultSerializer;
|
serializer ??= i0.driftRuntimeOptions.defaultSerializer;
|
||||||
return LocalAlbumEntityData(
|
return LocalAlbumEntityData(
|
||||||
id: serializer.fromJson<String>(json['id']),
|
id: serializer.fromJson<String>(json['id']),
|
||||||
|
|
@ -387,29 +492,31 @@ class LocalAlbumEntityData extends i0.DataClass
|
||||||
'id': serializer.toJson<String>(id),
|
'id': serializer.toJson<String>(id),
|
||||||
'name': serializer.toJson<String>(name),
|
'name': serializer.toJson<String>(name),
|
||||||
'updatedAt': serializer.toJson<DateTime>(updatedAt),
|
'updatedAt': serializer.toJson<DateTime>(updatedAt),
|
||||||
'backupSelection': serializer.toJson<int>(i1
|
'backupSelection': serializer.toJson<int>(
|
||||||
.$LocalAlbumEntityTable.$converterbackupSelection
|
i1.$LocalAlbumEntityTable.$converterbackupSelection.toJson(
|
||||||
.toJson(backupSelection)),
|
backupSelection,
|
||||||
|
),
|
||||||
|
),
|
||||||
'isIosSharedAlbum': serializer.toJson<bool>(isIosSharedAlbum),
|
'isIosSharedAlbum': serializer.toJson<bool>(isIosSharedAlbum),
|
||||||
'marker_': serializer.toJson<bool?>(marker_),
|
'marker_': serializer.toJson<bool?>(marker_),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
i1.LocalAlbumEntityData copyWith(
|
i1.LocalAlbumEntityData copyWith({
|
||||||
{String? id,
|
String? id,
|
||||||
String? name,
|
String? name,
|
||||||
DateTime? updatedAt,
|
DateTime? updatedAt,
|
||||||
i2.BackupSelection? backupSelection,
|
i2.BackupSelection? backupSelection,
|
||||||
bool? isIosSharedAlbum,
|
bool? isIosSharedAlbum,
|
||||||
i0.Value<bool?> marker_ = const i0.Value.absent()}) =>
|
i0.Value<bool?> marker_ = const i0.Value.absent(),
|
||||||
i1.LocalAlbumEntityData(
|
}) => i1.LocalAlbumEntityData(
|
||||||
id: id ?? this.id,
|
id: id ?? this.id,
|
||||||
name: name ?? this.name,
|
name: name ?? this.name,
|
||||||
updatedAt: updatedAt ?? this.updatedAt,
|
updatedAt: updatedAt ?? this.updatedAt,
|
||||||
backupSelection: backupSelection ?? this.backupSelection,
|
backupSelection: backupSelection ?? this.backupSelection,
|
||||||
isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum,
|
isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum,
|
||||||
marker_: marker_.present ? marker_.value : this.marker_,
|
marker_: marker_.present ? marker_.value : this.marker_,
|
||||||
);
|
);
|
||||||
LocalAlbumEntityData copyWithCompanion(i1.LocalAlbumEntityCompanion data) {
|
LocalAlbumEntityData copyWithCompanion(i1.LocalAlbumEntityCompanion data) {
|
||||||
return LocalAlbumEntityData(
|
return LocalAlbumEntityData(
|
||||||
id: data.id.present ? data.id.value : this.id,
|
id: data.id.present ? data.id.value : this.id,
|
||||||
|
|
@ -440,7 +547,13 @@ class LocalAlbumEntityData extends i0.DataClass
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode => Object.hash(
|
int get hashCode => Object.hash(
|
||||||
id, name, updatedAt, backupSelection, isIosSharedAlbum, marker_);
|
id,
|
||||||
|
name,
|
||||||
|
updatedAt,
|
||||||
|
backupSelection,
|
||||||
|
isIosSharedAlbum,
|
||||||
|
marker_,
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) =>
|
bool operator ==(Object other) =>
|
||||||
identical(this, other) ||
|
identical(this, other) ||
|
||||||
|
|
@ -476,9 +589,9 @@ class LocalAlbumEntityCompanion
|
||||||
required i2.BackupSelection backupSelection,
|
required i2.BackupSelection backupSelection,
|
||||||
this.isIosSharedAlbum = const i0.Value.absent(),
|
this.isIosSharedAlbum = const i0.Value.absent(),
|
||||||
this.marker_ = const i0.Value.absent(),
|
this.marker_ = const i0.Value.absent(),
|
||||||
}) : id = i0.Value(id),
|
}) : id = i0.Value(id),
|
||||||
name = i0.Value(name),
|
name = i0.Value(name),
|
||||||
backupSelection = i0.Value(backupSelection);
|
backupSelection = i0.Value(backupSelection);
|
||||||
static i0.Insertable<i1.LocalAlbumEntityData> custom({
|
static i0.Insertable<i1.LocalAlbumEntityData> custom({
|
||||||
i0.Expression<String>? id,
|
i0.Expression<String>? id,
|
||||||
i0.Expression<String>? name,
|
i0.Expression<String>? name,
|
||||||
|
|
@ -497,13 +610,14 @@ class LocalAlbumEntityCompanion
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
i1.LocalAlbumEntityCompanion copyWith(
|
i1.LocalAlbumEntityCompanion copyWith({
|
||||||
{i0.Value<String>? id,
|
i0.Value<String>? id,
|
||||||
i0.Value<String>? name,
|
i0.Value<String>? name,
|
||||||
i0.Value<DateTime>? updatedAt,
|
i0.Value<DateTime>? updatedAt,
|
||||||
i0.Value<i2.BackupSelection>? backupSelection,
|
i0.Value<i2.BackupSelection>? backupSelection,
|
||||||
i0.Value<bool>? isIosSharedAlbum,
|
i0.Value<bool>? isIosSharedAlbum,
|
||||||
i0.Value<bool?>? marker_}) {
|
i0.Value<bool?>? marker_,
|
||||||
|
}) {
|
||||||
return i1.LocalAlbumEntityCompanion(
|
return i1.LocalAlbumEntityCompanion(
|
||||||
id: id ?? this.id,
|
id: id ?? this.id,
|
||||||
name: name ?? this.name,
|
name: name ?? this.name,
|
||||||
|
|
@ -527,9 +641,11 @@ class LocalAlbumEntityCompanion
|
||||||
map['updated_at'] = i0.Variable<DateTime>(updatedAt.value);
|
map['updated_at'] = i0.Variable<DateTime>(updatedAt.value);
|
||||||
}
|
}
|
||||||
if (backupSelection.present) {
|
if (backupSelection.present) {
|
||||||
map['backup_selection'] = i0.Variable<int>(i1
|
map['backup_selection'] = i0.Variable<int>(
|
||||||
.$LocalAlbumEntityTable.$converterbackupSelection
|
i1.$LocalAlbumEntityTable.$converterbackupSelection.toSql(
|
||||||
.toSql(backupSelection.value));
|
backupSelection.value,
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (isIosSharedAlbum.present) {
|
if (isIosSharedAlbum.present) {
|
||||||
map['is_ios_shared_album'] = i0.Variable<bool>(isIosSharedAlbum.value);
|
map['is_ios_shared_album'] = i0.Variable<bool>(isIosSharedAlbum.value);
|
||||||
|
|
|
||||||
|
|
@ -11,76 +11,96 @@ import 'package:drift/internal/modular.dart' as i4;
|
||||||
import 'package:immich_mobile/infrastructure/entities/local_album.entity.drift.dart'
|
import 'package:immich_mobile/infrastructure/entities/local_album.entity.drift.dart'
|
||||||
as i5;
|
as i5;
|
||||||
|
|
||||||
typedef $$LocalAlbumAssetEntityTableCreateCompanionBuilder
|
typedef $$LocalAlbumAssetEntityTableCreateCompanionBuilder =
|
||||||
= i1.LocalAlbumAssetEntityCompanion Function({
|
i1.LocalAlbumAssetEntityCompanion Function({
|
||||||
required String assetId,
|
required String assetId,
|
||||||
required String albumId,
|
required String albumId,
|
||||||
});
|
});
|
||||||
typedef $$LocalAlbumAssetEntityTableUpdateCompanionBuilder
|
typedef $$LocalAlbumAssetEntityTableUpdateCompanionBuilder =
|
||||||
= i1.LocalAlbumAssetEntityCompanion Function({
|
i1.LocalAlbumAssetEntityCompanion Function({
|
||||||
i0.Value<String> assetId,
|
i0.Value<String> assetId,
|
||||||
i0.Value<String> albumId,
|
i0.Value<String> albumId,
|
||||||
});
|
});
|
||||||
|
|
||||||
final class $$LocalAlbumAssetEntityTableReferences extends i0.BaseReferences<
|
final class $$LocalAlbumAssetEntityTableReferences
|
||||||
i0.GeneratedDatabase,
|
extends
|
||||||
i1.$LocalAlbumAssetEntityTable,
|
i0.BaseReferences<
|
||||||
i1.LocalAlbumAssetEntityData> {
|
i0.GeneratedDatabase,
|
||||||
|
i1.$LocalAlbumAssetEntityTable,
|
||||||
|
i1.LocalAlbumAssetEntityData
|
||||||
|
> {
|
||||||
$$LocalAlbumAssetEntityTableReferences(
|
$$LocalAlbumAssetEntityTableReferences(
|
||||||
super.$_db, super.$_table, super.$_typedResult);
|
super.$_db,
|
||||||
|
super.$_table,
|
||||||
|
super.$_typedResult,
|
||||||
|
);
|
||||||
|
|
||||||
static i3.$LocalAssetEntityTable _assetIdTable(i0.GeneratedDatabase db) =>
|
static i3.$LocalAssetEntityTable _assetIdTable(i0.GeneratedDatabase db) =>
|
||||||
i4.ReadDatabaseContainer(db)
|
i4.ReadDatabaseContainer(db)
|
||||||
.resultSet<i3.$LocalAssetEntityTable>('local_asset_entity')
|
.resultSet<i3.$LocalAssetEntityTable>('local_asset_entity')
|
||||||
.createAlias(i0.$_aliasNameGenerator(
|
.createAlias(
|
||||||
|
i0.$_aliasNameGenerator(
|
||||||
i4.ReadDatabaseContainer(db)
|
i4.ReadDatabaseContainer(db)
|
||||||
.resultSet<i1.$LocalAlbumAssetEntityTable>(
|
.resultSet<i1.$LocalAlbumAssetEntityTable>(
|
||||||
'local_album_asset_entity')
|
'local_album_asset_entity',
|
||||||
|
)
|
||||||
.assetId,
|
.assetId,
|
||||||
i4.ReadDatabaseContainer(db)
|
i4.ReadDatabaseContainer(
|
||||||
.resultSet<i3.$LocalAssetEntityTable>('local_asset_entity')
|
db,
|
||||||
.id));
|
).resultSet<i3.$LocalAssetEntityTable>('local_asset_entity').id,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
i3.$$LocalAssetEntityTableProcessedTableManager get assetId {
|
i3.$$LocalAssetEntityTableProcessedTableManager get assetId {
|
||||||
final $_column = $_itemColumn<String>('asset_id')!;
|
final $_column = $_itemColumn<String>('asset_id')!;
|
||||||
|
|
||||||
final manager = i3
|
final manager = i3
|
||||||
.$$LocalAssetEntityTableTableManager(
|
.$$LocalAssetEntityTableTableManager(
|
||||||
|
$_db,
|
||||||
|
i4.ReadDatabaseContainer(
|
||||||
$_db,
|
$_db,
|
||||||
i4.ReadDatabaseContainer($_db)
|
).resultSet<i3.$LocalAssetEntityTable>('local_asset_entity'),
|
||||||
.resultSet<i3.$LocalAssetEntityTable>('local_asset_entity'))
|
)
|
||||||
.filter((f) => f.id.sqlEquals($_column));
|
.filter((f) => f.id.sqlEquals($_column));
|
||||||
final item = $_typedResult.readTableOrNull(_assetIdTable($_db));
|
final item = $_typedResult.readTableOrNull(_assetIdTable($_db));
|
||||||
if (item == null) return manager;
|
if (item == null) return manager;
|
||||||
return i0.ProcessedTableManager(
|
return i0.ProcessedTableManager(
|
||||||
manager.$state.copyWith(prefetchedData: [item]));
|
manager.$state.copyWith(prefetchedData: [item]),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static i5.$LocalAlbumEntityTable _albumIdTable(i0.GeneratedDatabase db) =>
|
static i5.$LocalAlbumEntityTable _albumIdTable(i0.GeneratedDatabase db) =>
|
||||||
i4.ReadDatabaseContainer(db)
|
i4.ReadDatabaseContainer(db)
|
||||||
.resultSet<i5.$LocalAlbumEntityTable>('local_album_entity')
|
.resultSet<i5.$LocalAlbumEntityTable>('local_album_entity')
|
||||||
.createAlias(i0.$_aliasNameGenerator(
|
.createAlias(
|
||||||
|
i0.$_aliasNameGenerator(
|
||||||
i4.ReadDatabaseContainer(db)
|
i4.ReadDatabaseContainer(db)
|
||||||
.resultSet<i1.$LocalAlbumAssetEntityTable>(
|
.resultSet<i1.$LocalAlbumAssetEntityTable>(
|
||||||
'local_album_asset_entity')
|
'local_album_asset_entity',
|
||||||
|
)
|
||||||
.albumId,
|
.albumId,
|
||||||
i4.ReadDatabaseContainer(db)
|
i4.ReadDatabaseContainer(
|
||||||
.resultSet<i5.$LocalAlbumEntityTable>('local_album_entity')
|
db,
|
||||||
.id));
|
).resultSet<i5.$LocalAlbumEntityTable>('local_album_entity').id,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
i5.$$LocalAlbumEntityTableProcessedTableManager get albumId {
|
i5.$$LocalAlbumEntityTableProcessedTableManager get albumId {
|
||||||
final $_column = $_itemColumn<String>('album_id')!;
|
final $_column = $_itemColumn<String>('album_id')!;
|
||||||
|
|
||||||
final manager = i5
|
final manager = i5
|
||||||
.$$LocalAlbumEntityTableTableManager(
|
.$$LocalAlbumEntityTableTableManager(
|
||||||
|
$_db,
|
||||||
|
i4.ReadDatabaseContainer(
|
||||||
$_db,
|
$_db,
|
||||||
i4.ReadDatabaseContainer($_db)
|
).resultSet<i5.$LocalAlbumEntityTable>('local_album_entity'),
|
||||||
.resultSet<i5.$LocalAlbumEntityTable>('local_album_entity'))
|
)
|
||||||
.filter((f) => f.id.sqlEquals($_column));
|
.filter((f) => f.id.sqlEquals($_column));
|
||||||
final item = $_typedResult.readTableOrNull(_albumIdTable($_db));
|
final item = $_typedResult.readTableOrNull(_albumIdTable($_db));
|
||||||
if (item == null) return manager;
|
if (item == null) return manager;
|
||||||
return i0.ProcessedTableManager(
|
return i0.ProcessedTableManager(
|
||||||
manager.$state.copyWith(prefetchedData: [item]));
|
manager.$state.copyWith(prefetchedData: [item]),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -95,45 +115,55 @@ class $$LocalAlbumAssetEntityTableFilterComposer
|
||||||
});
|
});
|
||||||
i3.$$LocalAssetEntityTableFilterComposer get assetId {
|
i3.$$LocalAssetEntityTableFilterComposer get assetId {
|
||||||
final i3.$$LocalAssetEntityTableFilterComposer composer = $composerBuilder(
|
final i3.$$LocalAssetEntityTableFilterComposer composer = $composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.assetId,
|
getCurrentColumn: (t) => t.assetId,
|
||||||
referencedTable: i4.ReadDatabaseContainer($db)
|
referencedTable: i4.ReadDatabaseContainer(
|
||||||
.resultSet<i3.$LocalAssetEntityTable>('local_asset_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i3.$LocalAssetEntityTable>('local_asset_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i3.$$LocalAssetEntityTableFilterComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i4.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i3.$LocalAssetEntityTable>('local_asset_entity'),
|
}) => i3.$$LocalAssetEntityTableFilterComposer(
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$db: $db,
|
||||||
joinBuilder: joinBuilder,
|
$table: i4.ReadDatabaseContainer(
|
||||||
$removeJoinBuilderFromRootComposer:
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer,
|
).resultSet<i3.$LocalAssetEntityTable>('local_asset_entity'),
|
||||||
));
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
|
|
||||||
i5.$$LocalAlbumEntityTableFilterComposer get albumId {
|
i5.$$LocalAlbumEntityTableFilterComposer get albumId {
|
||||||
final i5.$$LocalAlbumEntityTableFilterComposer composer = $composerBuilder(
|
final i5.$$LocalAlbumEntityTableFilterComposer composer = $composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.albumId,
|
getCurrentColumn: (t) => t.albumId,
|
||||||
referencedTable: i4.ReadDatabaseContainer($db)
|
referencedTable: i4.ReadDatabaseContainer(
|
||||||
.resultSet<i5.$LocalAlbumEntityTable>('local_album_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i5.$LocalAlbumEntityTable>('local_album_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i5.$$LocalAlbumEntityTableFilterComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i4.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i5.$LocalAlbumEntityTable>('local_album_entity'),
|
}) => i5.$$LocalAlbumEntityTableFilterComposer(
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$db: $db,
|
||||||
joinBuilder: joinBuilder,
|
$table: i4.ReadDatabaseContainer(
|
||||||
$removeJoinBuilderFromRootComposer:
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer,
|
).resultSet<i5.$LocalAlbumEntityTable>('local_album_entity'),
|
||||||
));
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -150,48 +180,56 @@ class $$LocalAlbumAssetEntityTableOrderingComposer
|
||||||
i3.$$LocalAssetEntityTableOrderingComposer get assetId {
|
i3.$$LocalAssetEntityTableOrderingComposer get assetId {
|
||||||
final i3.$$LocalAssetEntityTableOrderingComposer composer =
|
final i3.$$LocalAssetEntityTableOrderingComposer composer =
|
||||||
$composerBuilder(
|
$composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.assetId,
|
getCurrentColumn: (t) => t.assetId,
|
||||||
referencedTable: i4.ReadDatabaseContainer($db)
|
referencedTable: i4.ReadDatabaseContainer(
|
||||||
.resultSet<i3.$LocalAssetEntityTable>('local_asset_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i3.$LocalAssetEntityTable>('local_asset_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i3.$$LocalAssetEntityTableOrderingComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i4.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i3.$LocalAssetEntityTable>(
|
}) => i3.$$LocalAssetEntityTableOrderingComposer(
|
||||||
'local_asset_entity'),
|
$db: $db,
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$table: i4.ReadDatabaseContainer(
|
||||||
joinBuilder: joinBuilder,
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer:
|
).resultSet<i3.$LocalAssetEntityTable>('local_asset_entity'),
|
||||||
$removeJoinBuilderFromRootComposer,
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
));
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
|
|
||||||
i5.$$LocalAlbumEntityTableOrderingComposer get albumId {
|
i5.$$LocalAlbumEntityTableOrderingComposer get albumId {
|
||||||
final i5.$$LocalAlbumEntityTableOrderingComposer composer =
|
final i5.$$LocalAlbumEntityTableOrderingComposer composer =
|
||||||
$composerBuilder(
|
$composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.albumId,
|
getCurrentColumn: (t) => t.albumId,
|
||||||
referencedTable: i4.ReadDatabaseContainer($db)
|
referencedTable: i4.ReadDatabaseContainer(
|
||||||
.resultSet<i5.$LocalAlbumEntityTable>('local_album_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i5.$LocalAlbumEntityTable>('local_album_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i5.$$LocalAlbumEntityTableOrderingComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i4.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i5.$LocalAlbumEntityTable>(
|
}) => i5.$$LocalAlbumEntityTableOrderingComposer(
|
||||||
'local_album_entity'),
|
$db: $db,
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$table: i4.ReadDatabaseContainer(
|
||||||
joinBuilder: joinBuilder,
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer:
|
).resultSet<i5.$LocalAlbumEntityTable>('local_album_entity'),
|
||||||
$removeJoinBuilderFromRootComposer,
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
));
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -208,106 +246,129 @@ class $$LocalAlbumAssetEntityTableAnnotationComposer
|
||||||
i3.$$LocalAssetEntityTableAnnotationComposer get assetId {
|
i3.$$LocalAssetEntityTableAnnotationComposer get assetId {
|
||||||
final i3.$$LocalAssetEntityTableAnnotationComposer composer =
|
final i3.$$LocalAssetEntityTableAnnotationComposer composer =
|
||||||
$composerBuilder(
|
$composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.assetId,
|
getCurrentColumn: (t) => t.assetId,
|
||||||
referencedTable: i4.ReadDatabaseContainer($db)
|
referencedTable: i4.ReadDatabaseContainer(
|
||||||
.resultSet<i3.$LocalAssetEntityTable>('local_asset_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i3.$LocalAssetEntityTable>('local_asset_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i3.$$LocalAssetEntityTableAnnotationComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i4.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i3.$LocalAssetEntityTable>(
|
}) => i3.$$LocalAssetEntityTableAnnotationComposer(
|
||||||
'local_asset_entity'),
|
$db: $db,
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$table: i4.ReadDatabaseContainer(
|
||||||
joinBuilder: joinBuilder,
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer:
|
).resultSet<i3.$LocalAssetEntityTable>('local_asset_entity'),
|
||||||
$removeJoinBuilderFromRootComposer,
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
));
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
|
|
||||||
i5.$$LocalAlbumEntityTableAnnotationComposer get albumId {
|
i5.$$LocalAlbumEntityTableAnnotationComposer get albumId {
|
||||||
final i5.$$LocalAlbumEntityTableAnnotationComposer composer =
|
final i5.$$LocalAlbumEntityTableAnnotationComposer composer =
|
||||||
$composerBuilder(
|
$composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.albumId,
|
getCurrentColumn: (t) => t.albumId,
|
||||||
referencedTable: i4.ReadDatabaseContainer($db)
|
referencedTable: i4.ReadDatabaseContainer(
|
||||||
.resultSet<i5.$LocalAlbumEntityTable>('local_album_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i5.$LocalAlbumEntityTable>('local_album_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i5.$$LocalAlbumEntityTableAnnotationComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i4.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i5.$LocalAlbumEntityTable>(
|
}) => i5.$$LocalAlbumEntityTableAnnotationComposer(
|
||||||
'local_album_entity'),
|
$db: $db,
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$table: i4.ReadDatabaseContainer(
|
||||||
joinBuilder: joinBuilder,
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer:
|
).resultSet<i5.$LocalAlbumEntityTable>('local_album_entity'),
|
||||||
$removeJoinBuilderFromRootComposer,
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
));
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class $$LocalAlbumAssetEntityTableTableManager extends i0.RootTableManager<
|
class $$LocalAlbumAssetEntityTableTableManager
|
||||||
i0.GeneratedDatabase,
|
extends
|
||||||
i1.$LocalAlbumAssetEntityTable,
|
i0.RootTableManager<
|
||||||
i1.LocalAlbumAssetEntityData,
|
i0.GeneratedDatabase,
|
||||||
i1.$$LocalAlbumAssetEntityTableFilterComposer,
|
i1.$LocalAlbumAssetEntityTable,
|
||||||
i1.$$LocalAlbumAssetEntityTableOrderingComposer,
|
i1.LocalAlbumAssetEntityData,
|
||||||
i1.$$LocalAlbumAssetEntityTableAnnotationComposer,
|
i1.$$LocalAlbumAssetEntityTableFilterComposer,
|
||||||
$$LocalAlbumAssetEntityTableCreateCompanionBuilder,
|
i1.$$LocalAlbumAssetEntityTableOrderingComposer,
|
||||||
$$LocalAlbumAssetEntityTableUpdateCompanionBuilder,
|
i1.$$LocalAlbumAssetEntityTableAnnotationComposer,
|
||||||
(i1.LocalAlbumAssetEntityData, i1.$$LocalAlbumAssetEntityTableReferences),
|
$$LocalAlbumAssetEntityTableCreateCompanionBuilder,
|
||||||
i1.LocalAlbumAssetEntityData,
|
$$LocalAlbumAssetEntityTableUpdateCompanionBuilder,
|
||||||
i0.PrefetchHooks Function({bool assetId, bool albumId})> {
|
(
|
||||||
|
i1.LocalAlbumAssetEntityData,
|
||||||
|
i1.$$LocalAlbumAssetEntityTableReferences,
|
||||||
|
),
|
||||||
|
i1.LocalAlbumAssetEntityData,
|
||||||
|
i0.PrefetchHooks Function({bool assetId, bool albumId})
|
||||||
|
> {
|
||||||
$$LocalAlbumAssetEntityTableTableManager(
|
$$LocalAlbumAssetEntityTableTableManager(
|
||||||
i0.GeneratedDatabase db, i1.$LocalAlbumAssetEntityTable table)
|
i0.GeneratedDatabase db,
|
||||||
: super(i0.TableManagerState(
|
i1.$LocalAlbumAssetEntityTable table,
|
||||||
|
) : super(
|
||||||
|
i0.TableManagerState(
|
||||||
db: db,
|
db: db,
|
||||||
table: table,
|
table: table,
|
||||||
createFilteringComposer: () =>
|
createFilteringComposer: () =>
|
||||||
i1.$$LocalAlbumAssetEntityTableFilterComposer(
|
i1.$$LocalAlbumAssetEntityTableFilterComposer(
|
||||||
$db: db, $table: table),
|
$db: db,
|
||||||
|
$table: table,
|
||||||
|
),
|
||||||
createOrderingComposer: () =>
|
createOrderingComposer: () =>
|
||||||
i1.$$LocalAlbumAssetEntityTableOrderingComposer(
|
i1.$$LocalAlbumAssetEntityTableOrderingComposer(
|
||||||
$db: db, $table: table),
|
$db: db,
|
||||||
|
$table: table,
|
||||||
|
),
|
||||||
createComputedFieldComposer: () =>
|
createComputedFieldComposer: () =>
|
||||||
i1.$$LocalAlbumAssetEntityTableAnnotationComposer(
|
i1.$$LocalAlbumAssetEntityTableAnnotationComposer(
|
||||||
$db: db, $table: table),
|
$db: db,
|
||||||
updateCompanionCallback: ({
|
$table: table,
|
||||||
i0.Value<String> assetId = const i0.Value.absent(),
|
),
|
||||||
i0.Value<String> albumId = const i0.Value.absent(),
|
updateCompanionCallback:
|
||||||
}) =>
|
({
|
||||||
i1.LocalAlbumAssetEntityCompanion(
|
i0.Value<String> assetId = const i0.Value.absent(),
|
||||||
assetId: assetId,
|
i0.Value<String> albumId = const i0.Value.absent(),
|
||||||
albumId: albumId,
|
}) => i1.LocalAlbumAssetEntityCompanion(
|
||||||
),
|
assetId: assetId,
|
||||||
createCompanionCallback: ({
|
albumId: albumId,
|
||||||
required String assetId,
|
),
|
||||||
required String albumId,
|
createCompanionCallback:
|
||||||
}) =>
|
({required String assetId, required String albumId}) =>
|
||||||
i1.LocalAlbumAssetEntityCompanion.insert(
|
i1.LocalAlbumAssetEntityCompanion.insert(
|
||||||
assetId: assetId,
|
assetId: assetId,
|
||||||
albumId: albumId,
|
albumId: albumId,
|
||||||
),
|
),
|
||||||
withReferenceMapper: (p0) => p0
|
withReferenceMapper: (p0) => p0
|
||||||
.map((e) => (
|
.map(
|
||||||
e.readTable(table),
|
(e) => (
|
||||||
i1.$$LocalAlbumAssetEntityTableReferences(db, table, e)
|
e.readTable(table),
|
||||||
))
|
i1.$$LocalAlbumAssetEntityTableReferences(db, table, e),
|
||||||
|
),
|
||||||
|
)
|
||||||
.toList(),
|
.toList(),
|
||||||
prefetchHooksCallback: ({assetId = false, albumId = false}) {
|
prefetchHooksCallback: ({assetId = false, albumId = false}) {
|
||||||
return i0.PrefetchHooks(
|
return i0.PrefetchHooks(
|
||||||
db: db,
|
db: db,
|
||||||
explicitlyWatchedTables: [],
|
explicitlyWatchedTables: [],
|
||||||
addJoins: <
|
addJoins:
|
||||||
T extends i0.TableManagerState<
|
<
|
||||||
|
T extends i0.TableManagerState<
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic,
|
dynamic,
|
||||||
|
|
@ -318,83 +379,104 @@ class $$LocalAlbumAssetEntityTableTableManager extends i0.RootTableManager<
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic>>(state) {
|
dynamic
|
||||||
if (assetId) {
|
>
|
||||||
state = state.withJoin(
|
>(state) {
|
||||||
currentTable: table,
|
if (assetId) {
|
||||||
currentColumn: table.assetId,
|
state =
|
||||||
referencedTable: i1.$$LocalAlbumAssetEntityTableReferences
|
state.withJoin(
|
||||||
._assetIdTable(db),
|
currentTable: table,
|
||||||
referencedColumn: i1.$$LocalAlbumAssetEntityTableReferences
|
currentColumn: table.assetId,
|
||||||
._assetIdTable(db)
|
referencedTable: i1
|
||||||
.id,
|
.$$LocalAlbumAssetEntityTableReferences
|
||||||
) as T;
|
._assetIdTable(db),
|
||||||
}
|
referencedColumn: i1
|
||||||
if (albumId) {
|
.$$LocalAlbumAssetEntityTableReferences
|
||||||
state = state.withJoin(
|
._assetIdTable(db)
|
||||||
currentTable: table,
|
.id,
|
||||||
currentColumn: table.albumId,
|
)
|
||||||
referencedTable: i1.$$LocalAlbumAssetEntityTableReferences
|
as T;
|
||||||
._albumIdTable(db),
|
}
|
||||||
referencedColumn: i1.$$LocalAlbumAssetEntityTableReferences
|
if (albumId) {
|
||||||
._albumIdTable(db)
|
state =
|
||||||
.id,
|
state.withJoin(
|
||||||
) as T;
|
currentTable: table,
|
||||||
}
|
currentColumn: table.albumId,
|
||||||
|
referencedTable: i1
|
||||||
|
.$$LocalAlbumAssetEntityTableReferences
|
||||||
|
._albumIdTable(db),
|
||||||
|
referencedColumn: i1
|
||||||
|
.$$LocalAlbumAssetEntityTableReferences
|
||||||
|
._albumIdTable(db)
|
||||||
|
.id,
|
||||||
|
)
|
||||||
|
as T;
|
||||||
|
}
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
},
|
},
|
||||||
getPrefetchedDataCallback: (items) async {
|
getPrefetchedDataCallback: (items) async {
|
||||||
return [];
|
return [];
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
));
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef $$LocalAlbumAssetEntityTableProcessedTableManager
|
typedef $$LocalAlbumAssetEntityTableProcessedTableManager =
|
||||||
= i0.ProcessedTableManager<
|
i0.ProcessedTableManager<
|
||||||
i0.GeneratedDatabase,
|
i0.GeneratedDatabase,
|
||||||
i1.$LocalAlbumAssetEntityTable,
|
i1.$LocalAlbumAssetEntityTable,
|
||||||
i1.LocalAlbumAssetEntityData,
|
i1.LocalAlbumAssetEntityData,
|
||||||
i1.$$LocalAlbumAssetEntityTableFilterComposer,
|
i1.$$LocalAlbumAssetEntityTableFilterComposer,
|
||||||
i1.$$LocalAlbumAssetEntityTableOrderingComposer,
|
i1.$$LocalAlbumAssetEntityTableOrderingComposer,
|
||||||
i1.$$LocalAlbumAssetEntityTableAnnotationComposer,
|
i1.$$LocalAlbumAssetEntityTableAnnotationComposer,
|
||||||
$$LocalAlbumAssetEntityTableCreateCompanionBuilder,
|
$$LocalAlbumAssetEntityTableCreateCompanionBuilder,
|
||||||
$$LocalAlbumAssetEntityTableUpdateCompanionBuilder,
|
$$LocalAlbumAssetEntityTableUpdateCompanionBuilder,
|
||||||
(
|
(i1.LocalAlbumAssetEntityData, i1.$$LocalAlbumAssetEntityTableReferences),
|
||||||
i1.LocalAlbumAssetEntityData,
|
i1.LocalAlbumAssetEntityData,
|
||||||
i1.$$LocalAlbumAssetEntityTableReferences
|
i0.PrefetchHooks Function({bool assetId, bool albumId})
|
||||||
),
|
>;
|
||||||
i1.LocalAlbumAssetEntityData,
|
|
||||||
i0.PrefetchHooks Function({bool assetId, bool albumId})>;
|
|
||||||
|
|
||||||
class $LocalAlbumAssetEntityTable extends i2.LocalAlbumAssetEntity
|
class $LocalAlbumAssetEntityTable extends i2.LocalAlbumAssetEntity
|
||||||
with
|
with
|
||||||
i0
|
i0.TableInfo<
|
||||||
.TableInfo<$LocalAlbumAssetEntityTable, i1.LocalAlbumAssetEntityData> {
|
$LocalAlbumAssetEntityTable,
|
||||||
|
i1.LocalAlbumAssetEntityData
|
||||||
|
> {
|
||||||
@override
|
@override
|
||||||
final i0.GeneratedDatabase attachedDatabase;
|
final i0.GeneratedDatabase attachedDatabase;
|
||||||
final String? _alias;
|
final String? _alias;
|
||||||
$LocalAlbumAssetEntityTable(this.attachedDatabase, [this._alias]);
|
$LocalAlbumAssetEntityTable(this.attachedDatabase, [this._alias]);
|
||||||
static const i0.VerificationMeta _assetIdMeta =
|
static const i0.VerificationMeta _assetIdMeta = const i0.VerificationMeta(
|
||||||
const i0.VerificationMeta('assetId');
|
'assetId',
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumn<String> assetId = i0.GeneratedColumn<String>(
|
late final i0.GeneratedColumn<String> assetId = i0.GeneratedColumn<String>(
|
||||||
'asset_id', aliasedName, false,
|
'asset_id',
|
||||||
type: i0.DriftSqlType.string,
|
aliasedName,
|
||||||
requiredDuringInsert: true,
|
false,
|
||||||
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
|
type: i0.DriftSqlType.string,
|
||||||
'REFERENCES local_asset_entity (id) ON DELETE CASCADE'));
|
requiredDuringInsert: true,
|
||||||
static const i0.VerificationMeta _albumIdMeta =
|
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
|
||||||
const i0.VerificationMeta('albumId');
|
'REFERENCES local_asset_entity (id) ON DELETE CASCADE',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
static const i0.VerificationMeta _albumIdMeta = const i0.VerificationMeta(
|
||||||
|
'albumId',
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumn<String> albumId = i0.GeneratedColumn<String>(
|
late final i0.GeneratedColumn<String> albumId = i0.GeneratedColumn<String>(
|
||||||
'album_id', aliasedName, false,
|
'album_id',
|
||||||
type: i0.DriftSqlType.string,
|
aliasedName,
|
||||||
requiredDuringInsert: true,
|
false,
|
||||||
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
|
type: i0.DriftSqlType.string,
|
||||||
'REFERENCES local_album_entity (id) ON DELETE CASCADE'));
|
requiredDuringInsert: true,
|
||||||
|
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
|
||||||
|
'REFERENCES local_album_entity (id) ON DELETE CASCADE',
|
||||||
|
),
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
List<i0.GeneratedColumn> get $columns => [assetId, albumId];
|
List<i0.GeneratedColumn> get $columns => [assetId, albumId];
|
||||||
@override
|
@override
|
||||||
|
|
@ -404,19 +486,24 @@ class $LocalAlbumAssetEntityTable extends i2.LocalAlbumAssetEntity
|
||||||
static const String $name = 'local_album_asset_entity';
|
static const String $name = 'local_album_asset_entity';
|
||||||
@override
|
@override
|
||||||
i0.VerificationContext validateIntegrity(
|
i0.VerificationContext validateIntegrity(
|
||||||
i0.Insertable<i1.LocalAlbumAssetEntityData> instance,
|
i0.Insertable<i1.LocalAlbumAssetEntityData> instance, {
|
||||||
{bool isInserting = false}) {
|
bool isInserting = false,
|
||||||
|
}) {
|
||||||
final context = i0.VerificationContext();
|
final context = i0.VerificationContext();
|
||||||
final data = instance.toColumns(true);
|
final data = instance.toColumns(true);
|
||||||
if (data.containsKey('asset_id')) {
|
if (data.containsKey('asset_id')) {
|
||||||
context.handle(_assetIdMeta,
|
context.handle(
|
||||||
assetId.isAcceptableOrUnknown(data['asset_id']!, _assetIdMeta));
|
_assetIdMeta,
|
||||||
|
assetId.isAcceptableOrUnknown(data['asset_id']!, _assetIdMeta),
|
||||||
|
);
|
||||||
} else if (isInserting) {
|
} else if (isInserting) {
|
||||||
context.missing(_assetIdMeta);
|
context.missing(_assetIdMeta);
|
||||||
}
|
}
|
||||||
if (data.containsKey('album_id')) {
|
if (data.containsKey('album_id')) {
|
||||||
context.handle(_albumIdMeta,
|
context.handle(
|
||||||
albumId.isAcceptableOrUnknown(data['album_id']!, _albumIdMeta));
|
_albumIdMeta,
|
||||||
|
albumId.isAcceptableOrUnknown(data['album_id']!, _albumIdMeta),
|
||||||
|
);
|
||||||
} else if (isInserting) {
|
} else if (isInserting) {
|
||||||
context.missing(_albumIdMeta);
|
context.missing(_albumIdMeta);
|
||||||
}
|
}
|
||||||
|
|
@ -426,14 +513,20 @@ class $LocalAlbumAssetEntityTable extends i2.LocalAlbumAssetEntity
|
||||||
@override
|
@override
|
||||||
Set<i0.GeneratedColumn> get $primaryKey => {assetId, albumId};
|
Set<i0.GeneratedColumn> get $primaryKey => {assetId, albumId};
|
||||||
@override
|
@override
|
||||||
i1.LocalAlbumAssetEntityData map(Map<String, dynamic> data,
|
i1.LocalAlbumAssetEntityData map(
|
||||||
{String? tablePrefix}) {
|
Map<String, dynamic> data, {
|
||||||
|
String? tablePrefix,
|
||||||
|
}) {
|
||||||
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
||||||
return i1.LocalAlbumAssetEntityData(
|
return i1.LocalAlbumAssetEntityData(
|
||||||
assetId: attachedDatabase.typeMapping
|
assetId: attachedDatabase.typeMapping.read(
|
||||||
.read(i0.DriftSqlType.string, data['${effectivePrefix}asset_id'])!,
|
i0.DriftSqlType.string,
|
||||||
albumId: attachedDatabase.typeMapping
|
data['${effectivePrefix}asset_id'],
|
||||||
.read(i0.DriftSqlType.string, data['${effectivePrefix}album_id'])!,
|
)!,
|
||||||
|
albumId: attachedDatabase.typeMapping.read(
|
||||||
|
i0.DriftSqlType.string,
|
||||||
|
data['${effectivePrefix}album_id'],
|
||||||
|
)!,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -452,8 +545,10 @@ class LocalAlbumAssetEntityData extends i0.DataClass
|
||||||
implements i0.Insertable<i1.LocalAlbumAssetEntityData> {
|
implements i0.Insertable<i1.LocalAlbumAssetEntityData> {
|
||||||
final String assetId;
|
final String assetId;
|
||||||
final String albumId;
|
final String albumId;
|
||||||
const LocalAlbumAssetEntityData(
|
const LocalAlbumAssetEntityData({
|
||||||
{required this.assetId, required this.albumId});
|
required this.assetId,
|
||||||
|
required this.albumId,
|
||||||
|
});
|
||||||
@override
|
@override
|
||||||
Map<String, i0.Expression> toColumns(bool nullToAbsent) {
|
Map<String, i0.Expression> toColumns(bool nullToAbsent) {
|
||||||
final map = <String, i0.Expression>{};
|
final map = <String, i0.Expression>{};
|
||||||
|
|
@ -462,8 +557,10 @@ class LocalAlbumAssetEntityData extends i0.DataClass
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
factory LocalAlbumAssetEntityData.fromJson(Map<String, dynamic> json,
|
factory LocalAlbumAssetEntityData.fromJson(
|
||||||
{i0.ValueSerializer? serializer}) {
|
Map<String, dynamic> json, {
|
||||||
|
i0.ValueSerializer? serializer,
|
||||||
|
}) {
|
||||||
serializer ??= i0.driftRuntimeOptions.defaultSerializer;
|
serializer ??= i0.driftRuntimeOptions.defaultSerializer;
|
||||||
return LocalAlbumAssetEntityData(
|
return LocalAlbumAssetEntityData(
|
||||||
assetId: serializer.fromJson<String>(json['assetId']),
|
assetId: serializer.fromJson<String>(json['assetId']),
|
||||||
|
|
@ -485,7 +582,8 @@ class LocalAlbumAssetEntityData extends i0.DataClass
|
||||||
albumId: albumId ?? this.albumId,
|
albumId: albumId ?? this.albumId,
|
||||||
);
|
);
|
||||||
LocalAlbumAssetEntityData copyWithCompanion(
|
LocalAlbumAssetEntityData copyWithCompanion(
|
||||||
i1.LocalAlbumAssetEntityCompanion data) {
|
i1.LocalAlbumAssetEntityCompanion data,
|
||||||
|
) {
|
||||||
return LocalAlbumAssetEntityData(
|
return LocalAlbumAssetEntityData(
|
||||||
assetId: data.assetId.present ? data.assetId.value : this.assetId,
|
assetId: data.assetId.present ? data.assetId.value : this.assetId,
|
||||||
albumId: data.albumId.present ? data.albumId.value : this.albumId,
|
albumId: data.albumId.present ? data.albumId.value : this.albumId,
|
||||||
|
|
@ -522,8 +620,8 @@ class LocalAlbumAssetEntityCompanion
|
||||||
LocalAlbumAssetEntityCompanion.insert({
|
LocalAlbumAssetEntityCompanion.insert({
|
||||||
required String assetId,
|
required String assetId,
|
||||||
required String albumId,
|
required String albumId,
|
||||||
}) : assetId = i0.Value(assetId),
|
}) : assetId = i0.Value(assetId),
|
||||||
albumId = i0.Value(albumId);
|
albumId = i0.Value(albumId);
|
||||||
static i0.Insertable<i1.LocalAlbumAssetEntityData> custom({
|
static i0.Insertable<i1.LocalAlbumAssetEntityData> custom({
|
||||||
i0.Expression<String>? assetId,
|
i0.Expression<String>? assetId,
|
||||||
i0.Expression<String>? albumId,
|
i0.Expression<String>? albumId,
|
||||||
|
|
@ -534,8 +632,10 @@ class LocalAlbumAssetEntityCompanion
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
i1.LocalAlbumAssetEntityCompanion copyWith(
|
i1.LocalAlbumAssetEntityCompanion copyWith({
|
||||||
{i0.Value<String>? assetId, i0.Value<String>? albumId}) {
|
i0.Value<String>? assetId,
|
||||||
|
i0.Value<String>? albumId,
|
||||||
|
}) {
|
||||||
return i1.LocalAlbumAssetEntityCompanion(
|
return i1.LocalAlbumAssetEntityCompanion(
|
||||||
assetId: assetId ?? this.assetId,
|
assetId: assetId ?? this.assetId,
|
||||||
albumId: albumId ?? this.albumId,
|
albumId: albumId ?? this.albumId,
|
||||||
|
|
|
||||||
|
|
@ -22,17 +22,17 @@ class LocalAssetEntity extends Table with DriftDefaultsMixin, AssetEntityMixin {
|
||||||
|
|
||||||
extension LocalAssetEntityDataDomainEx on LocalAssetEntityData {
|
extension LocalAssetEntityDataDomainEx on LocalAssetEntityData {
|
||||||
LocalAsset toDto() => LocalAsset(
|
LocalAsset toDto() => LocalAsset(
|
||||||
id: id,
|
id: id,
|
||||||
name: name,
|
name: name,
|
||||||
checksum: checksum,
|
checksum: checksum,
|
||||||
type: type,
|
type: type,
|
||||||
createdAt: createdAt,
|
createdAt: createdAt,
|
||||||
updatedAt: updatedAt,
|
updatedAt: updatedAt,
|
||||||
durationInSeconds: durationInSeconds,
|
durationInSeconds: durationInSeconds,
|
||||||
isFavorite: isFavorite,
|
isFavorite: isFavorite,
|
||||||
height: height,
|
height: height,
|
||||||
width: width,
|
width: width,
|
||||||
remoteId: null,
|
remoteId: null,
|
||||||
orientation: orientation,
|
orientation: orientation,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
913
mobile/lib/infrastructure/entities/log.entity.g.dart
generated
913
mobile/lib/infrastructure/entities/log.entity.g.dart
generated
File diff suppressed because it is too large
Load diff
1019
mobile/lib/infrastructure/entities/memory.entity.drift.dart
generated
1019
mobile/lib/infrastructure/entities/memory.entity.drift.dart
generated
File diff suppressed because it is too large
Load diff
|
|
@ -11,74 +11,92 @@ import 'package:drift/internal/modular.dart' as i4;
|
||||||
import 'package:immich_mobile/infrastructure/entities/memory.entity.drift.dart'
|
import 'package:immich_mobile/infrastructure/entities/memory.entity.drift.dart'
|
||||||
as i5;
|
as i5;
|
||||||
|
|
||||||
typedef $$MemoryAssetEntityTableCreateCompanionBuilder
|
typedef $$MemoryAssetEntityTableCreateCompanionBuilder =
|
||||||
= i1.MemoryAssetEntityCompanion Function({
|
i1.MemoryAssetEntityCompanion Function({
|
||||||
required String assetId,
|
required String assetId,
|
||||||
required String memoryId,
|
required String memoryId,
|
||||||
});
|
});
|
||||||
typedef $$MemoryAssetEntityTableUpdateCompanionBuilder
|
typedef $$MemoryAssetEntityTableUpdateCompanionBuilder =
|
||||||
= i1.MemoryAssetEntityCompanion Function({
|
i1.MemoryAssetEntityCompanion Function({
|
||||||
i0.Value<String> assetId,
|
i0.Value<String> assetId,
|
||||||
i0.Value<String> memoryId,
|
i0.Value<String> memoryId,
|
||||||
});
|
});
|
||||||
|
|
||||||
final class $$MemoryAssetEntityTableReferences extends i0.BaseReferences<
|
final class $$MemoryAssetEntityTableReferences
|
||||||
i0.GeneratedDatabase,
|
extends
|
||||||
i1.$MemoryAssetEntityTable,
|
i0.BaseReferences<
|
||||||
i1.MemoryAssetEntityData> {
|
i0.GeneratedDatabase,
|
||||||
|
i1.$MemoryAssetEntityTable,
|
||||||
|
i1.MemoryAssetEntityData
|
||||||
|
> {
|
||||||
$$MemoryAssetEntityTableReferences(
|
$$MemoryAssetEntityTableReferences(
|
||||||
super.$_db, super.$_table, super.$_typedResult);
|
super.$_db,
|
||||||
|
super.$_table,
|
||||||
|
super.$_typedResult,
|
||||||
|
);
|
||||||
|
|
||||||
static i3.$RemoteAssetEntityTable _assetIdTable(i0.GeneratedDatabase db) =>
|
static i3.$RemoteAssetEntityTable _assetIdTable(i0.GeneratedDatabase db) =>
|
||||||
i4.ReadDatabaseContainer(db)
|
i4.ReadDatabaseContainer(db)
|
||||||
.resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity')
|
.resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity')
|
||||||
.createAlias(i0.$_aliasNameGenerator(
|
.createAlias(
|
||||||
|
i0.$_aliasNameGenerator(
|
||||||
i4.ReadDatabaseContainer(db)
|
i4.ReadDatabaseContainer(db)
|
||||||
.resultSet<i1.$MemoryAssetEntityTable>('memory_asset_entity')
|
.resultSet<i1.$MemoryAssetEntityTable>('memory_asset_entity')
|
||||||
.assetId,
|
.assetId,
|
||||||
i4.ReadDatabaseContainer(db)
|
i4.ReadDatabaseContainer(
|
||||||
.resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity')
|
db,
|
||||||
.id));
|
).resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity').id,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
i3.$$RemoteAssetEntityTableProcessedTableManager get assetId {
|
i3.$$RemoteAssetEntityTableProcessedTableManager get assetId {
|
||||||
final $_column = $_itemColumn<String>('asset_id')!;
|
final $_column = $_itemColumn<String>('asset_id')!;
|
||||||
|
|
||||||
final manager = i3
|
final manager = i3
|
||||||
.$$RemoteAssetEntityTableTableManager(
|
.$$RemoteAssetEntityTableTableManager(
|
||||||
|
$_db,
|
||||||
|
i4.ReadDatabaseContainer(
|
||||||
$_db,
|
$_db,
|
||||||
i4.ReadDatabaseContainer($_db)
|
).resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity'),
|
||||||
.resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity'))
|
)
|
||||||
.filter((f) => f.id.sqlEquals($_column));
|
.filter((f) => f.id.sqlEquals($_column));
|
||||||
final item = $_typedResult.readTableOrNull(_assetIdTable($_db));
|
final item = $_typedResult.readTableOrNull(_assetIdTable($_db));
|
||||||
if (item == null) return manager;
|
if (item == null) return manager;
|
||||||
return i0.ProcessedTableManager(
|
return i0.ProcessedTableManager(
|
||||||
manager.$state.copyWith(prefetchedData: [item]));
|
manager.$state.copyWith(prefetchedData: [item]),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static i5.$MemoryEntityTable _memoryIdTable(i0.GeneratedDatabase db) =>
|
static i5.$MemoryEntityTable _memoryIdTable(i0.GeneratedDatabase db) =>
|
||||||
i4.ReadDatabaseContainer(db)
|
i4.ReadDatabaseContainer(db)
|
||||||
.resultSet<i5.$MemoryEntityTable>('memory_entity')
|
.resultSet<i5.$MemoryEntityTable>('memory_entity')
|
||||||
.createAlias(i0.$_aliasNameGenerator(
|
.createAlias(
|
||||||
|
i0.$_aliasNameGenerator(
|
||||||
i4.ReadDatabaseContainer(db)
|
i4.ReadDatabaseContainer(db)
|
||||||
.resultSet<i1.$MemoryAssetEntityTable>('memory_asset_entity')
|
.resultSet<i1.$MemoryAssetEntityTable>('memory_asset_entity')
|
||||||
.memoryId,
|
.memoryId,
|
||||||
i4.ReadDatabaseContainer(db)
|
i4.ReadDatabaseContainer(
|
||||||
.resultSet<i5.$MemoryEntityTable>('memory_entity')
|
db,
|
||||||
.id));
|
).resultSet<i5.$MemoryEntityTable>('memory_entity').id,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
i5.$$MemoryEntityTableProcessedTableManager get memoryId {
|
i5.$$MemoryEntityTableProcessedTableManager get memoryId {
|
||||||
final $_column = $_itemColumn<String>('memory_id')!;
|
final $_column = $_itemColumn<String>('memory_id')!;
|
||||||
|
|
||||||
final manager = i5
|
final manager = i5
|
||||||
.$$MemoryEntityTableTableManager(
|
.$$MemoryEntityTableTableManager(
|
||||||
|
$_db,
|
||||||
|
i4.ReadDatabaseContainer(
|
||||||
$_db,
|
$_db,
|
||||||
i4.ReadDatabaseContainer($_db)
|
).resultSet<i5.$MemoryEntityTable>('memory_entity'),
|
||||||
.resultSet<i5.$MemoryEntityTable>('memory_entity'))
|
)
|
||||||
.filter((f) => f.id.sqlEquals($_column));
|
.filter((f) => f.id.sqlEquals($_column));
|
||||||
final item = $_typedResult.readTableOrNull(_memoryIdTable($_db));
|
final item = $_typedResult.readTableOrNull(_memoryIdTable($_db));
|
||||||
if (item == null) return manager;
|
if (item == null) return manager;
|
||||||
return i0.ProcessedTableManager(
|
return i0.ProcessedTableManager(
|
||||||
manager.$state.copyWith(prefetchedData: [item]));
|
manager.$state.copyWith(prefetchedData: [item]),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -93,45 +111,55 @@ class $$MemoryAssetEntityTableFilterComposer
|
||||||
});
|
});
|
||||||
i3.$$RemoteAssetEntityTableFilterComposer get assetId {
|
i3.$$RemoteAssetEntityTableFilterComposer get assetId {
|
||||||
final i3.$$RemoteAssetEntityTableFilterComposer composer = $composerBuilder(
|
final i3.$$RemoteAssetEntityTableFilterComposer composer = $composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.assetId,
|
getCurrentColumn: (t) => t.assetId,
|
||||||
referencedTable: i4.ReadDatabaseContainer($db)
|
referencedTable: i4.ReadDatabaseContainer(
|
||||||
.resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i3.$$RemoteAssetEntityTableFilterComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i4.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity'),
|
}) => i3.$$RemoteAssetEntityTableFilterComposer(
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$db: $db,
|
||||||
joinBuilder: joinBuilder,
|
$table: i4.ReadDatabaseContainer(
|
||||||
$removeJoinBuilderFromRootComposer:
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer,
|
).resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity'),
|
||||||
));
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
|
|
||||||
i5.$$MemoryEntityTableFilterComposer get memoryId {
|
i5.$$MemoryEntityTableFilterComposer get memoryId {
|
||||||
final i5.$$MemoryEntityTableFilterComposer composer = $composerBuilder(
|
final i5.$$MemoryEntityTableFilterComposer composer = $composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.memoryId,
|
getCurrentColumn: (t) => t.memoryId,
|
||||||
referencedTable: i4.ReadDatabaseContainer($db)
|
referencedTable: i4.ReadDatabaseContainer(
|
||||||
.resultSet<i5.$MemoryEntityTable>('memory_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i5.$MemoryEntityTable>('memory_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i5.$$MemoryEntityTableFilterComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i4.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i5.$MemoryEntityTable>('memory_entity'),
|
}) => i5.$$MemoryEntityTableFilterComposer(
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$db: $db,
|
||||||
joinBuilder: joinBuilder,
|
$table: i4.ReadDatabaseContainer(
|
||||||
$removeJoinBuilderFromRootComposer:
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer,
|
).resultSet<i5.$MemoryEntityTable>('memory_entity'),
|
||||||
));
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -148,46 +176,55 @@ class $$MemoryAssetEntityTableOrderingComposer
|
||||||
i3.$$RemoteAssetEntityTableOrderingComposer get assetId {
|
i3.$$RemoteAssetEntityTableOrderingComposer get assetId {
|
||||||
final i3.$$RemoteAssetEntityTableOrderingComposer composer =
|
final i3.$$RemoteAssetEntityTableOrderingComposer composer =
|
||||||
$composerBuilder(
|
$composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.assetId,
|
getCurrentColumn: (t) => t.assetId,
|
||||||
referencedTable: i4.ReadDatabaseContainer($db)
|
referencedTable: i4.ReadDatabaseContainer(
|
||||||
.resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i3.$$RemoteAssetEntityTableOrderingComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i4.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i3.$RemoteAssetEntityTable>(
|
}) => i3.$$RemoteAssetEntityTableOrderingComposer(
|
||||||
'remote_asset_entity'),
|
$db: $db,
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$table: i4.ReadDatabaseContainer(
|
||||||
joinBuilder: joinBuilder,
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer:
|
).resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity'),
|
||||||
$removeJoinBuilderFromRootComposer,
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
));
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
|
|
||||||
i5.$$MemoryEntityTableOrderingComposer get memoryId {
|
i5.$$MemoryEntityTableOrderingComposer get memoryId {
|
||||||
final i5.$$MemoryEntityTableOrderingComposer composer = $composerBuilder(
|
final i5.$$MemoryEntityTableOrderingComposer composer = $composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.memoryId,
|
getCurrentColumn: (t) => t.memoryId,
|
||||||
referencedTable: i4.ReadDatabaseContainer($db)
|
referencedTable: i4.ReadDatabaseContainer(
|
||||||
.resultSet<i5.$MemoryEntityTable>('memory_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i5.$MemoryEntityTable>('memory_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i5.$$MemoryEntityTableOrderingComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i4.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i5.$MemoryEntityTable>('memory_entity'),
|
}) => i5.$$MemoryEntityTableOrderingComposer(
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$db: $db,
|
||||||
joinBuilder: joinBuilder,
|
$table: i4.ReadDatabaseContainer(
|
||||||
$removeJoinBuilderFromRootComposer:
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer,
|
).resultSet<i5.$MemoryEntityTable>('memory_entity'),
|
||||||
));
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -204,65 +241,79 @@ class $$MemoryAssetEntityTableAnnotationComposer
|
||||||
i3.$$RemoteAssetEntityTableAnnotationComposer get assetId {
|
i3.$$RemoteAssetEntityTableAnnotationComposer get assetId {
|
||||||
final i3.$$RemoteAssetEntityTableAnnotationComposer composer =
|
final i3.$$RemoteAssetEntityTableAnnotationComposer composer =
|
||||||
$composerBuilder(
|
$composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.assetId,
|
getCurrentColumn: (t) => t.assetId,
|
||||||
referencedTable: i4.ReadDatabaseContainer($db)
|
referencedTable: i4.ReadDatabaseContainer(
|
||||||
.resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i3.$$RemoteAssetEntityTableAnnotationComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i4.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i3.$RemoteAssetEntityTable>(
|
}) => i3.$$RemoteAssetEntityTableAnnotationComposer(
|
||||||
'remote_asset_entity'),
|
$db: $db,
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$table: i4.ReadDatabaseContainer(
|
||||||
joinBuilder: joinBuilder,
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer:
|
).resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity'),
|
||||||
$removeJoinBuilderFromRootComposer,
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
));
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
|
|
||||||
i5.$$MemoryEntityTableAnnotationComposer get memoryId {
|
i5.$$MemoryEntityTableAnnotationComposer get memoryId {
|
||||||
final i5.$$MemoryEntityTableAnnotationComposer composer = $composerBuilder(
|
final i5.$$MemoryEntityTableAnnotationComposer composer = $composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.memoryId,
|
getCurrentColumn: (t) => t.memoryId,
|
||||||
referencedTable: i4.ReadDatabaseContainer($db)
|
referencedTable: i4.ReadDatabaseContainer(
|
||||||
.resultSet<i5.$MemoryEntityTable>('memory_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i5.$MemoryEntityTable>('memory_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i5.$$MemoryEntityTableAnnotationComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i4.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i5.$MemoryEntityTable>('memory_entity'),
|
}) => i5.$$MemoryEntityTableAnnotationComposer(
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$db: $db,
|
||||||
joinBuilder: joinBuilder,
|
$table: i4.ReadDatabaseContainer(
|
||||||
$removeJoinBuilderFromRootComposer:
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer,
|
).resultSet<i5.$MemoryEntityTable>('memory_entity'),
|
||||||
));
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class $$MemoryAssetEntityTableTableManager extends i0.RootTableManager<
|
class $$MemoryAssetEntityTableTableManager
|
||||||
i0.GeneratedDatabase,
|
extends
|
||||||
i1.$MemoryAssetEntityTable,
|
i0.RootTableManager<
|
||||||
i1.MemoryAssetEntityData,
|
i0.GeneratedDatabase,
|
||||||
i1.$$MemoryAssetEntityTableFilterComposer,
|
i1.$MemoryAssetEntityTable,
|
||||||
i1.$$MemoryAssetEntityTableOrderingComposer,
|
i1.MemoryAssetEntityData,
|
||||||
i1.$$MemoryAssetEntityTableAnnotationComposer,
|
i1.$$MemoryAssetEntityTableFilterComposer,
|
||||||
$$MemoryAssetEntityTableCreateCompanionBuilder,
|
i1.$$MemoryAssetEntityTableOrderingComposer,
|
||||||
$$MemoryAssetEntityTableUpdateCompanionBuilder,
|
i1.$$MemoryAssetEntityTableAnnotationComposer,
|
||||||
(i1.MemoryAssetEntityData, i1.$$MemoryAssetEntityTableReferences),
|
$$MemoryAssetEntityTableCreateCompanionBuilder,
|
||||||
i1.MemoryAssetEntityData,
|
$$MemoryAssetEntityTableUpdateCompanionBuilder,
|
||||||
i0.PrefetchHooks Function({bool assetId, bool memoryId})> {
|
(i1.MemoryAssetEntityData, i1.$$MemoryAssetEntityTableReferences),
|
||||||
|
i1.MemoryAssetEntityData,
|
||||||
|
i0.PrefetchHooks Function({bool assetId, bool memoryId})
|
||||||
|
> {
|
||||||
$$MemoryAssetEntityTableTableManager(
|
$$MemoryAssetEntityTableTableManager(
|
||||||
i0.GeneratedDatabase db, i1.$MemoryAssetEntityTable table)
|
i0.GeneratedDatabase db,
|
||||||
: super(i0.TableManagerState(
|
i1.$MemoryAssetEntityTable table,
|
||||||
|
) : super(
|
||||||
|
i0.TableManagerState(
|
||||||
db: db,
|
db: db,
|
||||||
table: table,
|
table: table,
|
||||||
createFilteringComposer: () =>
|
createFilteringComposer: () =>
|
||||||
|
|
@ -271,35 +322,38 @@ class $$MemoryAssetEntityTableTableManager extends i0.RootTableManager<
|
||||||
.$$MemoryAssetEntityTableOrderingComposer($db: db, $table: table),
|
.$$MemoryAssetEntityTableOrderingComposer($db: db, $table: table),
|
||||||
createComputedFieldComposer: () =>
|
createComputedFieldComposer: () =>
|
||||||
i1.$$MemoryAssetEntityTableAnnotationComposer(
|
i1.$$MemoryAssetEntityTableAnnotationComposer(
|
||||||
$db: db, $table: table),
|
$db: db,
|
||||||
updateCompanionCallback: ({
|
$table: table,
|
||||||
i0.Value<String> assetId = const i0.Value.absent(),
|
),
|
||||||
i0.Value<String> memoryId = const i0.Value.absent(),
|
updateCompanionCallback:
|
||||||
}) =>
|
({
|
||||||
i1.MemoryAssetEntityCompanion(
|
i0.Value<String> assetId = const i0.Value.absent(),
|
||||||
assetId: assetId,
|
i0.Value<String> memoryId = const i0.Value.absent(),
|
||||||
memoryId: memoryId,
|
}) => i1.MemoryAssetEntityCompanion(
|
||||||
),
|
assetId: assetId,
|
||||||
createCompanionCallback: ({
|
memoryId: memoryId,
|
||||||
required String assetId,
|
),
|
||||||
required String memoryId,
|
createCompanionCallback:
|
||||||
}) =>
|
({required String assetId, required String memoryId}) =>
|
||||||
i1.MemoryAssetEntityCompanion.insert(
|
i1.MemoryAssetEntityCompanion.insert(
|
||||||
assetId: assetId,
|
assetId: assetId,
|
||||||
memoryId: memoryId,
|
memoryId: memoryId,
|
||||||
),
|
),
|
||||||
withReferenceMapper: (p0) => p0
|
withReferenceMapper: (p0) => p0
|
||||||
.map((e) => (
|
.map(
|
||||||
e.readTable(table),
|
(e) => (
|
||||||
i1.$$MemoryAssetEntityTableReferences(db, table, e)
|
e.readTable(table),
|
||||||
))
|
i1.$$MemoryAssetEntityTableReferences(db, table, e),
|
||||||
|
),
|
||||||
|
)
|
||||||
.toList(),
|
.toList(),
|
||||||
prefetchHooksCallback: ({assetId = false, memoryId = false}) {
|
prefetchHooksCallback: ({assetId = false, memoryId = false}) {
|
||||||
return i0.PrefetchHooks(
|
return i0.PrefetchHooks(
|
||||||
db: db,
|
db: db,
|
||||||
explicitlyWatchedTables: [],
|
explicitlyWatchedTables: [],
|
||||||
addJoins: <
|
addJoins:
|
||||||
T extends i0.TableManagerState<
|
<
|
||||||
|
T extends i0.TableManagerState<
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic,
|
dynamic,
|
||||||
|
|
@ -310,53 +364,65 @@ class $$MemoryAssetEntityTableTableManager extends i0.RootTableManager<
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic>>(state) {
|
dynamic
|
||||||
if (assetId) {
|
>
|
||||||
state = state.withJoin(
|
>(state) {
|
||||||
currentTable: table,
|
if (assetId) {
|
||||||
currentColumn: table.assetId,
|
state =
|
||||||
referencedTable:
|
state.withJoin(
|
||||||
i1.$$MemoryAssetEntityTableReferences._assetIdTable(db),
|
currentTable: table,
|
||||||
referencedColumn: i1.$$MemoryAssetEntityTableReferences
|
currentColumn: table.assetId,
|
||||||
._assetIdTable(db)
|
referencedTable: i1
|
||||||
.id,
|
.$$MemoryAssetEntityTableReferences
|
||||||
) as T;
|
._assetIdTable(db),
|
||||||
}
|
referencedColumn: i1
|
||||||
if (memoryId) {
|
.$$MemoryAssetEntityTableReferences
|
||||||
state = state.withJoin(
|
._assetIdTable(db)
|
||||||
currentTable: table,
|
.id,
|
||||||
currentColumn: table.memoryId,
|
)
|
||||||
referencedTable: i1.$$MemoryAssetEntityTableReferences
|
as T;
|
||||||
._memoryIdTable(db),
|
}
|
||||||
referencedColumn: i1.$$MemoryAssetEntityTableReferences
|
if (memoryId) {
|
||||||
._memoryIdTable(db)
|
state =
|
||||||
.id,
|
state.withJoin(
|
||||||
) as T;
|
currentTable: table,
|
||||||
}
|
currentColumn: table.memoryId,
|
||||||
|
referencedTable: i1
|
||||||
|
.$$MemoryAssetEntityTableReferences
|
||||||
|
._memoryIdTable(db),
|
||||||
|
referencedColumn: i1
|
||||||
|
.$$MemoryAssetEntityTableReferences
|
||||||
|
._memoryIdTable(db)
|
||||||
|
.id,
|
||||||
|
)
|
||||||
|
as T;
|
||||||
|
}
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
},
|
},
|
||||||
getPrefetchedDataCallback: (items) async {
|
getPrefetchedDataCallback: (items) async {
|
||||||
return [];
|
return [];
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
));
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef $$MemoryAssetEntityTableProcessedTableManager
|
typedef $$MemoryAssetEntityTableProcessedTableManager =
|
||||||
= i0.ProcessedTableManager<
|
i0.ProcessedTableManager<
|
||||||
i0.GeneratedDatabase,
|
i0.GeneratedDatabase,
|
||||||
i1.$MemoryAssetEntityTable,
|
i1.$MemoryAssetEntityTable,
|
||||||
i1.MemoryAssetEntityData,
|
i1.MemoryAssetEntityData,
|
||||||
i1.$$MemoryAssetEntityTableFilterComposer,
|
i1.$$MemoryAssetEntityTableFilterComposer,
|
||||||
i1.$$MemoryAssetEntityTableOrderingComposer,
|
i1.$$MemoryAssetEntityTableOrderingComposer,
|
||||||
i1.$$MemoryAssetEntityTableAnnotationComposer,
|
i1.$$MemoryAssetEntityTableAnnotationComposer,
|
||||||
$$MemoryAssetEntityTableCreateCompanionBuilder,
|
$$MemoryAssetEntityTableCreateCompanionBuilder,
|
||||||
$$MemoryAssetEntityTableUpdateCompanionBuilder,
|
$$MemoryAssetEntityTableUpdateCompanionBuilder,
|
||||||
(i1.MemoryAssetEntityData, i1.$$MemoryAssetEntityTableReferences),
|
(i1.MemoryAssetEntityData, i1.$$MemoryAssetEntityTableReferences),
|
||||||
i1.MemoryAssetEntityData,
|
i1.MemoryAssetEntityData,
|
||||||
i0.PrefetchHooks Function({bool assetId, bool memoryId})>;
|
i0.PrefetchHooks Function({bool assetId, bool memoryId})
|
||||||
|
>;
|
||||||
|
|
||||||
class $MemoryAssetEntityTable extends i2.MemoryAssetEntity
|
class $MemoryAssetEntityTable extends i2.MemoryAssetEntity
|
||||||
with i0.TableInfo<$MemoryAssetEntityTable, i1.MemoryAssetEntityData> {
|
with i0.TableInfo<$MemoryAssetEntityTable, i1.MemoryAssetEntityData> {
|
||||||
|
|
@ -364,24 +430,34 @@ class $MemoryAssetEntityTable extends i2.MemoryAssetEntity
|
||||||
final i0.GeneratedDatabase attachedDatabase;
|
final i0.GeneratedDatabase attachedDatabase;
|
||||||
final String? _alias;
|
final String? _alias;
|
||||||
$MemoryAssetEntityTable(this.attachedDatabase, [this._alias]);
|
$MemoryAssetEntityTable(this.attachedDatabase, [this._alias]);
|
||||||
static const i0.VerificationMeta _assetIdMeta =
|
static const i0.VerificationMeta _assetIdMeta = const i0.VerificationMeta(
|
||||||
const i0.VerificationMeta('assetId');
|
'assetId',
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumn<String> assetId = i0.GeneratedColumn<String>(
|
late final i0.GeneratedColumn<String> assetId = i0.GeneratedColumn<String>(
|
||||||
'asset_id', aliasedName, false,
|
'asset_id',
|
||||||
type: i0.DriftSqlType.string,
|
aliasedName,
|
||||||
requiredDuringInsert: true,
|
false,
|
||||||
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
|
type: i0.DriftSqlType.string,
|
||||||
'REFERENCES remote_asset_entity (id) ON DELETE CASCADE'));
|
requiredDuringInsert: true,
|
||||||
static const i0.VerificationMeta _memoryIdMeta =
|
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
|
||||||
const i0.VerificationMeta('memoryId');
|
'REFERENCES remote_asset_entity (id) ON DELETE CASCADE',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
static const i0.VerificationMeta _memoryIdMeta = const i0.VerificationMeta(
|
||||||
|
'memoryId',
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumn<String> memoryId = i0.GeneratedColumn<String>(
|
late final i0.GeneratedColumn<String> memoryId = i0.GeneratedColumn<String>(
|
||||||
'memory_id', aliasedName, false,
|
'memory_id',
|
||||||
type: i0.DriftSqlType.string,
|
aliasedName,
|
||||||
requiredDuringInsert: true,
|
false,
|
||||||
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
|
type: i0.DriftSqlType.string,
|
||||||
'REFERENCES memory_entity (id) ON DELETE CASCADE'));
|
requiredDuringInsert: true,
|
||||||
|
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
|
||||||
|
'REFERENCES memory_entity (id) ON DELETE CASCADE',
|
||||||
|
),
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
List<i0.GeneratedColumn> get $columns => [assetId, memoryId];
|
List<i0.GeneratedColumn> get $columns => [assetId, memoryId];
|
||||||
@override
|
@override
|
||||||
|
|
@ -391,19 +467,24 @@ class $MemoryAssetEntityTable extends i2.MemoryAssetEntity
|
||||||
static const String $name = 'memory_asset_entity';
|
static const String $name = 'memory_asset_entity';
|
||||||
@override
|
@override
|
||||||
i0.VerificationContext validateIntegrity(
|
i0.VerificationContext validateIntegrity(
|
||||||
i0.Insertable<i1.MemoryAssetEntityData> instance,
|
i0.Insertable<i1.MemoryAssetEntityData> instance, {
|
||||||
{bool isInserting = false}) {
|
bool isInserting = false,
|
||||||
|
}) {
|
||||||
final context = i0.VerificationContext();
|
final context = i0.VerificationContext();
|
||||||
final data = instance.toColumns(true);
|
final data = instance.toColumns(true);
|
||||||
if (data.containsKey('asset_id')) {
|
if (data.containsKey('asset_id')) {
|
||||||
context.handle(_assetIdMeta,
|
context.handle(
|
||||||
assetId.isAcceptableOrUnknown(data['asset_id']!, _assetIdMeta));
|
_assetIdMeta,
|
||||||
|
assetId.isAcceptableOrUnknown(data['asset_id']!, _assetIdMeta),
|
||||||
|
);
|
||||||
} else if (isInserting) {
|
} else if (isInserting) {
|
||||||
context.missing(_assetIdMeta);
|
context.missing(_assetIdMeta);
|
||||||
}
|
}
|
||||||
if (data.containsKey('memory_id')) {
|
if (data.containsKey('memory_id')) {
|
||||||
context.handle(_memoryIdMeta,
|
context.handle(
|
||||||
memoryId.isAcceptableOrUnknown(data['memory_id']!, _memoryIdMeta));
|
_memoryIdMeta,
|
||||||
|
memoryId.isAcceptableOrUnknown(data['memory_id']!, _memoryIdMeta),
|
||||||
|
);
|
||||||
} else if (isInserting) {
|
} else if (isInserting) {
|
||||||
context.missing(_memoryIdMeta);
|
context.missing(_memoryIdMeta);
|
||||||
}
|
}
|
||||||
|
|
@ -413,14 +494,20 @@ class $MemoryAssetEntityTable extends i2.MemoryAssetEntity
|
||||||
@override
|
@override
|
||||||
Set<i0.GeneratedColumn> get $primaryKey => {assetId, memoryId};
|
Set<i0.GeneratedColumn> get $primaryKey => {assetId, memoryId};
|
||||||
@override
|
@override
|
||||||
i1.MemoryAssetEntityData map(Map<String, dynamic> data,
|
i1.MemoryAssetEntityData map(
|
||||||
{String? tablePrefix}) {
|
Map<String, dynamic> data, {
|
||||||
|
String? tablePrefix,
|
||||||
|
}) {
|
||||||
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
||||||
return i1.MemoryAssetEntityData(
|
return i1.MemoryAssetEntityData(
|
||||||
assetId: attachedDatabase.typeMapping
|
assetId: attachedDatabase.typeMapping.read(
|
||||||
.read(i0.DriftSqlType.string, data['${effectivePrefix}asset_id'])!,
|
i0.DriftSqlType.string,
|
||||||
memoryId: attachedDatabase.typeMapping
|
data['${effectivePrefix}asset_id'],
|
||||||
.read(i0.DriftSqlType.string, data['${effectivePrefix}memory_id'])!,
|
)!,
|
||||||
|
memoryId: attachedDatabase.typeMapping.read(
|
||||||
|
i0.DriftSqlType.string,
|
||||||
|
data['${effectivePrefix}memory_id'],
|
||||||
|
)!,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -448,8 +535,10 @@ class MemoryAssetEntityData extends i0.DataClass
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
factory MemoryAssetEntityData.fromJson(Map<String, dynamic> json,
|
factory MemoryAssetEntityData.fromJson(
|
||||||
{i0.ValueSerializer? serializer}) {
|
Map<String, dynamic> json, {
|
||||||
|
i0.ValueSerializer? serializer,
|
||||||
|
}) {
|
||||||
serializer ??= i0.driftRuntimeOptions.defaultSerializer;
|
serializer ??= i0.driftRuntimeOptions.defaultSerializer;
|
||||||
return MemoryAssetEntityData(
|
return MemoryAssetEntityData(
|
||||||
assetId: serializer.fromJson<String>(json['assetId']),
|
assetId: serializer.fromJson<String>(json['assetId']),
|
||||||
|
|
@ -507,8 +596,8 @@ class MemoryAssetEntityCompanion
|
||||||
MemoryAssetEntityCompanion.insert({
|
MemoryAssetEntityCompanion.insert({
|
||||||
required String assetId,
|
required String assetId,
|
||||||
required String memoryId,
|
required String memoryId,
|
||||||
}) : assetId = i0.Value(assetId),
|
}) : assetId = i0.Value(assetId),
|
||||||
memoryId = i0.Value(memoryId);
|
memoryId = i0.Value(memoryId);
|
||||||
static i0.Insertable<i1.MemoryAssetEntityData> custom({
|
static i0.Insertable<i1.MemoryAssetEntityData> custom({
|
||||||
i0.Expression<String>? assetId,
|
i0.Expression<String>? assetId,
|
||||||
i0.Expression<String>? memoryId,
|
i0.Expression<String>? memoryId,
|
||||||
|
|
@ -519,8 +608,10 @@ class MemoryAssetEntityCompanion
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
i1.MemoryAssetEntityCompanion copyWith(
|
i1.MemoryAssetEntityCompanion copyWith({
|
||||||
{i0.Value<String>? assetId, i0.Value<String>? memoryId}) {
|
i0.Value<String>? assetId,
|
||||||
|
i0.Value<String>? memoryId,
|
||||||
|
}) {
|
||||||
return i1.MemoryAssetEntityCompanion(
|
return i1.MemoryAssetEntityCompanion(
|
||||||
assetId: assetId ?? this.assetId,
|
assetId: assetId ?? this.assetId,
|
||||||
memoryId: memoryId ?? this.memoryId,
|
memoryId: memoryId ?? this.memoryId,
|
||||||
|
|
|
||||||
|
|
@ -16,87 +16,100 @@ import 'package:immich_mobile/infrastructure/entities/local_album.entity.drift.d
|
||||||
|
|
||||||
class MergedAssetDrift extends i1.ModularAccessor {
|
class MergedAssetDrift extends i1.ModularAccessor {
|
||||||
MergedAssetDrift(i0.GeneratedDatabase db) : super(db);
|
MergedAssetDrift(i0.GeneratedDatabase db) : super(db);
|
||||||
i0.Selectable<MergedAssetResult> mergedAsset(List<String> var1,
|
i0.Selectable<MergedAssetResult> mergedAsset(
|
||||||
{required MergedAsset$limit limit}) {
|
List<String> var1, {
|
||||||
|
required MergedAsset$limit limit,
|
||||||
|
}) {
|
||||||
var $arrayStartIndex = 1;
|
var $arrayStartIndex = 1;
|
||||||
final expandedvar1 = $expandVar($arrayStartIndex, var1.length);
|
final expandedvar1 = $expandVar($arrayStartIndex, var1.length);
|
||||||
$arrayStartIndex += var1.length;
|
$arrayStartIndex += var1.length;
|
||||||
final generatedlimit = $write(limit(alias(this.localAssetEntity, 'lae')),
|
final generatedlimit = $write(
|
||||||
startIndex: $arrayStartIndex);
|
limit(alias(this.localAssetEntity, 'lae')),
|
||||||
|
startIndex: $arrayStartIndex,
|
||||||
|
);
|
||||||
$arrayStartIndex += generatedlimit.amountOfVariables;
|
$arrayStartIndex += generatedlimit.amountOfVariables;
|
||||||
return customSelect(
|
return customSelect(
|
||||||
'SELECT rae.id AS remote_id, (SELECT lae.id FROM local_asset_entity AS lae WHERE lae.checksum = rae.checksum LIMIT 1) AS local_id, rae.name, rae.type, rae.created_at AS created_at, rae.updated_at, rae.width, rae.height, rae.duration_in_seconds, rae.is_favorite, rae.thumb_hash, rae.checksum, rae.owner_id, rae.live_photo_video_id, 0 AS orientation, rae.stack_id FROM remote_asset_entity AS rae LEFT JOIN stack_entity AS se ON rae.stack_id = se.id WHERE rae.deleted_at IS NULL AND rae.visibility = 0 AND rae.owner_id IN ($expandedvar1) AND(rae.stack_id IS NULL OR rae.id = se.primary_asset_id)UNION ALL SELECT NULL AS remote_id, lae.id AS local_id, lae.name, lae.type, lae.created_at AS created_at, lae.updated_at, lae.width, lae.height, lae.duration_in_seconds, lae.is_favorite, NULL AS thumb_hash, lae.checksum, NULL AS owner_id, NULL AS live_photo_video_id, lae.orientation, NULL AS stack_id FROM local_asset_entity AS lae WHERE NOT EXISTS (SELECT 1 FROM remote_asset_entity AS rae WHERE rae.checksum = lae.checksum) AND EXISTS (SELECT 1 FROM local_album_asset_entity AS laa INNER JOIN local_album_entity AS la ON laa.album_id = la.id WHERE laa.asset_id = lae.id AND la.backup_selection = 0) ORDER BY created_at DESC ${generatedlimit.sql}',
|
'SELECT rae.id AS remote_id, (SELECT lae.id FROM local_asset_entity AS lae WHERE lae.checksum = rae.checksum LIMIT 1) AS local_id, rae.name, rae.type, rae.created_at AS created_at, rae.updated_at, rae.width, rae.height, rae.duration_in_seconds, rae.is_favorite, rae.thumb_hash, rae.checksum, rae.owner_id, rae.live_photo_video_id, 0 AS orientation, rae.stack_id FROM remote_asset_entity AS rae LEFT JOIN stack_entity AS se ON rae.stack_id = se.id WHERE rae.deleted_at IS NULL AND rae.visibility = 0 AND rae.owner_id IN ($expandedvar1) AND(rae.stack_id IS NULL OR rae.id = se.primary_asset_id)UNION ALL SELECT NULL AS remote_id, lae.id AS local_id, lae.name, lae.type, lae.created_at AS created_at, lae.updated_at, lae.width, lae.height, lae.duration_in_seconds, lae.is_favorite, NULL AS thumb_hash, lae.checksum, NULL AS owner_id, NULL AS live_photo_video_id, lae.orientation, NULL AS stack_id FROM local_asset_entity AS lae WHERE NOT EXISTS (SELECT 1 FROM remote_asset_entity AS rae WHERE rae.checksum = lae.checksum) AND EXISTS (SELECT 1 FROM local_album_asset_entity AS laa INNER JOIN local_album_entity AS la ON laa.album_id = la.id WHERE laa.asset_id = lae.id AND la.backup_selection = 0) ORDER BY created_at DESC ${generatedlimit.sql}',
|
||||||
variables: [
|
variables: [
|
||||||
for (var $ in var1) i0.Variable<String>($),
|
for (var $ in var1) i0.Variable<String>($),
|
||||||
...generatedlimit.introducedVariables
|
...generatedlimit.introducedVariables,
|
||||||
],
|
],
|
||||||
readsFrom: {
|
readsFrom: {
|
||||||
remoteAssetEntity,
|
remoteAssetEntity,
|
||||||
localAssetEntity,
|
localAssetEntity,
|
||||||
stackEntity,
|
stackEntity,
|
||||||
localAlbumAssetEntity,
|
localAlbumAssetEntity,
|
||||||
localAlbumEntity,
|
localAlbumEntity,
|
||||||
...generatedlimit.watchedTables,
|
...generatedlimit.watchedTables,
|
||||||
}).map((i0.QueryRow row) => MergedAssetResult(
|
},
|
||||||
remoteId: row.readNullable<String>('remote_id'),
|
).map(
|
||||||
localId: row.readNullable<String>('local_id'),
|
(i0.QueryRow row) => MergedAssetResult(
|
||||||
name: row.read<String>('name'),
|
remoteId: row.readNullable<String>('remote_id'),
|
||||||
type: i4.$RemoteAssetEntityTable.$convertertype
|
localId: row.readNullable<String>('local_id'),
|
||||||
.fromSql(row.read<int>('type')),
|
name: row.read<String>('name'),
|
||||||
createdAt: row.read<DateTime>('created_at'),
|
type: i4.$RemoteAssetEntityTable.$convertertype.fromSql(
|
||||||
updatedAt: row.read<DateTime>('updated_at'),
|
row.read<int>('type'),
|
||||||
width: row.readNullable<int>('width'),
|
),
|
||||||
height: row.readNullable<int>('height'),
|
createdAt: row.read<DateTime>('created_at'),
|
||||||
durationInSeconds: row.readNullable<int>('duration_in_seconds'),
|
updatedAt: row.read<DateTime>('updated_at'),
|
||||||
isFavorite: row.read<bool>('is_favorite'),
|
width: row.readNullable<int>('width'),
|
||||||
thumbHash: row.readNullable<String>('thumb_hash'),
|
height: row.readNullable<int>('height'),
|
||||||
checksum: row.readNullable<String>('checksum'),
|
durationInSeconds: row.readNullable<int>('duration_in_seconds'),
|
||||||
ownerId: row.readNullable<String>('owner_id'),
|
isFavorite: row.read<bool>('is_favorite'),
|
||||||
livePhotoVideoId: row.readNullable<String>('live_photo_video_id'),
|
thumbHash: row.readNullable<String>('thumb_hash'),
|
||||||
orientation: row.read<int>('orientation'),
|
checksum: row.readNullable<String>('checksum'),
|
||||||
stackId: row.readNullable<String>('stack_id'),
|
ownerId: row.readNullable<String>('owner_id'),
|
||||||
));
|
livePhotoVideoId: row.readNullable<String>('live_photo_video_id'),
|
||||||
|
orientation: row.read<int>('orientation'),
|
||||||
|
stackId: row.readNullable<String>('stack_id'),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
i0.Selectable<MergedBucketResult> mergedBucket(List<String> var2,
|
i0.Selectable<MergedBucketResult> mergedBucket(
|
||||||
{required int groupBy}) {
|
List<String> var2, {
|
||||||
|
required int groupBy,
|
||||||
|
}) {
|
||||||
var $arrayStartIndex = 2;
|
var $arrayStartIndex = 2;
|
||||||
final expandedvar2 = $expandVar($arrayStartIndex, var2.length);
|
final expandedvar2 = $expandVar($arrayStartIndex, var2.length);
|
||||||
$arrayStartIndex += var2.length;
|
$arrayStartIndex += var2.length;
|
||||||
return customSelect(
|
return customSelect(
|
||||||
'SELECT COUNT(*) AS asset_count, CASE WHEN ?1 = 0 THEN STRFTIME(\'%Y-%m-%d\', created_at, \'localtime\') WHEN ?1 = 1 THEN STRFTIME(\'%Y-%m\', created_at, \'localtime\') END AS bucket_date FROM (SELECT rae.created_at FROM remote_asset_entity AS rae LEFT JOIN stack_entity AS se ON rae.stack_id = se.id WHERE rae.deleted_at IS NULL AND rae.visibility = 0 AND rae.owner_id IN ($expandedvar2) AND(rae.stack_id IS NULL OR rae.id = se.primary_asset_id)UNION ALL SELECT lae.created_at FROM local_asset_entity AS lae LEFT JOIN remote_asset_entity AS rae ON rae.checksum = lae.checksum LEFT JOIN local_album_asset_entity AS laa ON laa.asset_id = lae.id LEFT JOIN local_album_entity AS la ON la.id = laa.album_id WHERE rae.id IS NULL AND la.backup_selection = 0) GROUP BY bucket_date ORDER BY bucket_date DESC',
|
'SELECT COUNT(*) AS asset_count, CASE WHEN ?1 = 0 THEN STRFTIME(\'%Y-%m-%d\', created_at, \'localtime\') WHEN ?1 = 1 THEN STRFTIME(\'%Y-%m\', created_at, \'localtime\') END AS bucket_date FROM (SELECT rae.created_at FROM remote_asset_entity AS rae LEFT JOIN stack_entity AS se ON rae.stack_id = se.id WHERE rae.deleted_at IS NULL AND rae.visibility = 0 AND rae.owner_id IN ($expandedvar2) AND(rae.stack_id IS NULL OR rae.id = se.primary_asset_id)UNION ALL SELECT lae.created_at FROM local_asset_entity AS lae LEFT JOIN remote_asset_entity AS rae ON rae.checksum = lae.checksum LEFT JOIN local_album_asset_entity AS laa ON laa.asset_id = lae.id LEFT JOIN local_album_entity AS la ON la.id = laa.album_id WHERE rae.id IS NULL AND la.backup_selection = 0) GROUP BY bucket_date ORDER BY bucket_date DESC',
|
||||||
variables: [
|
variables: [
|
||||||
i0.Variable<int>(groupBy),
|
i0.Variable<int>(groupBy),
|
||||||
for (var $ in var2) i0.Variable<String>($)
|
for (var $ in var2) i0.Variable<String>($),
|
||||||
],
|
],
|
||||||
readsFrom: {
|
readsFrom: {
|
||||||
remoteAssetEntity,
|
remoteAssetEntity,
|
||||||
stackEntity,
|
stackEntity,
|
||||||
localAssetEntity,
|
localAssetEntity,
|
||||||
localAlbumAssetEntity,
|
localAlbumAssetEntity,
|
||||||
localAlbumEntity,
|
localAlbumEntity,
|
||||||
}).map((i0.QueryRow row) => MergedBucketResult(
|
},
|
||||||
assetCount: row.read<int>('asset_count'),
|
).map(
|
||||||
bucketDate: row.read<String>('bucket_date'),
|
(i0.QueryRow row) => MergedBucketResult(
|
||||||
));
|
assetCount: row.read<int>('asset_count'),
|
||||||
|
bucketDate: row.read<String>('bucket_date'),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
i4.$RemoteAssetEntityTable get remoteAssetEntity =>
|
i4.$RemoteAssetEntityTable get remoteAssetEntity => i1.ReadDatabaseContainer(
|
||||||
i1.ReadDatabaseContainer(attachedDatabase)
|
attachedDatabase,
|
||||||
.resultSet<i4.$RemoteAssetEntityTable>('remote_asset_entity');
|
).resultSet<i4.$RemoteAssetEntityTable>('remote_asset_entity');
|
||||||
i5.$StackEntityTable get stackEntity =>
|
i5.$StackEntityTable get stackEntity => i1.ReadDatabaseContainer(
|
||||||
i1.ReadDatabaseContainer(attachedDatabase)
|
attachedDatabase,
|
||||||
.resultSet<i5.$StackEntityTable>('stack_entity');
|
).resultSet<i5.$StackEntityTable>('stack_entity');
|
||||||
i3.$LocalAssetEntityTable get localAssetEntity =>
|
i3.$LocalAssetEntityTable get localAssetEntity => i1.ReadDatabaseContainer(
|
||||||
i1.ReadDatabaseContainer(attachedDatabase)
|
attachedDatabase,
|
||||||
.resultSet<i3.$LocalAssetEntityTable>('local_asset_entity');
|
).resultSet<i3.$LocalAssetEntityTable>('local_asset_entity');
|
||||||
i6.$LocalAlbumAssetEntityTable get localAlbumAssetEntity =>
|
i6.$LocalAlbumAssetEntityTable get localAlbumAssetEntity =>
|
||||||
i1.ReadDatabaseContainer(attachedDatabase)
|
i1.ReadDatabaseContainer(
|
||||||
.resultSet<i6.$LocalAlbumAssetEntityTable>(
|
attachedDatabase,
|
||||||
'local_album_asset_entity');
|
).resultSet<i6.$LocalAlbumAssetEntityTable>('local_album_asset_entity');
|
||||||
i7.$LocalAlbumEntityTable get localAlbumEntity =>
|
i7.$LocalAlbumEntityTable get localAlbumEntity => i1.ReadDatabaseContainer(
|
||||||
i1.ReadDatabaseContainer(attachedDatabase)
|
attachedDatabase,
|
||||||
.resultSet<i7.$LocalAlbumEntityTable>('local_album_entity');
|
).resultSet<i7.$LocalAlbumEntityTable>('local_album_entity');
|
||||||
}
|
}
|
||||||
|
|
||||||
class MergedAssetResult {
|
class MergedAssetResult {
|
||||||
|
|
@ -141,8 +154,5 @@ typedef MergedAsset$limit = i0.Limit Function(i3.$LocalAssetEntityTable lae);
|
||||||
class MergedBucketResult {
|
class MergedBucketResult {
|
||||||
final int assetCount;
|
final int assetCount;
|
||||||
final String bucketDate;
|
final String bucketDate;
|
||||||
MergedBucketResult({
|
MergedBucketResult({required this.assetCount, required this.bucketDate});
|
||||||
required this.assetCount,
|
|
||||||
required this.bucketDate,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,74 +10,94 @@ import 'package:immich_mobile/infrastructure/entities/user.entity.drift.dart'
|
||||||
as i4;
|
as i4;
|
||||||
import 'package:drift/internal/modular.dart' as i5;
|
import 'package:drift/internal/modular.dart' as i5;
|
||||||
|
|
||||||
typedef $$PartnerEntityTableCreateCompanionBuilder = i1.PartnerEntityCompanion
|
typedef $$PartnerEntityTableCreateCompanionBuilder =
|
||||||
Function({
|
i1.PartnerEntityCompanion Function({
|
||||||
required String sharedById,
|
required String sharedById,
|
||||||
required String sharedWithId,
|
required String sharedWithId,
|
||||||
i0.Value<bool> inTimeline,
|
i0.Value<bool> inTimeline,
|
||||||
});
|
});
|
||||||
typedef $$PartnerEntityTableUpdateCompanionBuilder = i1.PartnerEntityCompanion
|
typedef $$PartnerEntityTableUpdateCompanionBuilder =
|
||||||
Function({
|
i1.PartnerEntityCompanion Function({
|
||||||
i0.Value<String> sharedById,
|
i0.Value<String> sharedById,
|
||||||
i0.Value<String> sharedWithId,
|
i0.Value<String> sharedWithId,
|
||||||
i0.Value<bool> inTimeline,
|
i0.Value<bool> inTimeline,
|
||||||
});
|
});
|
||||||
|
|
||||||
final class $$PartnerEntityTableReferences extends i0.BaseReferences<
|
final class $$PartnerEntityTableReferences
|
||||||
i0.GeneratedDatabase, i1.$PartnerEntityTable, i1.PartnerEntityData> {
|
extends
|
||||||
|
i0.BaseReferences<
|
||||||
|
i0.GeneratedDatabase,
|
||||||
|
i1.$PartnerEntityTable,
|
||||||
|
i1.PartnerEntityData
|
||||||
|
> {
|
||||||
$$PartnerEntityTableReferences(
|
$$PartnerEntityTableReferences(
|
||||||
super.$_db, super.$_table, super.$_typedResult);
|
super.$_db,
|
||||||
|
super.$_table,
|
||||||
|
super.$_typedResult,
|
||||||
|
);
|
||||||
|
|
||||||
static i4.$UserEntityTable _sharedByIdTable(i0.GeneratedDatabase db) =>
|
static i4.$UserEntityTable _sharedByIdTable(i0.GeneratedDatabase db) =>
|
||||||
i5.ReadDatabaseContainer(db)
|
i5.ReadDatabaseContainer(db)
|
||||||
.resultSet<i4.$UserEntityTable>('user_entity')
|
.resultSet<i4.$UserEntityTable>('user_entity')
|
||||||
.createAlias(i0.$_aliasNameGenerator(
|
.createAlias(
|
||||||
i5.ReadDatabaseContainer(db)
|
i0.$_aliasNameGenerator(
|
||||||
.resultSet<i1.$PartnerEntityTable>('partner_entity')
|
i5.ReadDatabaseContainer(
|
||||||
.sharedById,
|
db,
|
||||||
i5.ReadDatabaseContainer(db)
|
).resultSet<i1.$PartnerEntityTable>('partner_entity').sharedById,
|
||||||
.resultSet<i4.$UserEntityTable>('user_entity')
|
i5.ReadDatabaseContainer(
|
||||||
.id));
|
db,
|
||||||
|
).resultSet<i4.$UserEntityTable>('user_entity').id,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
i4.$$UserEntityTableProcessedTableManager get sharedById {
|
i4.$$UserEntityTableProcessedTableManager get sharedById {
|
||||||
final $_column = $_itemColumn<String>('shared_by_id')!;
|
final $_column = $_itemColumn<String>('shared_by_id')!;
|
||||||
|
|
||||||
final manager = i4
|
final manager = i4
|
||||||
.$$UserEntityTableTableManager(
|
.$$UserEntityTableTableManager(
|
||||||
|
$_db,
|
||||||
|
i5.ReadDatabaseContainer(
|
||||||
$_db,
|
$_db,
|
||||||
i5.ReadDatabaseContainer($_db)
|
).resultSet<i4.$UserEntityTable>('user_entity'),
|
||||||
.resultSet<i4.$UserEntityTable>('user_entity'))
|
)
|
||||||
.filter((f) => f.id.sqlEquals($_column));
|
.filter((f) => f.id.sqlEquals($_column));
|
||||||
final item = $_typedResult.readTableOrNull(_sharedByIdTable($_db));
|
final item = $_typedResult.readTableOrNull(_sharedByIdTable($_db));
|
||||||
if (item == null) return manager;
|
if (item == null) return manager;
|
||||||
return i0.ProcessedTableManager(
|
return i0.ProcessedTableManager(
|
||||||
manager.$state.copyWith(prefetchedData: [item]));
|
manager.$state.copyWith(prefetchedData: [item]),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static i4.$UserEntityTable _sharedWithIdTable(i0.GeneratedDatabase db) =>
|
static i4.$UserEntityTable _sharedWithIdTable(i0.GeneratedDatabase db) =>
|
||||||
i5.ReadDatabaseContainer(db)
|
i5.ReadDatabaseContainer(db)
|
||||||
.resultSet<i4.$UserEntityTable>('user_entity')
|
.resultSet<i4.$UserEntityTable>('user_entity')
|
||||||
.createAlias(i0.$_aliasNameGenerator(
|
.createAlias(
|
||||||
|
i0.$_aliasNameGenerator(
|
||||||
i5.ReadDatabaseContainer(db)
|
i5.ReadDatabaseContainer(db)
|
||||||
.resultSet<i1.$PartnerEntityTable>('partner_entity')
|
.resultSet<i1.$PartnerEntityTable>('partner_entity')
|
||||||
.sharedWithId,
|
.sharedWithId,
|
||||||
i5.ReadDatabaseContainer(db)
|
i5.ReadDatabaseContainer(
|
||||||
.resultSet<i4.$UserEntityTable>('user_entity')
|
db,
|
||||||
.id));
|
).resultSet<i4.$UserEntityTable>('user_entity').id,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
i4.$$UserEntityTableProcessedTableManager get sharedWithId {
|
i4.$$UserEntityTableProcessedTableManager get sharedWithId {
|
||||||
final $_column = $_itemColumn<String>('shared_with_id')!;
|
final $_column = $_itemColumn<String>('shared_with_id')!;
|
||||||
|
|
||||||
final manager = i4
|
final manager = i4
|
||||||
.$$UserEntityTableTableManager(
|
.$$UserEntityTableTableManager(
|
||||||
|
$_db,
|
||||||
|
i5.ReadDatabaseContainer(
|
||||||
$_db,
|
$_db,
|
||||||
i5.ReadDatabaseContainer($_db)
|
).resultSet<i4.$UserEntityTable>('user_entity'),
|
||||||
.resultSet<i4.$UserEntityTable>('user_entity'))
|
)
|
||||||
.filter((f) => f.id.sqlEquals($_column));
|
.filter((f) => f.id.sqlEquals($_column));
|
||||||
final item = $_typedResult.readTableOrNull(_sharedWithIdTable($_db));
|
final item = $_typedResult.readTableOrNull(_sharedWithIdTable($_db));
|
||||||
if (item == null) return manager;
|
if (item == null) return manager;
|
||||||
return i0.ProcessedTableManager(
|
return i0.ProcessedTableManager(
|
||||||
manager.$state.copyWith(prefetchedData: [item]));
|
manager.$state.copyWith(prefetchedData: [item]),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -91,49 +111,61 @@ class $$PartnerEntityTableFilterComposer
|
||||||
super.$removeJoinBuilderFromRootComposer,
|
super.$removeJoinBuilderFromRootComposer,
|
||||||
});
|
});
|
||||||
i0.ColumnFilters<bool> get inTimeline => $composableBuilder(
|
i0.ColumnFilters<bool> get inTimeline => $composableBuilder(
|
||||||
column: $table.inTimeline, builder: (column) => i0.ColumnFilters(column));
|
column: $table.inTimeline,
|
||||||
|
builder: (column) => i0.ColumnFilters(column),
|
||||||
|
);
|
||||||
|
|
||||||
i4.$$UserEntityTableFilterComposer get sharedById {
|
i4.$$UserEntityTableFilterComposer get sharedById {
|
||||||
final i4.$$UserEntityTableFilterComposer composer = $composerBuilder(
|
final i4.$$UserEntityTableFilterComposer composer = $composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.sharedById,
|
getCurrentColumn: (t) => t.sharedById,
|
||||||
referencedTable: i5.ReadDatabaseContainer($db)
|
referencedTable: i5.ReadDatabaseContainer(
|
||||||
.resultSet<i4.$UserEntityTable>('user_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i4.$UserEntityTable>('user_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i4.$$UserEntityTableFilterComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i5.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i4.$UserEntityTable>('user_entity'),
|
}) => i4.$$UserEntityTableFilterComposer(
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$db: $db,
|
||||||
joinBuilder: joinBuilder,
|
$table: i5.ReadDatabaseContainer(
|
||||||
$removeJoinBuilderFromRootComposer:
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer,
|
).resultSet<i4.$UserEntityTable>('user_entity'),
|
||||||
));
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
|
|
||||||
i4.$$UserEntityTableFilterComposer get sharedWithId {
|
i4.$$UserEntityTableFilterComposer get sharedWithId {
|
||||||
final i4.$$UserEntityTableFilterComposer composer = $composerBuilder(
|
final i4.$$UserEntityTableFilterComposer composer = $composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.sharedWithId,
|
getCurrentColumn: (t) => t.sharedWithId,
|
||||||
referencedTable: i5.ReadDatabaseContainer($db)
|
referencedTable: i5.ReadDatabaseContainer(
|
||||||
.resultSet<i4.$UserEntityTable>('user_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i4.$UserEntityTable>('user_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i4.$$UserEntityTableFilterComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i5.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i4.$UserEntityTable>('user_entity'),
|
}) => i4.$$UserEntityTableFilterComposer(
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$db: $db,
|
||||||
joinBuilder: joinBuilder,
|
$table: i5.ReadDatabaseContainer(
|
||||||
$removeJoinBuilderFromRootComposer:
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer,
|
).resultSet<i4.$UserEntityTable>('user_entity'),
|
||||||
));
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -148,50 +180,61 @@ class $$PartnerEntityTableOrderingComposer
|
||||||
super.$removeJoinBuilderFromRootComposer,
|
super.$removeJoinBuilderFromRootComposer,
|
||||||
});
|
});
|
||||||
i0.ColumnOrderings<bool> get inTimeline => $composableBuilder(
|
i0.ColumnOrderings<bool> get inTimeline => $composableBuilder(
|
||||||
column: $table.inTimeline,
|
column: $table.inTimeline,
|
||||||
builder: (column) => i0.ColumnOrderings(column));
|
builder: (column) => i0.ColumnOrderings(column),
|
||||||
|
);
|
||||||
|
|
||||||
i4.$$UserEntityTableOrderingComposer get sharedById {
|
i4.$$UserEntityTableOrderingComposer get sharedById {
|
||||||
final i4.$$UserEntityTableOrderingComposer composer = $composerBuilder(
|
final i4.$$UserEntityTableOrderingComposer composer = $composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.sharedById,
|
getCurrentColumn: (t) => t.sharedById,
|
||||||
referencedTable: i5.ReadDatabaseContainer($db)
|
referencedTable: i5.ReadDatabaseContainer(
|
||||||
.resultSet<i4.$UserEntityTable>('user_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i4.$UserEntityTable>('user_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i4.$$UserEntityTableOrderingComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i5.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i4.$UserEntityTable>('user_entity'),
|
}) => i4.$$UserEntityTableOrderingComposer(
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$db: $db,
|
||||||
joinBuilder: joinBuilder,
|
$table: i5.ReadDatabaseContainer(
|
||||||
$removeJoinBuilderFromRootComposer:
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer,
|
).resultSet<i4.$UserEntityTable>('user_entity'),
|
||||||
));
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
|
|
||||||
i4.$$UserEntityTableOrderingComposer get sharedWithId {
|
i4.$$UserEntityTableOrderingComposer get sharedWithId {
|
||||||
final i4.$$UserEntityTableOrderingComposer composer = $composerBuilder(
|
final i4.$$UserEntityTableOrderingComposer composer = $composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.sharedWithId,
|
getCurrentColumn: (t) => t.sharedWithId,
|
||||||
referencedTable: i5.ReadDatabaseContainer($db)
|
referencedTable: i5.ReadDatabaseContainer(
|
||||||
.resultSet<i4.$UserEntityTable>('user_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i4.$UserEntityTable>('user_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i4.$$UserEntityTableOrderingComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i5.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i4.$UserEntityTable>('user_entity'),
|
}) => i4.$$UserEntityTableOrderingComposer(
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$db: $db,
|
||||||
joinBuilder: joinBuilder,
|
$table: i5.ReadDatabaseContainer(
|
||||||
$removeJoinBuilderFromRootComposer:
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer,
|
).resultSet<i4.$UserEntityTable>('user_entity'),
|
||||||
));
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -206,68 +249,85 @@ class $$PartnerEntityTableAnnotationComposer
|
||||||
super.$removeJoinBuilderFromRootComposer,
|
super.$removeJoinBuilderFromRootComposer,
|
||||||
});
|
});
|
||||||
i0.GeneratedColumn<bool> get inTimeline => $composableBuilder(
|
i0.GeneratedColumn<bool> get inTimeline => $composableBuilder(
|
||||||
column: $table.inTimeline, builder: (column) => column);
|
column: $table.inTimeline,
|
||||||
|
builder: (column) => column,
|
||||||
|
);
|
||||||
|
|
||||||
i4.$$UserEntityTableAnnotationComposer get sharedById {
|
i4.$$UserEntityTableAnnotationComposer get sharedById {
|
||||||
final i4.$$UserEntityTableAnnotationComposer composer = $composerBuilder(
|
final i4.$$UserEntityTableAnnotationComposer composer = $composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.sharedById,
|
getCurrentColumn: (t) => t.sharedById,
|
||||||
referencedTable: i5.ReadDatabaseContainer($db)
|
referencedTable: i5.ReadDatabaseContainer(
|
||||||
.resultSet<i4.$UserEntityTable>('user_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i4.$UserEntityTable>('user_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i4.$$UserEntityTableAnnotationComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i5.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i4.$UserEntityTable>('user_entity'),
|
}) => i4.$$UserEntityTableAnnotationComposer(
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$db: $db,
|
||||||
joinBuilder: joinBuilder,
|
$table: i5.ReadDatabaseContainer(
|
||||||
$removeJoinBuilderFromRootComposer:
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer,
|
).resultSet<i4.$UserEntityTable>('user_entity'),
|
||||||
));
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
|
|
||||||
i4.$$UserEntityTableAnnotationComposer get sharedWithId {
|
i4.$$UserEntityTableAnnotationComposer get sharedWithId {
|
||||||
final i4.$$UserEntityTableAnnotationComposer composer = $composerBuilder(
|
final i4.$$UserEntityTableAnnotationComposer composer = $composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.sharedWithId,
|
getCurrentColumn: (t) => t.sharedWithId,
|
||||||
referencedTable: i5.ReadDatabaseContainer($db)
|
referencedTable: i5.ReadDatabaseContainer(
|
||||||
.resultSet<i4.$UserEntityTable>('user_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i4.$UserEntityTable>('user_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i4.$$UserEntityTableAnnotationComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i5.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i4.$UserEntityTable>('user_entity'),
|
}) => i4.$$UserEntityTableAnnotationComposer(
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$db: $db,
|
||||||
joinBuilder: joinBuilder,
|
$table: i5.ReadDatabaseContainer(
|
||||||
$removeJoinBuilderFromRootComposer:
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer,
|
).resultSet<i4.$UserEntityTable>('user_entity'),
|
||||||
));
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class $$PartnerEntityTableTableManager extends i0.RootTableManager<
|
class $$PartnerEntityTableTableManager
|
||||||
i0.GeneratedDatabase,
|
extends
|
||||||
i1.$PartnerEntityTable,
|
i0.RootTableManager<
|
||||||
i1.PartnerEntityData,
|
i0.GeneratedDatabase,
|
||||||
i1.$$PartnerEntityTableFilterComposer,
|
i1.$PartnerEntityTable,
|
||||||
i1.$$PartnerEntityTableOrderingComposer,
|
i1.PartnerEntityData,
|
||||||
i1.$$PartnerEntityTableAnnotationComposer,
|
i1.$$PartnerEntityTableFilterComposer,
|
||||||
$$PartnerEntityTableCreateCompanionBuilder,
|
i1.$$PartnerEntityTableOrderingComposer,
|
||||||
$$PartnerEntityTableUpdateCompanionBuilder,
|
i1.$$PartnerEntityTableAnnotationComposer,
|
||||||
(i1.PartnerEntityData, i1.$$PartnerEntityTableReferences),
|
$$PartnerEntityTableCreateCompanionBuilder,
|
||||||
i1.PartnerEntityData,
|
$$PartnerEntityTableUpdateCompanionBuilder,
|
||||||
i0.PrefetchHooks Function({bool sharedById, bool sharedWithId})> {
|
(i1.PartnerEntityData, i1.$$PartnerEntityTableReferences),
|
||||||
|
i1.PartnerEntityData,
|
||||||
|
i0.PrefetchHooks Function({bool sharedById, bool sharedWithId})
|
||||||
|
> {
|
||||||
$$PartnerEntityTableTableManager(
|
$$PartnerEntityTableTableManager(
|
||||||
i0.GeneratedDatabase db, i1.$PartnerEntityTable table)
|
i0.GeneratedDatabase db,
|
||||||
: super(i0.TableManagerState(
|
i1.$PartnerEntityTable table,
|
||||||
|
) : super(
|
||||||
|
i0.TableManagerState(
|
||||||
db: db,
|
db: db,
|
||||||
table: table,
|
table: table,
|
||||||
createFilteringComposer: () =>
|
createFilteringComposer: () =>
|
||||||
|
|
@ -276,38 +336,41 @@ class $$PartnerEntityTableTableManager extends i0.RootTableManager<
|
||||||
i1.$$PartnerEntityTableOrderingComposer($db: db, $table: table),
|
i1.$$PartnerEntityTableOrderingComposer($db: db, $table: table),
|
||||||
createComputedFieldComposer: () =>
|
createComputedFieldComposer: () =>
|
||||||
i1.$$PartnerEntityTableAnnotationComposer($db: db, $table: table),
|
i1.$$PartnerEntityTableAnnotationComposer($db: db, $table: table),
|
||||||
updateCompanionCallback: ({
|
updateCompanionCallback:
|
||||||
i0.Value<String> sharedById = const i0.Value.absent(),
|
({
|
||||||
i0.Value<String> sharedWithId = const i0.Value.absent(),
|
i0.Value<String> sharedById = const i0.Value.absent(),
|
||||||
i0.Value<bool> inTimeline = const i0.Value.absent(),
|
i0.Value<String> sharedWithId = const i0.Value.absent(),
|
||||||
}) =>
|
i0.Value<bool> inTimeline = const i0.Value.absent(),
|
||||||
i1.PartnerEntityCompanion(
|
}) => i1.PartnerEntityCompanion(
|
||||||
sharedById: sharedById,
|
sharedById: sharedById,
|
||||||
sharedWithId: sharedWithId,
|
sharedWithId: sharedWithId,
|
||||||
inTimeline: inTimeline,
|
inTimeline: inTimeline,
|
||||||
),
|
),
|
||||||
createCompanionCallback: ({
|
createCompanionCallback:
|
||||||
required String sharedById,
|
({
|
||||||
required String sharedWithId,
|
required String sharedById,
|
||||||
i0.Value<bool> inTimeline = const i0.Value.absent(),
|
required String sharedWithId,
|
||||||
}) =>
|
i0.Value<bool> inTimeline = const i0.Value.absent(),
|
||||||
i1.PartnerEntityCompanion.insert(
|
}) => i1.PartnerEntityCompanion.insert(
|
||||||
sharedById: sharedById,
|
sharedById: sharedById,
|
||||||
sharedWithId: sharedWithId,
|
sharedWithId: sharedWithId,
|
||||||
inTimeline: inTimeline,
|
inTimeline: inTimeline,
|
||||||
),
|
),
|
||||||
withReferenceMapper: (p0) => p0
|
withReferenceMapper: (p0) => p0
|
||||||
.map((e) => (
|
.map(
|
||||||
e.readTable(table),
|
(e) => (
|
||||||
i1.$$PartnerEntityTableReferences(db, table, e)
|
e.readTable(table),
|
||||||
))
|
i1.$$PartnerEntityTableReferences(db, table, e),
|
||||||
|
),
|
||||||
|
)
|
||||||
.toList(),
|
.toList(),
|
||||||
prefetchHooksCallback: ({sharedById = false, sharedWithId = false}) {
|
prefetchHooksCallback: ({sharedById = false, sharedWithId = false}) {
|
||||||
return i0.PrefetchHooks(
|
return i0.PrefetchHooks(
|
||||||
db: db,
|
db: db,
|
||||||
explicitlyWatchedTables: [],
|
explicitlyWatchedTables: [],
|
||||||
addJoins: <
|
addJoins:
|
||||||
T extends i0.TableManagerState<
|
<
|
||||||
|
T extends i0.TableManagerState<
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic,
|
dynamic,
|
||||||
|
|
@ -318,52 +381,65 @@ class $$PartnerEntityTableTableManager extends i0.RootTableManager<
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic>>(state) {
|
dynamic
|
||||||
if (sharedById) {
|
>
|
||||||
state = state.withJoin(
|
>(state) {
|
||||||
currentTable: table,
|
if (sharedById) {
|
||||||
currentColumn: table.sharedById,
|
state =
|
||||||
referencedTable:
|
state.withJoin(
|
||||||
i1.$$PartnerEntityTableReferences._sharedByIdTable(db),
|
currentTable: table,
|
||||||
referencedColumn: i1.$$PartnerEntityTableReferences
|
currentColumn: table.sharedById,
|
||||||
._sharedByIdTable(db)
|
referencedTable: i1
|
||||||
.id,
|
.$$PartnerEntityTableReferences
|
||||||
) as T;
|
._sharedByIdTable(db),
|
||||||
}
|
referencedColumn: i1
|
||||||
if (sharedWithId) {
|
.$$PartnerEntityTableReferences
|
||||||
state = state.withJoin(
|
._sharedByIdTable(db)
|
||||||
currentTable: table,
|
.id,
|
||||||
currentColumn: table.sharedWithId,
|
)
|
||||||
referencedTable: i1.$$PartnerEntityTableReferences
|
as T;
|
||||||
._sharedWithIdTable(db),
|
}
|
||||||
referencedColumn: i1.$$PartnerEntityTableReferences
|
if (sharedWithId) {
|
||||||
._sharedWithIdTable(db)
|
state =
|
||||||
.id,
|
state.withJoin(
|
||||||
) as T;
|
currentTable: table,
|
||||||
}
|
currentColumn: table.sharedWithId,
|
||||||
|
referencedTable: i1
|
||||||
|
.$$PartnerEntityTableReferences
|
||||||
|
._sharedWithIdTable(db),
|
||||||
|
referencedColumn: i1
|
||||||
|
.$$PartnerEntityTableReferences
|
||||||
|
._sharedWithIdTable(db)
|
||||||
|
.id,
|
||||||
|
)
|
||||||
|
as T;
|
||||||
|
}
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
},
|
},
|
||||||
getPrefetchedDataCallback: (items) async {
|
getPrefetchedDataCallback: (items) async {
|
||||||
return [];
|
return [];
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
));
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef $$PartnerEntityTableProcessedTableManager = i0.ProcessedTableManager<
|
typedef $$PartnerEntityTableProcessedTableManager =
|
||||||
i0.GeneratedDatabase,
|
i0.ProcessedTableManager<
|
||||||
i1.$PartnerEntityTable,
|
i0.GeneratedDatabase,
|
||||||
i1.PartnerEntityData,
|
i1.$PartnerEntityTable,
|
||||||
i1.$$PartnerEntityTableFilterComposer,
|
i1.PartnerEntityData,
|
||||||
i1.$$PartnerEntityTableOrderingComposer,
|
i1.$$PartnerEntityTableFilterComposer,
|
||||||
i1.$$PartnerEntityTableAnnotationComposer,
|
i1.$$PartnerEntityTableOrderingComposer,
|
||||||
$$PartnerEntityTableCreateCompanionBuilder,
|
i1.$$PartnerEntityTableAnnotationComposer,
|
||||||
$$PartnerEntityTableUpdateCompanionBuilder,
|
$$PartnerEntityTableCreateCompanionBuilder,
|
||||||
(i1.PartnerEntityData, i1.$$PartnerEntityTableReferences),
|
$$PartnerEntityTableUpdateCompanionBuilder,
|
||||||
i1.PartnerEntityData,
|
(i1.PartnerEntityData, i1.$$PartnerEntityTableReferences),
|
||||||
i0.PrefetchHooks Function({bool sharedById, bool sharedWithId})>;
|
i1.PartnerEntityData,
|
||||||
|
i0.PrefetchHooks Function({bool sharedById, bool sharedWithId})
|
||||||
|
>;
|
||||||
|
|
||||||
class $PartnerEntityTable extends i2.PartnerEntity
|
class $PartnerEntityTable extends i2.PartnerEntity
|
||||||
with i0.TableInfo<$PartnerEntityTable, i1.PartnerEntityData> {
|
with i0.TableInfo<$PartnerEntityTable, i1.PartnerEntityData> {
|
||||||
|
|
@ -371,37 +447,55 @@ class $PartnerEntityTable extends i2.PartnerEntity
|
||||||
final i0.GeneratedDatabase attachedDatabase;
|
final i0.GeneratedDatabase attachedDatabase;
|
||||||
final String? _alias;
|
final String? _alias;
|
||||||
$PartnerEntityTable(this.attachedDatabase, [this._alias]);
|
$PartnerEntityTable(this.attachedDatabase, [this._alias]);
|
||||||
static const i0.VerificationMeta _sharedByIdMeta =
|
static const i0.VerificationMeta _sharedByIdMeta = const i0.VerificationMeta(
|
||||||
const i0.VerificationMeta('sharedById');
|
'sharedById',
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumn<String> sharedById = i0.GeneratedColumn<String>(
|
late final i0.GeneratedColumn<String> sharedById = i0.GeneratedColumn<String>(
|
||||||
'shared_by_id', aliasedName, false,
|
'shared_by_id',
|
||||||
type: i0.DriftSqlType.string,
|
aliasedName,
|
||||||
requiredDuringInsert: true,
|
false,
|
||||||
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
|
type: i0.DriftSqlType.string,
|
||||||
'REFERENCES user_entity (id) ON DELETE CASCADE'));
|
requiredDuringInsert: true,
|
||||||
|
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
|
||||||
|
'REFERENCES user_entity (id) ON DELETE CASCADE',
|
||||||
|
),
|
||||||
|
);
|
||||||
static const i0.VerificationMeta _sharedWithIdMeta =
|
static const i0.VerificationMeta _sharedWithIdMeta =
|
||||||
const i0.VerificationMeta('sharedWithId');
|
const i0.VerificationMeta('sharedWithId');
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumn<String> sharedWithId =
|
late final i0.GeneratedColumn<String> sharedWithId =
|
||||||
i0.GeneratedColumn<String>('shared_with_id', aliasedName, false,
|
i0.GeneratedColumn<String>(
|
||||||
type: i0.DriftSqlType.string,
|
'shared_with_id',
|
||||||
requiredDuringInsert: true,
|
aliasedName,
|
||||||
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
|
false,
|
||||||
'REFERENCES user_entity (id) ON DELETE CASCADE'));
|
type: i0.DriftSqlType.string,
|
||||||
static const i0.VerificationMeta _inTimelineMeta =
|
requiredDuringInsert: true,
|
||||||
const i0.VerificationMeta('inTimeline');
|
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
|
||||||
|
'REFERENCES user_entity (id) ON DELETE CASCADE',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
static const i0.VerificationMeta _inTimelineMeta = const i0.VerificationMeta(
|
||||||
|
'inTimeline',
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumn<bool> inTimeline = i0.GeneratedColumn<bool>(
|
late final i0.GeneratedColumn<bool> inTimeline = i0.GeneratedColumn<bool>(
|
||||||
'in_timeline', aliasedName, false,
|
'in_timeline',
|
||||||
type: i0.DriftSqlType.bool,
|
aliasedName,
|
||||||
requiredDuringInsert: false,
|
false,
|
||||||
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
|
type: i0.DriftSqlType.bool,
|
||||||
'CHECK ("in_timeline" IN (0, 1))'),
|
requiredDuringInsert: false,
|
||||||
defaultValue: const i3.Constant(false));
|
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
|
||||||
|
'CHECK ("in_timeline" IN (0, 1))',
|
||||||
|
),
|
||||||
|
defaultValue: const i3.Constant(false),
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
List<i0.GeneratedColumn> get $columns =>
|
List<i0.GeneratedColumn> get $columns => [
|
||||||
[sharedById, sharedWithId, inTimeline];
|
sharedById,
|
||||||
|
sharedWithId,
|
||||||
|
inTimeline,
|
||||||
|
];
|
||||||
@override
|
@override
|
||||||
String get aliasedName => _alias ?? actualTableName;
|
String get aliasedName => _alias ?? actualTableName;
|
||||||
@override
|
@override
|
||||||
|
|
@ -409,31 +503,38 @@ class $PartnerEntityTable extends i2.PartnerEntity
|
||||||
static const String $name = 'partner_entity';
|
static const String $name = 'partner_entity';
|
||||||
@override
|
@override
|
||||||
i0.VerificationContext validateIntegrity(
|
i0.VerificationContext validateIntegrity(
|
||||||
i0.Insertable<i1.PartnerEntityData> instance,
|
i0.Insertable<i1.PartnerEntityData> instance, {
|
||||||
{bool isInserting = false}) {
|
bool isInserting = false,
|
||||||
|
}) {
|
||||||
final context = i0.VerificationContext();
|
final context = i0.VerificationContext();
|
||||||
final data = instance.toColumns(true);
|
final data = instance.toColumns(true);
|
||||||
if (data.containsKey('shared_by_id')) {
|
if (data.containsKey('shared_by_id')) {
|
||||||
context.handle(
|
context.handle(
|
||||||
|
_sharedByIdMeta,
|
||||||
|
sharedById.isAcceptableOrUnknown(
|
||||||
|
data['shared_by_id']!,
|
||||||
_sharedByIdMeta,
|
_sharedByIdMeta,
|
||||||
sharedById.isAcceptableOrUnknown(
|
),
|
||||||
data['shared_by_id']!, _sharedByIdMeta));
|
);
|
||||||
} else if (isInserting) {
|
} else if (isInserting) {
|
||||||
context.missing(_sharedByIdMeta);
|
context.missing(_sharedByIdMeta);
|
||||||
}
|
}
|
||||||
if (data.containsKey('shared_with_id')) {
|
if (data.containsKey('shared_with_id')) {
|
||||||
context.handle(
|
context.handle(
|
||||||
|
_sharedWithIdMeta,
|
||||||
|
sharedWithId.isAcceptableOrUnknown(
|
||||||
|
data['shared_with_id']!,
|
||||||
_sharedWithIdMeta,
|
_sharedWithIdMeta,
|
||||||
sharedWithId.isAcceptableOrUnknown(
|
),
|
||||||
data['shared_with_id']!, _sharedWithIdMeta));
|
);
|
||||||
} else if (isInserting) {
|
} else if (isInserting) {
|
||||||
context.missing(_sharedWithIdMeta);
|
context.missing(_sharedWithIdMeta);
|
||||||
}
|
}
|
||||||
if (data.containsKey('in_timeline')) {
|
if (data.containsKey('in_timeline')) {
|
||||||
context.handle(
|
context.handle(
|
||||||
_inTimelineMeta,
|
_inTimelineMeta,
|
||||||
inTimeline.isAcceptableOrUnknown(
|
inTimeline.isAcceptableOrUnknown(data['in_timeline']!, _inTimelineMeta),
|
||||||
data['in_timeline']!, _inTimelineMeta));
|
);
|
||||||
}
|
}
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
@ -445,11 +546,17 @@ class $PartnerEntityTable extends i2.PartnerEntity
|
||||||
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
||||||
return i1.PartnerEntityData(
|
return i1.PartnerEntityData(
|
||||||
sharedById: attachedDatabase.typeMapping.read(
|
sharedById: attachedDatabase.typeMapping.read(
|
||||||
i0.DriftSqlType.string, data['${effectivePrefix}shared_by_id'])!,
|
i0.DriftSqlType.string,
|
||||||
|
data['${effectivePrefix}shared_by_id'],
|
||||||
|
)!,
|
||||||
sharedWithId: attachedDatabase.typeMapping.read(
|
sharedWithId: attachedDatabase.typeMapping.read(
|
||||||
i0.DriftSqlType.string, data['${effectivePrefix}shared_with_id'])!,
|
i0.DriftSqlType.string,
|
||||||
inTimeline: attachedDatabase.typeMapping
|
data['${effectivePrefix}shared_with_id'],
|
||||||
.read(i0.DriftSqlType.bool, data['${effectivePrefix}in_timeline'])!,
|
)!,
|
||||||
|
inTimeline: attachedDatabase.typeMapping.read(
|
||||||
|
i0.DriftSqlType.bool,
|
||||||
|
data['${effectivePrefix}in_timeline'],
|
||||||
|
)!,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -469,10 +576,11 @@ class PartnerEntityData extends i0.DataClass
|
||||||
final String sharedById;
|
final String sharedById;
|
||||||
final String sharedWithId;
|
final String sharedWithId;
|
||||||
final bool inTimeline;
|
final bool inTimeline;
|
||||||
const PartnerEntityData(
|
const PartnerEntityData({
|
||||||
{required this.sharedById,
|
required this.sharedById,
|
||||||
required this.sharedWithId,
|
required this.sharedWithId,
|
||||||
required this.inTimeline});
|
required this.inTimeline,
|
||||||
|
});
|
||||||
@override
|
@override
|
||||||
Map<String, i0.Expression> toColumns(bool nullToAbsent) {
|
Map<String, i0.Expression> toColumns(bool nullToAbsent) {
|
||||||
final map = <String, i0.Expression>{};
|
final map = <String, i0.Expression>{};
|
||||||
|
|
@ -482,8 +590,10 @@ class PartnerEntityData extends i0.DataClass
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
factory PartnerEntityData.fromJson(Map<String, dynamic> json,
|
factory PartnerEntityData.fromJson(
|
||||||
{i0.ValueSerializer? serializer}) {
|
Map<String, dynamic> json, {
|
||||||
|
i0.ValueSerializer? serializer,
|
||||||
|
}) {
|
||||||
serializer ??= i0.driftRuntimeOptions.defaultSerializer;
|
serializer ??= i0.driftRuntimeOptions.defaultSerializer;
|
||||||
return PartnerEntityData(
|
return PartnerEntityData(
|
||||||
sharedById: serializer.fromJson<String>(json['sharedById']),
|
sharedById: serializer.fromJson<String>(json['sharedById']),
|
||||||
|
|
@ -501,22 +611,26 @@ class PartnerEntityData extends i0.DataClass
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
i1.PartnerEntityData copyWith(
|
i1.PartnerEntityData copyWith({
|
||||||
{String? sharedById, String? sharedWithId, bool? inTimeline}) =>
|
String? sharedById,
|
||||||
i1.PartnerEntityData(
|
String? sharedWithId,
|
||||||
sharedById: sharedById ?? this.sharedById,
|
bool? inTimeline,
|
||||||
sharedWithId: sharedWithId ?? this.sharedWithId,
|
}) => i1.PartnerEntityData(
|
||||||
inTimeline: inTimeline ?? this.inTimeline,
|
sharedById: sharedById ?? this.sharedById,
|
||||||
);
|
sharedWithId: sharedWithId ?? this.sharedWithId,
|
||||||
|
inTimeline: inTimeline ?? this.inTimeline,
|
||||||
|
);
|
||||||
PartnerEntityData copyWithCompanion(i1.PartnerEntityCompanion data) {
|
PartnerEntityData copyWithCompanion(i1.PartnerEntityCompanion data) {
|
||||||
return PartnerEntityData(
|
return PartnerEntityData(
|
||||||
sharedById:
|
sharedById: data.sharedById.present
|
||||||
data.sharedById.present ? data.sharedById.value : this.sharedById,
|
? data.sharedById.value
|
||||||
|
: this.sharedById,
|
||||||
sharedWithId: data.sharedWithId.present
|
sharedWithId: data.sharedWithId.present
|
||||||
? data.sharedWithId.value
|
? data.sharedWithId.value
|
||||||
: this.sharedWithId,
|
: this.sharedWithId,
|
||||||
inTimeline:
|
inTimeline: data.inTimeline.present
|
||||||
data.inTimeline.present ? data.inTimeline.value : this.inTimeline,
|
? data.inTimeline.value
|
||||||
|
: this.inTimeline,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -554,8 +668,8 @@ class PartnerEntityCompanion extends i0.UpdateCompanion<i1.PartnerEntityData> {
|
||||||
required String sharedById,
|
required String sharedById,
|
||||||
required String sharedWithId,
|
required String sharedWithId,
|
||||||
this.inTimeline = const i0.Value.absent(),
|
this.inTimeline = const i0.Value.absent(),
|
||||||
}) : sharedById = i0.Value(sharedById),
|
}) : sharedById = i0.Value(sharedById),
|
||||||
sharedWithId = i0.Value(sharedWithId);
|
sharedWithId = i0.Value(sharedWithId);
|
||||||
static i0.Insertable<i1.PartnerEntityData> custom({
|
static i0.Insertable<i1.PartnerEntityData> custom({
|
||||||
i0.Expression<String>? sharedById,
|
i0.Expression<String>? sharedById,
|
||||||
i0.Expression<String>? sharedWithId,
|
i0.Expression<String>? sharedWithId,
|
||||||
|
|
@ -568,10 +682,11 @@ class PartnerEntityCompanion extends i0.UpdateCompanion<i1.PartnerEntityData> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
i1.PartnerEntityCompanion copyWith(
|
i1.PartnerEntityCompanion copyWith({
|
||||||
{i0.Value<String>? sharedById,
|
i0.Value<String>? sharedById,
|
||||||
i0.Value<String>? sharedWithId,
|
i0.Value<String>? sharedWithId,
|
||||||
i0.Value<bool>? inTimeline}) {
|
i0.Value<bool>? inTimeline,
|
||||||
|
}) {
|
||||||
return i1.PartnerEntityCompanion(
|
return i1.PartnerEntityCompanion(
|
||||||
sharedById: sharedById ?? this.sharedById,
|
sharedById: sharedById ?? this.sharedById,
|
||||||
sharedWithId: sharedWithId ?? this.sharedWithId,
|
sharedWithId: sharedWithId ?? this.sharedWithId,
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -11,76 +11,96 @@ import 'package:drift/internal/modular.dart' as i4;
|
||||||
import 'package:immich_mobile/infrastructure/entities/remote_album.entity.drift.dart'
|
import 'package:immich_mobile/infrastructure/entities/remote_album.entity.drift.dart'
|
||||||
as i5;
|
as i5;
|
||||||
|
|
||||||
typedef $$RemoteAlbumAssetEntityTableCreateCompanionBuilder
|
typedef $$RemoteAlbumAssetEntityTableCreateCompanionBuilder =
|
||||||
= i1.RemoteAlbumAssetEntityCompanion Function({
|
i1.RemoteAlbumAssetEntityCompanion Function({
|
||||||
required String assetId,
|
required String assetId,
|
||||||
required String albumId,
|
required String albumId,
|
||||||
});
|
});
|
||||||
typedef $$RemoteAlbumAssetEntityTableUpdateCompanionBuilder
|
typedef $$RemoteAlbumAssetEntityTableUpdateCompanionBuilder =
|
||||||
= i1.RemoteAlbumAssetEntityCompanion Function({
|
i1.RemoteAlbumAssetEntityCompanion Function({
|
||||||
i0.Value<String> assetId,
|
i0.Value<String> assetId,
|
||||||
i0.Value<String> albumId,
|
i0.Value<String> albumId,
|
||||||
});
|
});
|
||||||
|
|
||||||
final class $$RemoteAlbumAssetEntityTableReferences extends i0.BaseReferences<
|
final class $$RemoteAlbumAssetEntityTableReferences
|
||||||
i0.GeneratedDatabase,
|
extends
|
||||||
i1.$RemoteAlbumAssetEntityTable,
|
i0.BaseReferences<
|
||||||
i1.RemoteAlbumAssetEntityData> {
|
i0.GeneratedDatabase,
|
||||||
|
i1.$RemoteAlbumAssetEntityTable,
|
||||||
|
i1.RemoteAlbumAssetEntityData
|
||||||
|
> {
|
||||||
$$RemoteAlbumAssetEntityTableReferences(
|
$$RemoteAlbumAssetEntityTableReferences(
|
||||||
super.$_db, super.$_table, super.$_typedResult);
|
super.$_db,
|
||||||
|
super.$_table,
|
||||||
|
super.$_typedResult,
|
||||||
|
);
|
||||||
|
|
||||||
static i3.$RemoteAssetEntityTable _assetIdTable(i0.GeneratedDatabase db) =>
|
static i3.$RemoteAssetEntityTable _assetIdTable(i0.GeneratedDatabase db) =>
|
||||||
i4.ReadDatabaseContainer(db)
|
i4.ReadDatabaseContainer(db)
|
||||||
.resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity')
|
.resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity')
|
||||||
.createAlias(i0.$_aliasNameGenerator(
|
.createAlias(
|
||||||
|
i0.$_aliasNameGenerator(
|
||||||
i4.ReadDatabaseContainer(db)
|
i4.ReadDatabaseContainer(db)
|
||||||
.resultSet<i1.$RemoteAlbumAssetEntityTable>(
|
.resultSet<i1.$RemoteAlbumAssetEntityTable>(
|
||||||
'remote_album_asset_entity')
|
'remote_album_asset_entity',
|
||||||
|
)
|
||||||
.assetId,
|
.assetId,
|
||||||
i4.ReadDatabaseContainer(db)
|
i4.ReadDatabaseContainer(
|
||||||
.resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity')
|
db,
|
||||||
.id));
|
).resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity').id,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
i3.$$RemoteAssetEntityTableProcessedTableManager get assetId {
|
i3.$$RemoteAssetEntityTableProcessedTableManager get assetId {
|
||||||
final $_column = $_itemColumn<String>('asset_id')!;
|
final $_column = $_itemColumn<String>('asset_id')!;
|
||||||
|
|
||||||
final manager = i3
|
final manager = i3
|
||||||
.$$RemoteAssetEntityTableTableManager(
|
.$$RemoteAssetEntityTableTableManager(
|
||||||
|
$_db,
|
||||||
|
i4.ReadDatabaseContainer(
|
||||||
$_db,
|
$_db,
|
||||||
i4.ReadDatabaseContainer($_db)
|
).resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity'),
|
||||||
.resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity'))
|
)
|
||||||
.filter((f) => f.id.sqlEquals($_column));
|
.filter((f) => f.id.sqlEquals($_column));
|
||||||
final item = $_typedResult.readTableOrNull(_assetIdTable($_db));
|
final item = $_typedResult.readTableOrNull(_assetIdTable($_db));
|
||||||
if (item == null) return manager;
|
if (item == null) return manager;
|
||||||
return i0.ProcessedTableManager(
|
return i0.ProcessedTableManager(
|
||||||
manager.$state.copyWith(prefetchedData: [item]));
|
manager.$state.copyWith(prefetchedData: [item]),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static i5.$RemoteAlbumEntityTable _albumIdTable(i0.GeneratedDatabase db) =>
|
static i5.$RemoteAlbumEntityTable _albumIdTable(i0.GeneratedDatabase db) =>
|
||||||
i4.ReadDatabaseContainer(db)
|
i4.ReadDatabaseContainer(db)
|
||||||
.resultSet<i5.$RemoteAlbumEntityTable>('remote_album_entity')
|
.resultSet<i5.$RemoteAlbumEntityTable>('remote_album_entity')
|
||||||
.createAlias(i0.$_aliasNameGenerator(
|
.createAlias(
|
||||||
|
i0.$_aliasNameGenerator(
|
||||||
i4.ReadDatabaseContainer(db)
|
i4.ReadDatabaseContainer(db)
|
||||||
.resultSet<i1.$RemoteAlbumAssetEntityTable>(
|
.resultSet<i1.$RemoteAlbumAssetEntityTable>(
|
||||||
'remote_album_asset_entity')
|
'remote_album_asset_entity',
|
||||||
|
)
|
||||||
.albumId,
|
.albumId,
|
||||||
i4.ReadDatabaseContainer(db)
|
i4.ReadDatabaseContainer(
|
||||||
.resultSet<i5.$RemoteAlbumEntityTable>('remote_album_entity')
|
db,
|
||||||
.id));
|
).resultSet<i5.$RemoteAlbumEntityTable>('remote_album_entity').id,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
i5.$$RemoteAlbumEntityTableProcessedTableManager get albumId {
|
i5.$$RemoteAlbumEntityTableProcessedTableManager get albumId {
|
||||||
final $_column = $_itemColumn<String>('album_id')!;
|
final $_column = $_itemColumn<String>('album_id')!;
|
||||||
|
|
||||||
final manager = i5
|
final manager = i5
|
||||||
.$$RemoteAlbumEntityTableTableManager(
|
.$$RemoteAlbumEntityTableTableManager(
|
||||||
|
$_db,
|
||||||
|
i4.ReadDatabaseContainer(
|
||||||
$_db,
|
$_db,
|
||||||
i4.ReadDatabaseContainer($_db)
|
).resultSet<i5.$RemoteAlbumEntityTable>('remote_album_entity'),
|
||||||
.resultSet<i5.$RemoteAlbumEntityTable>('remote_album_entity'))
|
)
|
||||||
.filter((f) => f.id.sqlEquals($_column));
|
.filter((f) => f.id.sqlEquals($_column));
|
||||||
final item = $_typedResult.readTableOrNull(_albumIdTable($_db));
|
final item = $_typedResult.readTableOrNull(_albumIdTable($_db));
|
||||||
if (item == null) return manager;
|
if (item == null) return manager;
|
||||||
return i0.ProcessedTableManager(
|
return i0.ProcessedTableManager(
|
||||||
manager.$state.copyWith(prefetchedData: [item]));
|
manager.$state.copyWith(prefetchedData: [item]),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -95,45 +115,55 @@ class $$RemoteAlbumAssetEntityTableFilterComposer
|
||||||
});
|
});
|
||||||
i3.$$RemoteAssetEntityTableFilterComposer get assetId {
|
i3.$$RemoteAssetEntityTableFilterComposer get assetId {
|
||||||
final i3.$$RemoteAssetEntityTableFilterComposer composer = $composerBuilder(
|
final i3.$$RemoteAssetEntityTableFilterComposer composer = $composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.assetId,
|
getCurrentColumn: (t) => t.assetId,
|
||||||
referencedTable: i4.ReadDatabaseContainer($db)
|
referencedTable: i4.ReadDatabaseContainer(
|
||||||
.resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i3.$$RemoteAssetEntityTableFilterComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i4.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity'),
|
}) => i3.$$RemoteAssetEntityTableFilterComposer(
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$db: $db,
|
||||||
joinBuilder: joinBuilder,
|
$table: i4.ReadDatabaseContainer(
|
||||||
$removeJoinBuilderFromRootComposer:
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer,
|
).resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity'),
|
||||||
));
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
|
|
||||||
i5.$$RemoteAlbumEntityTableFilterComposer get albumId {
|
i5.$$RemoteAlbumEntityTableFilterComposer get albumId {
|
||||||
final i5.$$RemoteAlbumEntityTableFilterComposer composer = $composerBuilder(
|
final i5.$$RemoteAlbumEntityTableFilterComposer composer = $composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.albumId,
|
getCurrentColumn: (t) => t.albumId,
|
||||||
referencedTable: i4.ReadDatabaseContainer($db)
|
referencedTable: i4.ReadDatabaseContainer(
|
||||||
.resultSet<i5.$RemoteAlbumEntityTable>('remote_album_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i5.$RemoteAlbumEntityTable>('remote_album_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i5.$$RemoteAlbumEntityTableFilterComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i4.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i5.$RemoteAlbumEntityTable>('remote_album_entity'),
|
}) => i5.$$RemoteAlbumEntityTableFilterComposer(
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$db: $db,
|
||||||
joinBuilder: joinBuilder,
|
$table: i4.ReadDatabaseContainer(
|
||||||
$removeJoinBuilderFromRootComposer:
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer,
|
).resultSet<i5.$RemoteAlbumEntityTable>('remote_album_entity'),
|
||||||
));
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -150,48 +180,56 @@ class $$RemoteAlbumAssetEntityTableOrderingComposer
|
||||||
i3.$$RemoteAssetEntityTableOrderingComposer get assetId {
|
i3.$$RemoteAssetEntityTableOrderingComposer get assetId {
|
||||||
final i3.$$RemoteAssetEntityTableOrderingComposer composer =
|
final i3.$$RemoteAssetEntityTableOrderingComposer composer =
|
||||||
$composerBuilder(
|
$composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.assetId,
|
getCurrentColumn: (t) => t.assetId,
|
||||||
referencedTable: i4.ReadDatabaseContainer($db)
|
referencedTable: i4.ReadDatabaseContainer(
|
||||||
.resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i3.$$RemoteAssetEntityTableOrderingComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i4.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i3.$RemoteAssetEntityTable>(
|
}) => i3.$$RemoteAssetEntityTableOrderingComposer(
|
||||||
'remote_asset_entity'),
|
$db: $db,
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$table: i4.ReadDatabaseContainer(
|
||||||
joinBuilder: joinBuilder,
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer:
|
).resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity'),
|
||||||
$removeJoinBuilderFromRootComposer,
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
));
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
|
|
||||||
i5.$$RemoteAlbumEntityTableOrderingComposer get albumId {
|
i5.$$RemoteAlbumEntityTableOrderingComposer get albumId {
|
||||||
final i5.$$RemoteAlbumEntityTableOrderingComposer composer =
|
final i5.$$RemoteAlbumEntityTableOrderingComposer composer =
|
||||||
$composerBuilder(
|
$composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.albumId,
|
getCurrentColumn: (t) => t.albumId,
|
||||||
referencedTable: i4.ReadDatabaseContainer($db)
|
referencedTable: i4.ReadDatabaseContainer(
|
||||||
.resultSet<i5.$RemoteAlbumEntityTable>('remote_album_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i5.$RemoteAlbumEntityTable>('remote_album_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i5.$$RemoteAlbumEntityTableOrderingComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i4.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i5.$RemoteAlbumEntityTable>(
|
}) => i5.$$RemoteAlbumEntityTableOrderingComposer(
|
||||||
'remote_album_entity'),
|
$db: $db,
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$table: i4.ReadDatabaseContainer(
|
||||||
joinBuilder: joinBuilder,
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer:
|
).resultSet<i5.$RemoteAlbumEntityTable>('remote_album_entity'),
|
||||||
$removeJoinBuilderFromRootComposer,
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
));
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -208,106 +246,129 @@ class $$RemoteAlbumAssetEntityTableAnnotationComposer
|
||||||
i3.$$RemoteAssetEntityTableAnnotationComposer get assetId {
|
i3.$$RemoteAssetEntityTableAnnotationComposer get assetId {
|
||||||
final i3.$$RemoteAssetEntityTableAnnotationComposer composer =
|
final i3.$$RemoteAssetEntityTableAnnotationComposer composer =
|
||||||
$composerBuilder(
|
$composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.assetId,
|
getCurrentColumn: (t) => t.assetId,
|
||||||
referencedTable: i4.ReadDatabaseContainer($db)
|
referencedTable: i4.ReadDatabaseContainer(
|
||||||
.resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i3.$$RemoteAssetEntityTableAnnotationComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i4.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i3.$RemoteAssetEntityTable>(
|
}) => i3.$$RemoteAssetEntityTableAnnotationComposer(
|
||||||
'remote_asset_entity'),
|
$db: $db,
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$table: i4.ReadDatabaseContainer(
|
||||||
joinBuilder: joinBuilder,
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer:
|
).resultSet<i3.$RemoteAssetEntityTable>('remote_asset_entity'),
|
||||||
$removeJoinBuilderFromRootComposer,
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
));
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
|
|
||||||
i5.$$RemoteAlbumEntityTableAnnotationComposer get albumId {
|
i5.$$RemoteAlbumEntityTableAnnotationComposer get albumId {
|
||||||
final i5.$$RemoteAlbumEntityTableAnnotationComposer composer =
|
final i5.$$RemoteAlbumEntityTableAnnotationComposer composer =
|
||||||
$composerBuilder(
|
$composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.albumId,
|
getCurrentColumn: (t) => t.albumId,
|
||||||
referencedTable: i4.ReadDatabaseContainer($db)
|
referencedTable: i4.ReadDatabaseContainer(
|
||||||
.resultSet<i5.$RemoteAlbumEntityTable>('remote_album_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i5.$RemoteAlbumEntityTable>('remote_album_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i5.$$RemoteAlbumEntityTableAnnotationComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i4.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i5.$RemoteAlbumEntityTable>(
|
}) => i5.$$RemoteAlbumEntityTableAnnotationComposer(
|
||||||
'remote_album_entity'),
|
$db: $db,
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$table: i4.ReadDatabaseContainer(
|
||||||
joinBuilder: joinBuilder,
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer:
|
).resultSet<i5.$RemoteAlbumEntityTable>('remote_album_entity'),
|
||||||
$removeJoinBuilderFromRootComposer,
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
));
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class $$RemoteAlbumAssetEntityTableTableManager extends i0.RootTableManager<
|
class $$RemoteAlbumAssetEntityTableTableManager
|
||||||
i0.GeneratedDatabase,
|
extends
|
||||||
i1.$RemoteAlbumAssetEntityTable,
|
i0.RootTableManager<
|
||||||
i1.RemoteAlbumAssetEntityData,
|
i0.GeneratedDatabase,
|
||||||
i1.$$RemoteAlbumAssetEntityTableFilterComposer,
|
i1.$RemoteAlbumAssetEntityTable,
|
||||||
i1.$$RemoteAlbumAssetEntityTableOrderingComposer,
|
i1.RemoteAlbumAssetEntityData,
|
||||||
i1.$$RemoteAlbumAssetEntityTableAnnotationComposer,
|
i1.$$RemoteAlbumAssetEntityTableFilterComposer,
|
||||||
$$RemoteAlbumAssetEntityTableCreateCompanionBuilder,
|
i1.$$RemoteAlbumAssetEntityTableOrderingComposer,
|
||||||
$$RemoteAlbumAssetEntityTableUpdateCompanionBuilder,
|
i1.$$RemoteAlbumAssetEntityTableAnnotationComposer,
|
||||||
(i1.RemoteAlbumAssetEntityData, i1.$$RemoteAlbumAssetEntityTableReferences),
|
$$RemoteAlbumAssetEntityTableCreateCompanionBuilder,
|
||||||
i1.RemoteAlbumAssetEntityData,
|
$$RemoteAlbumAssetEntityTableUpdateCompanionBuilder,
|
||||||
i0.PrefetchHooks Function({bool assetId, bool albumId})> {
|
(
|
||||||
|
i1.RemoteAlbumAssetEntityData,
|
||||||
|
i1.$$RemoteAlbumAssetEntityTableReferences,
|
||||||
|
),
|
||||||
|
i1.RemoteAlbumAssetEntityData,
|
||||||
|
i0.PrefetchHooks Function({bool assetId, bool albumId})
|
||||||
|
> {
|
||||||
$$RemoteAlbumAssetEntityTableTableManager(
|
$$RemoteAlbumAssetEntityTableTableManager(
|
||||||
i0.GeneratedDatabase db, i1.$RemoteAlbumAssetEntityTable table)
|
i0.GeneratedDatabase db,
|
||||||
: super(i0.TableManagerState(
|
i1.$RemoteAlbumAssetEntityTable table,
|
||||||
|
) : super(
|
||||||
|
i0.TableManagerState(
|
||||||
db: db,
|
db: db,
|
||||||
table: table,
|
table: table,
|
||||||
createFilteringComposer: () =>
|
createFilteringComposer: () =>
|
||||||
i1.$$RemoteAlbumAssetEntityTableFilterComposer(
|
i1.$$RemoteAlbumAssetEntityTableFilterComposer(
|
||||||
$db: db, $table: table),
|
$db: db,
|
||||||
|
$table: table,
|
||||||
|
),
|
||||||
createOrderingComposer: () =>
|
createOrderingComposer: () =>
|
||||||
i1.$$RemoteAlbumAssetEntityTableOrderingComposer(
|
i1.$$RemoteAlbumAssetEntityTableOrderingComposer(
|
||||||
$db: db, $table: table),
|
$db: db,
|
||||||
|
$table: table,
|
||||||
|
),
|
||||||
createComputedFieldComposer: () =>
|
createComputedFieldComposer: () =>
|
||||||
i1.$$RemoteAlbumAssetEntityTableAnnotationComposer(
|
i1.$$RemoteAlbumAssetEntityTableAnnotationComposer(
|
||||||
$db: db, $table: table),
|
$db: db,
|
||||||
updateCompanionCallback: ({
|
$table: table,
|
||||||
i0.Value<String> assetId = const i0.Value.absent(),
|
),
|
||||||
i0.Value<String> albumId = const i0.Value.absent(),
|
updateCompanionCallback:
|
||||||
}) =>
|
({
|
||||||
i1.RemoteAlbumAssetEntityCompanion(
|
i0.Value<String> assetId = const i0.Value.absent(),
|
||||||
assetId: assetId,
|
i0.Value<String> albumId = const i0.Value.absent(),
|
||||||
albumId: albumId,
|
}) => i1.RemoteAlbumAssetEntityCompanion(
|
||||||
),
|
assetId: assetId,
|
||||||
createCompanionCallback: ({
|
albumId: albumId,
|
||||||
required String assetId,
|
),
|
||||||
required String albumId,
|
createCompanionCallback:
|
||||||
}) =>
|
({required String assetId, required String albumId}) =>
|
||||||
i1.RemoteAlbumAssetEntityCompanion.insert(
|
i1.RemoteAlbumAssetEntityCompanion.insert(
|
||||||
assetId: assetId,
|
assetId: assetId,
|
||||||
albumId: albumId,
|
albumId: albumId,
|
||||||
),
|
),
|
||||||
withReferenceMapper: (p0) => p0
|
withReferenceMapper: (p0) => p0
|
||||||
.map((e) => (
|
.map(
|
||||||
e.readTable(table),
|
(e) => (
|
||||||
i1.$$RemoteAlbumAssetEntityTableReferences(db, table, e)
|
e.readTable(table),
|
||||||
))
|
i1.$$RemoteAlbumAssetEntityTableReferences(db, table, e),
|
||||||
|
),
|
||||||
|
)
|
||||||
.toList(),
|
.toList(),
|
||||||
prefetchHooksCallback: ({assetId = false, albumId = false}) {
|
prefetchHooksCallback: ({assetId = false, albumId = false}) {
|
||||||
return i0.PrefetchHooks(
|
return i0.PrefetchHooks(
|
||||||
db: db,
|
db: db,
|
||||||
explicitlyWatchedTables: [],
|
explicitlyWatchedTables: [],
|
||||||
addJoins: <
|
addJoins:
|
||||||
T extends i0.TableManagerState<
|
<
|
||||||
|
T extends i0.TableManagerState<
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic,
|
dynamic,
|
||||||
|
|
@ -318,83 +379,107 @@ class $$RemoteAlbumAssetEntityTableTableManager extends i0.RootTableManager<
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic>>(state) {
|
dynamic
|
||||||
if (assetId) {
|
>
|
||||||
state = state.withJoin(
|
>(state) {
|
||||||
currentTable: table,
|
if (assetId) {
|
||||||
currentColumn: table.assetId,
|
state =
|
||||||
referencedTable: i1.$$RemoteAlbumAssetEntityTableReferences
|
state.withJoin(
|
||||||
._assetIdTable(db),
|
currentTable: table,
|
||||||
referencedColumn: i1.$$RemoteAlbumAssetEntityTableReferences
|
currentColumn: table.assetId,
|
||||||
._assetIdTable(db)
|
referencedTable: i1
|
||||||
.id,
|
.$$RemoteAlbumAssetEntityTableReferences
|
||||||
) as T;
|
._assetIdTable(db),
|
||||||
}
|
referencedColumn: i1
|
||||||
if (albumId) {
|
.$$RemoteAlbumAssetEntityTableReferences
|
||||||
state = state.withJoin(
|
._assetIdTable(db)
|
||||||
currentTable: table,
|
.id,
|
||||||
currentColumn: table.albumId,
|
)
|
||||||
referencedTable: i1.$$RemoteAlbumAssetEntityTableReferences
|
as T;
|
||||||
._albumIdTable(db),
|
}
|
||||||
referencedColumn: i1.$$RemoteAlbumAssetEntityTableReferences
|
if (albumId) {
|
||||||
._albumIdTable(db)
|
state =
|
||||||
.id,
|
state.withJoin(
|
||||||
) as T;
|
currentTable: table,
|
||||||
}
|
currentColumn: table.albumId,
|
||||||
|
referencedTable: i1
|
||||||
|
.$$RemoteAlbumAssetEntityTableReferences
|
||||||
|
._albumIdTable(db),
|
||||||
|
referencedColumn: i1
|
||||||
|
.$$RemoteAlbumAssetEntityTableReferences
|
||||||
|
._albumIdTable(db)
|
||||||
|
.id,
|
||||||
|
)
|
||||||
|
as T;
|
||||||
|
}
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
},
|
},
|
||||||
getPrefetchedDataCallback: (items) async {
|
getPrefetchedDataCallback: (items) async {
|
||||||
return [];
|
return [];
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
));
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef $$RemoteAlbumAssetEntityTableProcessedTableManager
|
typedef $$RemoteAlbumAssetEntityTableProcessedTableManager =
|
||||||
= i0.ProcessedTableManager<
|
i0.ProcessedTableManager<
|
||||||
i0.GeneratedDatabase,
|
i0.GeneratedDatabase,
|
||||||
i1.$RemoteAlbumAssetEntityTable,
|
i1.$RemoteAlbumAssetEntityTable,
|
||||||
|
i1.RemoteAlbumAssetEntityData,
|
||||||
|
i1.$$RemoteAlbumAssetEntityTableFilterComposer,
|
||||||
|
i1.$$RemoteAlbumAssetEntityTableOrderingComposer,
|
||||||
|
i1.$$RemoteAlbumAssetEntityTableAnnotationComposer,
|
||||||
|
$$RemoteAlbumAssetEntityTableCreateCompanionBuilder,
|
||||||
|
$$RemoteAlbumAssetEntityTableUpdateCompanionBuilder,
|
||||||
|
(
|
||||||
i1.RemoteAlbumAssetEntityData,
|
i1.RemoteAlbumAssetEntityData,
|
||||||
i1.$$RemoteAlbumAssetEntityTableFilterComposer,
|
i1.$$RemoteAlbumAssetEntityTableReferences,
|
||||||
i1.$$RemoteAlbumAssetEntityTableOrderingComposer,
|
),
|
||||||
i1.$$RemoteAlbumAssetEntityTableAnnotationComposer,
|
i1.RemoteAlbumAssetEntityData,
|
||||||
$$RemoteAlbumAssetEntityTableCreateCompanionBuilder,
|
i0.PrefetchHooks Function({bool assetId, bool albumId})
|
||||||
$$RemoteAlbumAssetEntityTableUpdateCompanionBuilder,
|
>;
|
||||||
(
|
|
||||||
i1.RemoteAlbumAssetEntityData,
|
|
||||||
i1.$$RemoteAlbumAssetEntityTableReferences
|
|
||||||
),
|
|
||||||
i1.RemoteAlbumAssetEntityData,
|
|
||||||
i0.PrefetchHooks Function({bool assetId, bool albumId})>;
|
|
||||||
|
|
||||||
class $RemoteAlbumAssetEntityTable extends i2.RemoteAlbumAssetEntity
|
class $RemoteAlbumAssetEntityTable extends i2.RemoteAlbumAssetEntity
|
||||||
with
|
with
|
||||||
i0.TableInfo<$RemoteAlbumAssetEntityTable,
|
i0.TableInfo<
|
||||||
i1.RemoteAlbumAssetEntityData> {
|
$RemoteAlbumAssetEntityTable,
|
||||||
|
i1.RemoteAlbumAssetEntityData
|
||||||
|
> {
|
||||||
@override
|
@override
|
||||||
final i0.GeneratedDatabase attachedDatabase;
|
final i0.GeneratedDatabase attachedDatabase;
|
||||||
final String? _alias;
|
final String? _alias;
|
||||||
$RemoteAlbumAssetEntityTable(this.attachedDatabase, [this._alias]);
|
$RemoteAlbumAssetEntityTable(this.attachedDatabase, [this._alias]);
|
||||||
static const i0.VerificationMeta _assetIdMeta =
|
static const i0.VerificationMeta _assetIdMeta = const i0.VerificationMeta(
|
||||||
const i0.VerificationMeta('assetId');
|
'assetId',
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumn<String> assetId = i0.GeneratedColumn<String>(
|
late final i0.GeneratedColumn<String> assetId = i0.GeneratedColumn<String>(
|
||||||
'asset_id', aliasedName, false,
|
'asset_id',
|
||||||
type: i0.DriftSqlType.string,
|
aliasedName,
|
||||||
requiredDuringInsert: true,
|
false,
|
||||||
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
|
type: i0.DriftSqlType.string,
|
||||||
'REFERENCES remote_asset_entity (id) ON DELETE CASCADE'));
|
requiredDuringInsert: true,
|
||||||
static const i0.VerificationMeta _albumIdMeta =
|
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
|
||||||
const i0.VerificationMeta('albumId');
|
'REFERENCES remote_asset_entity (id) ON DELETE CASCADE',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
static const i0.VerificationMeta _albumIdMeta = const i0.VerificationMeta(
|
||||||
|
'albumId',
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumn<String> albumId = i0.GeneratedColumn<String>(
|
late final i0.GeneratedColumn<String> albumId = i0.GeneratedColumn<String>(
|
||||||
'album_id', aliasedName, false,
|
'album_id',
|
||||||
type: i0.DriftSqlType.string,
|
aliasedName,
|
||||||
requiredDuringInsert: true,
|
false,
|
||||||
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
|
type: i0.DriftSqlType.string,
|
||||||
'REFERENCES remote_album_entity (id) ON DELETE CASCADE'));
|
requiredDuringInsert: true,
|
||||||
|
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
|
||||||
|
'REFERENCES remote_album_entity (id) ON DELETE CASCADE',
|
||||||
|
),
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
List<i0.GeneratedColumn> get $columns => [assetId, albumId];
|
List<i0.GeneratedColumn> get $columns => [assetId, albumId];
|
||||||
@override
|
@override
|
||||||
|
|
@ -404,19 +489,24 @@ class $RemoteAlbumAssetEntityTable extends i2.RemoteAlbumAssetEntity
|
||||||
static const String $name = 'remote_album_asset_entity';
|
static const String $name = 'remote_album_asset_entity';
|
||||||
@override
|
@override
|
||||||
i0.VerificationContext validateIntegrity(
|
i0.VerificationContext validateIntegrity(
|
||||||
i0.Insertable<i1.RemoteAlbumAssetEntityData> instance,
|
i0.Insertable<i1.RemoteAlbumAssetEntityData> instance, {
|
||||||
{bool isInserting = false}) {
|
bool isInserting = false,
|
||||||
|
}) {
|
||||||
final context = i0.VerificationContext();
|
final context = i0.VerificationContext();
|
||||||
final data = instance.toColumns(true);
|
final data = instance.toColumns(true);
|
||||||
if (data.containsKey('asset_id')) {
|
if (data.containsKey('asset_id')) {
|
||||||
context.handle(_assetIdMeta,
|
context.handle(
|
||||||
assetId.isAcceptableOrUnknown(data['asset_id']!, _assetIdMeta));
|
_assetIdMeta,
|
||||||
|
assetId.isAcceptableOrUnknown(data['asset_id']!, _assetIdMeta),
|
||||||
|
);
|
||||||
} else if (isInserting) {
|
} else if (isInserting) {
|
||||||
context.missing(_assetIdMeta);
|
context.missing(_assetIdMeta);
|
||||||
}
|
}
|
||||||
if (data.containsKey('album_id')) {
|
if (data.containsKey('album_id')) {
|
||||||
context.handle(_albumIdMeta,
|
context.handle(
|
||||||
albumId.isAcceptableOrUnknown(data['album_id']!, _albumIdMeta));
|
_albumIdMeta,
|
||||||
|
albumId.isAcceptableOrUnknown(data['album_id']!, _albumIdMeta),
|
||||||
|
);
|
||||||
} else if (isInserting) {
|
} else if (isInserting) {
|
||||||
context.missing(_albumIdMeta);
|
context.missing(_albumIdMeta);
|
||||||
}
|
}
|
||||||
|
|
@ -426,14 +516,20 @@ class $RemoteAlbumAssetEntityTable extends i2.RemoteAlbumAssetEntity
|
||||||
@override
|
@override
|
||||||
Set<i0.GeneratedColumn> get $primaryKey => {assetId, albumId};
|
Set<i0.GeneratedColumn> get $primaryKey => {assetId, albumId};
|
||||||
@override
|
@override
|
||||||
i1.RemoteAlbumAssetEntityData map(Map<String, dynamic> data,
|
i1.RemoteAlbumAssetEntityData map(
|
||||||
{String? tablePrefix}) {
|
Map<String, dynamic> data, {
|
||||||
|
String? tablePrefix,
|
||||||
|
}) {
|
||||||
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
||||||
return i1.RemoteAlbumAssetEntityData(
|
return i1.RemoteAlbumAssetEntityData(
|
||||||
assetId: attachedDatabase.typeMapping
|
assetId: attachedDatabase.typeMapping.read(
|
||||||
.read(i0.DriftSqlType.string, data['${effectivePrefix}asset_id'])!,
|
i0.DriftSqlType.string,
|
||||||
albumId: attachedDatabase.typeMapping
|
data['${effectivePrefix}asset_id'],
|
||||||
.read(i0.DriftSqlType.string, data['${effectivePrefix}album_id'])!,
|
)!,
|
||||||
|
albumId: attachedDatabase.typeMapping.read(
|
||||||
|
i0.DriftSqlType.string,
|
||||||
|
data['${effectivePrefix}album_id'],
|
||||||
|
)!,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -452,8 +548,10 @@ class RemoteAlbumAssetEntityData extends i0.DataClass
|
||||||
implements i0.Insertable<i1.RemoteAlbumAssetEntityData> {
|
implements i0.Insertable<i1.RemoteAlbumAssetEntityData> {
|
||||||
final String assetId;
|
final String assetId;
|
||||||
final String albumId;
|
final String albumId;
|
||||||
const RemoteAlbumAssetEntityData(
|
const RemoteAlbumAssetEntityData({
|
||||||
{required this.assetId, required this.albumId});
|
required this.assetId,
|
||||||
|
required this.albumId,
|
||||||
|
});
|
||||||
@override
|
@override
|
||||||
Map<String, i0.Expression> toColumns(bool nullToAbsent) {
|
Map<String, i0.Expression> toColumns(bool nullToAbsent) {
|
||||||
final map = <String, i0.Expression>{};
|
final map = <String, i0.Expression>{};
|
||||||
|
|
@ -462,8 +560,10 @@ class RemoteAlbumAssetEntityData extends i0.DataClass
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
factory RemoteAlbumAssetEntityData.fromJson(Map<String, dynamic> json,
|
factory RemoteAlbumAssetEntityData.fromJson(
|
||||||
{i0.ValueSerializer? serializer}) {
|
Map<String, dynamic> json, {
|
||||||
|
i0.ValueSerializer? serializer,
|
||||||
|
}) {
|
||||||
serializer ??= i0.driftRuntimeOptions.defaultSerializer;
|
serializer ??= i0.driftRuntimeOptions.defaultSerializer;
|
||||||
return RemoteAlbumAssetEntityData(
|
return RemoteAlbumAssetEntityData(
|
||||||
assetId: serializer.fromJson<String>(json['assetId']),
|
assetId: serializer.fromJson<String>(json['assetId']),
|
||||||
|
|
@ -485,7 +585,8 @@ class RemoteAlbumAssetEntityData extends i0.DataClass
|
||||||
albumId: albumId ?? this.albumId,
|
albumId: albumId ?? this.albumId,
|
||||||
);
|
);
|
||||||
RemoteAlbumAssetEntityData copyWithCompanion(
|
RemoteAlbumAssetEntityData copyWithCompanion(
|
||||||
i1.RemoteAlbumAssetEntityCompanion data) {
|
i1.RemoteAlbumAssetEntityCompanion data,
|
||||||
|
) {
|
||||||
return RemoteAlbumAssetEntityData(
|
return RemoteAlbumAssetEntityData(
|
||||||
assetId: data.assetId.present ? data.assetId.value : this.assetId,
|
assetId: data.assetId.present ? data.assetId.value : this.assetId,
|
||||||
albumId: data.albumId.present ? data.albumId.value : this.albumId,
|
albumId: data.albumId.present ? data.albumId.value : this.albumId,
|
||||||
|
|
@ -522,8 +623,8 @@ class RemoteAlbumAssetEntityCompanion
|
||||||
RemoteAlbumAssetEntityCompanion.insert({
|
RemoteAlbumAssetEntityCompanion.insert({
|
||||||
required String assetId,
|
required String assetId,
|
||||||
required String albumId,
|
required String albumId,
|
||||||
}) : assetId = i0.Value(assetId),
|
}) : assetId = i0.Value(assetId),
|
||||||
albumId = i0.Value(albumId);
|
albumId = i0.Value(albumId);
|
||||||
static i0.Insertable<i1.RemoteAlbumAssetEntityData> custom({
|
static i0.Insertable<i1.RemoteAlbumAssetEntityData> custom({
|
||||||
i0.Expression<String>? assetId,
|
i0.Expression<String>? assetId,
|
||||||
i0.Expression<String>? albumId,
|
i0.Expression<String>? albumId,
|
||||||
|
|
@ -534,8 +635,10 @@ class RemoteAlbumAssetEntityCompanion
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
i1.RemoteAlbumAssetEntityCompanion copyWith(
|
i1.RemoteAlbumAssetEntityCompanion copyWith({
|
||||||
{i0.Value<String>? assetId, i0.Value<String>? albumId}) {
|
i0.Value<String>? assetId,
|
||||||
|
i0.Value<String>? albumId,
|
||||||
|
}) {
|
||||||
return i1.RemoteAlbumAssetEntityCompanion(
|
return i1.RemoteAlbumAssetEntityCompanion(
|
||||||
assetId: assetId ?? this.assetId,
|
assetId: assetId ?? this.assetId,
|
||||||
albumId: albumId ?? this.albumId,
|
albumId: albumId ?? this.albumId,
|
||||||
|
|
|
||||||
|
|
@ -12,78 +12,98 @@ import 'package:drift/internal/modular.dart' as i5;
|
||||||
import 'package:immich_mobile/infrastructure/entities/user.entity.drift.dart'
|
import 'package:immich_mobile/infrastructure/entities/user.entity.drift.dart'
|
||||||
as i6;
|
as i6;
|
||||||
|
|
||||||
typedef $$RemoteAlbumUserEntityTableCreateCompanionBuilder
|
typedef $$RemoteAlbumUserEntityTableCreateCompanionBuilder =
|
||||||
= i1.RemoteAlbumUserEntityCompanion Function({
|
i1.RemoteAlbumUserEntityCompanion Function({
|
||||||
required String albumId,
|
required String albumId,
|
||||||
required String userId,
|
required String userId,
|
||||||
required i2.AlbumUserRole role,
|
required i2.AlbumUserRole role,
|
||||||
});
|
});
|
||||||
typedef $$RemoteAlbumUserEntityTableUpdateCompanionBuilder
|
typedef $$RemoteAlbumUserEntityTableUpdateCompanionBuilder =
|
||||||
= i1.RemoteAlbumUserEntityCompanion Function({
|
i1.RemoteAlbumUserEntityCompanion Function({
|
||||||
i0.Value<String> albumId,
|
i0.Value<String> albumId,
|
||||||
i0.Value<String> userId,
|
i0.Value<String> userId,
|
||||||
i0.Value<i2.AlbumUserRole> role,
|
i0.Value<i2.AlbumUserRole> role,
|
||||||
});
|
});
|
||||||
|
|
||||||
final class $$RemoteAlbumUserEntityTableReferences extends i0.BaseReferences<
|
final class $$RemoteAlbumUserEntityTableReferences
|
||||||
i0.GeneratedDatabase,
|
extends
|
||||||
i1.$RemoteAlbumUserEntityTable,
|
i0.BaseReferences<
|
||||||
i1.RemoteAlbumUserEntityData> {
|
i0.GeneratedDatabase,
|
||||||
|
i1.$RemoteAlbumUserEntityTable,
|
||||||
|
i1.RemoteAlbumUserEntityData
|
||||||
|
> {
|
||||||
$$RemoteAlbumUserEntityTableReferences(
|
$$RemoteAlbumUserEntityTableReferences(
|
||||||
super.$_db, super.$_table, super.$_typedResult);
|
super.$_db,
|
||||||
|
super.$_table,
|
||||||
|
super.$_typedResult,
|
||||||
|
);
|
||||||
|
|
||||||
static i4.$RemoteAlbumEntityTable _albumIdTable(i0.GeneratedDatabase db) =>
|
static i4.$RemoteAlbumEntityTable _albumIdTable(i0.GeneratedDatabase db) =>
|
||||||
i5.ReadDatabaseContainer(db)
|
i5.ReadDatabaseContainer(db)
|
||||||
.resultSet<i4.$RemoteAlbumEntityTable>('remote_album_entity')
|
.resultSet<i4.$RemoteAlbumEntityTable>('remote_album_entity')
|
||||||
.createAlias(i0.$_aliasNameGenerator(
|
.createAlias(
|
||||||
|
i0.$_aliasNameGenerator(
|
||||||
i5.ReadDatabaseContainer(db)
|
i5.ReadDatabaseContainer(db)
|
||||||
.resultSet<i1.$RemoteAlbumUserEntityTable>(
|
.resultSet<i1.$RemoteAlbumUserEntityTable>(
|
||||||
'remote_album_user_entity')
|
'remote_album_user_entity',
|
||||||
|
)
|
||||||
.albumId,
|
.albumId,
|
||||||
i5.ReadDatabaseContainer(db)
|
i5.ReadDatabaseContainer(
|
||||||
.resultSet<i4.$RemoteAlbumEntityTable>('remote_album_entity')
|
db,
|
||||||
.id));
|
).resultSet<i4.$RemoteAlbumEntityTable>('remote_album_entity').id,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
i4.$$RemoteAlbumEntityTableProcessedTableManager get albumId {
|
i4.$$RemoteAlbumEntityTableProcessedTableManager get albumId {
|
||||||
final $_column = $_itemColumn<String>('album_id')!;
|
final $_column = $_itemColumn<String>('album_id')!;
|
||||||
|
|
||||||
final manager = i4
|
final manager = i4
|
||||||
.$$RemoteAlbumEntityTableTableManager(
|
.$$RemoteAlbumEntityTableTableManager(
|
||||||
|
$_db,
|
||||||
|
i5.ReadDatabaseContainer(
|
||||||
$_db,
|
$_db,
|
||||||
i5.ReadDatabaseContainer($_db)
|
).resultSet<i4.$RemoteAlbumEntityTable>('remote_album_entity'),
|
||||||
.resultSet<i4.$RemoteAlbumEntityTable>('remote_album_entity'))
|
)
|
||||||
.filter((f) => f.id.sqlEquals($_column));
|
.filter((f) => f.id.sqlEquals($_column));
|
||||||
final item = $_typedResult.readTableOrNull(_albumIdTable($_db));
|
final item = $_typedResult.readTableOrNull(_albumIdTable($_db));
|
||||||
if (item == null) return manager;
|
if (item == null) return manager;
|
||||||
return i0.ProcessedTableManager(
|
return i0.ProcessedTableManager(
|
||||||
manager.$state.copyWith(prefetchedData: [item]));
|
manager.$state.copyWith(prefetchedData: [item]),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static i6.$UserEntityTable _userIdTable(i0.GeneratedDatabase db) =>
|
static i6.$UserEntityTable _userIdTable(i0.GeneratedDatabase db) =>
|
||||||
i5.ReadDatabaseContainer(db)
|
i5.ReadDatabaseContainer(db)
|
||||||
.resultSet<i6.$UserEntityTable>('user_entity')
|
.resultSet<i6.$UserEntityTable>('user_entity')
|
||||||
.createAlias(i0.$_aliasNameGenerator(
|
.createAlias(
|
||||||
|
i0.$_aliasNameGenerator(
|
||||||
i5.ReadDatabaseContainer(db)
|
i5.ReadDatabaseContainer(db)
|
||||||
.resultSet<i1.$RemoteAlbumUserEntityTable>(
|
.resultSet<i1.$RemoteAlbumUserEntityTable>(
|
||||||
'remote_album_user_entity')
|
'remote_album_user_entity',
|
||||||
|
)
|
||||||
.userId,
|
.userId,
|
||||||
i5.ReadDatabaseContainer(db)
|
i5.ReadDatabaseContainer(
|
||||||
.resultSet<i6.$UserEntityTable>('user_entity')
|
db,
|
||||||
.id));
|
).resultSet<i6.$UserEntityTable>('user_entity').id,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
i6.$$UserEntityTableProcessedTableManager get userId {
|
i6.$$UserEntityTableProcessedTableManager get userId {
|
||||||
final $_column = $_itemColumn<String>('user_id')!;
|
final $_column = $_itemColumn<String>('user_id')!;
|
||||||
|
|
||||||
final manager = i6
|
final manager = i6
|
||||||
.$$UserEntityTableTableManager(
|
.$$UserEntityTableTableManager(
|
||||||
|
$_db,
|
||||||
|
i5.ReadDatabaseContainer(
|
||||||
$_db,
|
$_db,
|
||||||
i5.ReadDatabaseContainer($_db)
|
).resultSet<i6.$UserEntityTable>('user_entity'),
|
||||||
.resultSet<i6.$UserEntityTable>('user_entity'))
|
)
|
||||||
.filter((f) => f.id.sqlEquals($_column));
|
.filter((f) => f.id.sqlEquals($_column));
|
||||||
final item = $_typedResult.readTableOrNull(_userIdTable($_db));
|
final item = $_typedResult.readTableOrNull(_userIdTable($_db));
|
||||||
if (item == null) return manager;
|
if (item == null) return manager;
|
||||||
return i0.ProcessedTableManager(
|
return i0.ProcessedTableManager(
|
||||||
manager.$state.copyWith(prefetchedData: [item]));
|
manager.$state.copyWith(prefetchedData: [item]),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -97,51 +117,62 @@ class $$RemoteAlbumUserEntityTableFilterComposer
|
||||||
super.$removeJoinBuilderFromRootComposer,
|
super.$removeJoinBuilderFromRootComposer,
|
||||||
});
|
});
|
||||||
i0.ColumnWithTypeConverterFilters<i2.AlbumUserRole, i2.AlbumUserRole, int>
|
i0.ColumnWithTypeConverterFilters<i2.AlbumUserRole, i2.AlbumUserRole, int>
|
||||||
get role => $composableBuilder(
|
get role => $composableBuilder(
|
||||||
column: $table.role,
|
column: $table.role,
|
||||||
builder: (column) => i0.ColumnWithTypeConverterFilters(column));
|
builder: (column) => i0.ColumnWithTypeConverterFilters(column),
|
||||||
|
);
|
||||||
|
|
||||||
i4.$$RemoteAlbumEntityTableFilterComposer get albumId {
|
i4.$$RemoteAlbumEntityTableFilterComposer get albumId {
|
||||||
final i4.$$RemoteAlbumEntityTableFilterComposer composer = $composerBuilder(
|
final i4.$$RemoteAlbumEntityTableFilterComposer composer = $composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.albumId,
|
getCurrentColumn: (t) => t.albumId,
|
||||||
referencedTable: i5.ReadDatabaseContainer($db)
|
referencedTable: i5.ReadDatabaseContainer(
|
||||||
.resultSet<i4.$RemoteAlbumEntityTable>('remote_album_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i4.$RemoteAlbumEntityTable>('remote_album_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i4.$$RemoteAlbumEntityTableFilterComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i5.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i4.$RemoteAlbumEntityTable>('remote_album_entity'),
|
}) => i4.$$RemoteAlbumEntityTableFilterComposer(
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$db: $db,
|
||||||
joinBuilder: joinBuilder,
|
$table: i5.ReadDatabaseContainer(
|
||||||
$removeJoinBuilderFromRootComposer:
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer,
|
).resultSet<i4.$RemoteAlbumEntityTable>('remote_album_entity'),
|
||||||
));
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
|
|
||||||
i6.$$UserEntityTableFilterComposer get userId {
|
i6.$$UserEntityTableFilterComposer get userId {
|
||||||
final i6.$$UserEntityTableFilterComposer composer = $composerBuilder(
|
final i6.$$UserEntityTableFilterComposer composer = $composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.userId,
|
getCurrentColumn: (t) => t.userId,
|
||||||
referencedTable: i5.ReadDatabaseContainer($db)
|
referencedTable: i5.ReadDatabaseContainer(
|
||||||
.resultSet<i6.$UserEntityTable>('user_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i6.$UserEntityTable>('user_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i6.$$UserEntityTableFilterComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i5.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i6.$UserEntityTable>('user_entity'),
|
}) => i6.$$UserEntityTableFilterComposer(
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$db: $db,
|
||||||
joinBuilder: joinBuilder,
|
$table: i5.ReadDatabaseContainer(
|
||||||
$removeJoinBuilderFromRootComposer:
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer,
|
).resultSet<i6.$UserEntityTable>('user_entity'),
|
||||||
));
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -156,51 +187,62 @@ class $$RemoteAlbumUserEntityTableOrderingComposer
|
||||||
super.$removeJoinBuilderFromRootComposer,
|
super.$removeJoinBuilderFromRootComposer,
|
||||||
});
|
});
|
||||||
i0.ColumnOrderings<int> get role => $composableBuilder(
|
i0.ColumnOrderings<int> get role => $composableBuilder(
|
||||||
column: $table.role, builder: (column) => i0.ColumnOrderings(column));
|
column: $table.role,
|
||||||
|
builder: (column) => i0.ColumnOrderings(column),
|
||||||
|
);
|
||||||
|
|
||||||
i4.$$RemoteAlbumEntityTableOrderingComposer get albumId {
|
i4.$$RemoteAlbumEntityTableOrderingComposer get albumId {
|
||||||
final i4.$$RemoteAlbumEntityTableOrderingComposer composer =
|
final i4.$$RemoteAlbumEntityTableOrderingComposer composer =
|
||||||
$composerBuilder(
|
$composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.albumId,
|
getCurrentColumn: (t) => t.albumId,
|
||||||
referencedTable: i5.ReadDatabaseContainer($db)
|
referencedTable: i5.ReadDatabaseContainer(
|
||||||
.resultSet<i4.$RemoteAlbumEntityTable>('remote_album_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i4.$RemoteAlbumEntityTable>('remote_album_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i4.$$RemoteAlbumEntityTableOrderingComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i5.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i4.$RemoteAlbumEntityTable>(
|
}) => i4.$$RemoteAlbumEntityTableOrderingComposer(
|
||||||
'remote_album_entity'),
|
$db: $db,
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$table: i5.ReadDatabaseContainer(
|
||||||
joinBuilder: joinBuilder,
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer:
|
).resultSet<i4.$RemoteAlbumEntityTable>('remote_album_entity'),
|
||||||
$removeJoinBuilderFromRootComposer,
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
));
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
|
|
||||||
i6.$$UserEntityTableOrderingComposer get userId {
|
i6.$$UserEntityTableOrderingComposer get userId {
|
||||||
final i6.$$UserEntityTableOrderingComposer composer = $composerBuilder(
|
final i6.$$UserEntityTableOrderingComposer composer = $composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.userId,
|
getCurrentColumn: (t) => t.userId,
|
||||||
referencedTable: i5.ReadDatabaseContainer($db)
|
referencedTable: i5.ReadDatabaseContainer(
|
||||||
.resultSet<i6.$UserEntityTable>('user_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i6.$UserEntityTable>('user_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i6.$$UserEntityTableOrderingComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i5.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i6.$UserEntityTable>('user_entity'),
|
}) => i6.$$UserEntityTableOrderingComposer(
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$db: $db,
|
||||||
joinBuilder: joinBuilder,
|
$table: i5.ReadDatabaseContainer(
|
||||||
$removeJoinBuilderFromRootComposer:
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer,
|
).resultSet<i6.$UserEntityTable>('user_entity'),
|
||||||
));
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -220,108 +262,134 @@ class $$RemoteAlbumUserEntityTableAnnotationComposer
|
||||||
i4.$$RemoteAlbumEntityTableAnnotationComposer get albumId {
|
i4.$$RemoteAlbumEntityTableAnnotationComposer get albumId {
|
||||||
final i4.$$RemoteAlbumEntityTableAnnotationComposer composer =
|
final i4.$$RemoteAlbumEntityTableAnnotationComposer composer =
|
||||||
$composerBuilder(
|
$composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.albumId,
|
getCurrentColumn: (t) => t.albumId,
|
||||||
referencedTable: i5.ReadDatabaseContainer($db)
|
referencedTable: i5.ReadDatabaseContainer(
|
||||||
.resultSet<i4.$RemoteAlbumEntityTable>('remote_album_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i4.$RemoteAlbumEntityTable>('remote_album_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i4.$$RemoteAlbumEntityTableAnnotationComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i5.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i4.$RemoteAlbumEntityTable>(
|
}) => i4.$$RemoteAlbumEntityTableAnnotationComposer(
|
||||||
'remote_album_entity'),
|
$db: $db,
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$table: i5.ReadDatabaseContainer(
|
||||||
joinBuilder: joinBuilder,
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer:
|
).resultSet<i4.$RemoteAlbumEntityTable>('remote_album_entity'),
|
||||||
$removeJoinBuilderFromRootComposer,
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
));
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
|
|
||||||
i6.$$UserEntityTableAnnotationComposer get userId {
|
i6.$$UserEntityTableAnnotationComposer get userId {
|
||||||
final i6.$$UserEntityTableAnnotationComposer composer = $composerBuilder(
|
final i6.$$UserEntityTableAnnotationComposer composer = $composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.userId,
|
getCurrentColumn: (t) => t.userId,
|
||||||
referencedTable: i5.ReadDatabaseContainer($db)
|
referencedTable: i5.ReadDatabaseContainer(
|
||||||
.resultSet<i6.$UserEntityTable>('user_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i6.$UserEntityTable>('user_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i6.$$UserEntityTableAnnotationComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i5.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i6.$UserEntityTable>('user_entity'),
|
}) => i6.$$UserEntityTableAnnotationComposer(
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$db: $db,
|
||||||
joinBuilder: joinBuilder,
|
$table: i5.ReadDatabaseContainer(
|
||||||
$removeJoinBuilderFromRootComposer:
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer,
|
).resultSet<i6.$UserEntityTable>('user_entity'),
|
||||||
));
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class $$RemoteAlbumUserEntityTableTableManager extends i0.RootTableManager<
|
class $$RemoteAlbumUserEntityTableTableManager
|
||||||
i0.GeneratedDatabase,
|
extends
|
||||||
i1.$RemoteAlbumUserEntityTable,
|
i0.RootTableManager<
|
||||||
i1.RemoteAlbumUserEntityData,
|
i0.GeneratedDatabase,
|
||||||
i1.$$RemoteAlbumUserEntityTableFilterComposer,
|
i1.$RemoteAlbumUserEntityTable,
|
||||||
i1.$$RemoteAlbumUserEntityTableOrderingComposer,
|
i1.RemoteAlbumUserEntityData,
|
||||||
i1.$$RemoteAlbumUserEntityTableAnnotationComposer,
|
i1.$$RemoteAlbumUserEntityTableFilterComposer,
|
||||||
$$RemoteAlbumUserEntityTableCreateCompanionBuilder,
|
i1.$$RemoteAlbumUserEntityTableOrderingComposer,
|
||||||
$$RemoteAlbumUserEntityTableUpdateCompanionBuilder,
|
i1.$$RemoteAlbumUserEntityTableAnnotationComposer,
|
||||||
(i1.RemoteAlbumUserEntityData, i1.$$RemoteAlbumUserEntityTableReferences),
|
$$RemoteAlbumUserEntityTableCreateCompanionBuilder,
|
||||||
i1.RemoteAlbumUserEntityData,
|
$$RemoteAlbumUserEntityTableUpdateCompanionBuilder,
|
||||||
i0.PrefetchHooks Function({bool albumId, bool userId})> {
|
(
|
||||||
|
i1.RemoteAlbumUserEntityData,
|
||||||
|
i1.$$RemoteAlbumUserEntityTableReferences,
|
||||||
|
),
|
||||||
|
i1.RemoteAlbumUserEntityData,
|
||||||
|
i0.PrefetchHooks Function({bool albumId, bool userId})
|
||||||
|
> {
|
||||||
$$RemoteAlbumUserEntityTableTableManager(
|
$$RemoteAlbumUserEntityTableTableManager(
|
||||||
i0.GeneratedDatabase db, i1.$RemoteAlbumUserEntityTable table)
|
i0.GeneratedDatabase db,
|
||||||
: super(i0.TableManagerState(
|
i1.$RemoteAlbumUserEntityTable table,
|
||||||
|
) : super(
|
||||||
|
i0.TableManagerState(
|
||||||
db: db,
|
db: db,
|
||||||
table: table,
|
table: table,
|
||||||
createFilteringComposer: () =>
|
createFilteringComposer: () =>
|
||||||
i1.$$RemoteAlbumUserEntityTableFilterComposer(
|
i1.$$RemoteAlbumUserEntityTableFilterComposer(
|
||||||
$db: db, $table: table),
|
$db: db,
|
||||||
|
$table: table,
|
||||||
|
),
|
||||||
createOrderingComposer: () =>
|
createOrderingComposer: () =>
|
||||||
i1.$$RemoteAlbumUserEntityTableOrderingComposer(
|
i1.$$RemoteAlbumUserEntityTableOrderingComposer(
|
||||||
$db: db, $table: table),
|
$db: db,
|
||||||
|
$table: table,
|
||||||
|
),
|
||||||
createComputedFieldComposer: () =>
|
createComputedFieldComposer: () =>
|
||||||
i1.$$RemoteAlbumUserEntityTableAnnotationComposer(
|
i1.$$RemoteAlbumUserEntityTableAnnotationComposer(
|
||||||
$db: db, $table: table),
|
$db: db,
|
||||||
updateCompanionCallback: ({
|
$table: table,
|
||||||
i0.Value<String> albumId = const i0.Value.absent(),
|
),
|
||||||
i0.Value<String> userId = const i0.Value.absent(),
|
updateCompanionCallback:
|
||||||
i0.Value<i2.AlbumUserRole> role = const i0.Value.absent(),
|
({
|
||||||
}) =>
|
i0.Value<String> albumId = const i0.Value.absent(),
|
||||||
i1.RemoteAlbumUserEntityCompanion(
|
i0.Value<String> userId = const i0.Value.absent(),
|
||||||
albumId: albumId,
|
i0.Value<i2.AlbumUserRole> role = const i0.Value.absent(),
|
||||||
userId: userId,
|
}) => i1.RemoteAlbumUserEntityCompanion(
|
||||||
role: role,
|
albumId: albumId,
|
||||||
),
|
userId: userId,
|
||||||
createCompanionCallback: ({
|
role: role,
|
||||||
required String albumId,
|
),
|
||||||
required String userId,
|
createCompanionCallback:
|
||||||
required i2.AlbumUserRole role,
|
({
|
||||||
}) =>
|
required String albumId,
|
||||||
i1.RemoteAlbumUserEntityCompanion.insert(
|
required String userId,
|
||||||
albumId: albumId,
|
required i2.AlbumUserRole role,
|
||||||
userId: userId,
|
}) => i1.RemoteAlbumUserEntityCompanion.insert(
|
||||||
role: role,
|
albumId: albumId,
|
||||||
),
|
userId: userId,
|
||||||
|
role: role,
|
||||||
|
),
|
||||||
withReferenceMapper: (p0) => p0
|
withReferenceMapper: (p0) => p0
|
||||||
.map((e) => (
|
.map(
|
||||||
e.readTable(table),
|
(e) => (
|
||||||
i1.$$RemoteAlbumUserEntityTableReferences(db, table, e)
|
e.readTable(table),
|
||||||
))
|
i1.$$RemoteAlbumUserEntityTableReferences(db, table, e),
|
||||||
|
),
|
||||||
|
)
|
||||||
.toList(),
|
.toList(),
|
||||||
prefetchHooksCallback: ({albumId = false, userId = false}) {
|
prefetchHooksCallback: ({albumId = false, userId = false}) {
|
||||||
return i0.PrefetchHooks(
|
return i0.PrefetchHooks(
|
||||||
db: db,
|
db: db,
|
||||||
explicitlyWatchedTables: [],
|
explicitlyWatchedTables: [],
|
||||||
addJoins: <
|
addJoins:
|
||||||
T extends i0.TableManagerState<
|
<
|
||||||
|
T extends i0.TableManagerState<
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic,
|
dynamic,
|
||||||
|
|
@ -332,89 +400,115 @@ class $$RemoteAlbumUserEntityTableTableManager extends i0.RootTableManager<
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic>>(state) {
|
dynamic
|
||||||
if (albumId) {
|
>
|
||||||
state = state.withJoin(
|
>(state) {
|
||||||
currentTable: table,
|
if (albumId) {
|
||||||
currentColumn: table.albumId,
|
state =
|
||||||
referencedTable: i1.$$RemoteAlbumUserEntityTableReferences
|
state.withJoin(
|
||||||
._albumIdTable(db),
|
currentTable: table,
|
||||||
referencedColumn: i1.$$RemoteAlbumUserEntityTableReferences
|
currentColumn: table.albumId,
|
||||||
._albumIdTable(db)
|
referencedTable: i1
|
||||||
.id,
|
.$$RemoteAlbumUserEntityTableReferences
|
||||||
) as T;
|
._albumIdTable(db),
|
||||||
}
|
referencedColumn: i1
|
||||||
if (userId) {
|
.$$RemoteAlbumUserEntityTableReferences
|
||||||
state = state.withJoin(
|
._albumIdTable(db)
|
||||||
currentTable: table,
|
.id,
|
||||||
currentColumn: table.userId,
|
)
|
||||||
referencedTable: i1.$$RemoteAlbumUserEntityTableReferences
|
as T;
|
||||||
._userIdTable(db),
|
}
|
||||||
referencedColumn: i1.$$RemoteAlbumUserEntityTableReferences
|
if (userId) {
|
||||||
._userIdTable(db)
|
state =
|
||||||
.id,
|
state.withJoin(
|
||||||
) as T;
|
currentTable: table,
|
||||||
}
|
currentColumn: table.userId,
|
||||||
|
referencedTable: i1
|
||||||
|
.$$RemoteAlbumUserEntityTableReferences
|
||||||
|
._userIdTable(db),
|
||||||
|
referencedColumn: i1
|
||||||
|
.$$RemoteAlbumUserEntityTableReferences
|
||||||
|
._userIdTable(db)
|
||||||
|
.id,
|
||||||
|
)
|
||||||
|
as T;
|
||||||
|
}
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
},
|
},
|
||||||
getPrefetchedDataCallback: (items) async {
|
getPrefetchedDataCallback: (items) async {
|
||||||
return [];
|
return [];
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
));
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef $$RemoteAlbumUserEntityTableProcessedTableManager
|
typedef $$RemoteAlbumUserEntityTableProcessedTableManager =
|
||||||
= i0.ProcessedTableManager<
|
i0.ProcessedTableManager<
|
||||||
i0.GeneratedDatabase,
|
i0.GeneratedDatabase,
|
||||||
i1.$RemoteAlbumUserEntityTable,
|
i1.$RemoteAlbumUserEntityTable,
|
||||||
i1.RemoteAlbumUserEntityData,
|
i1.RemoteAlbumUserEntityData,
|
||||||
i1.$$RemoteAlbumUserEntityTableFilterComposer,
|
i1.$$RemoteAlbumUserEntityTableFilterComposer,
|
||||||
i1.$$RemoteAlbumUserEntityTableOrderingComposer,
|
i1.$$RemoteAlbumUserEntityTableOrderingComposer,
|
||||||
i1.$$RemoteAlbumUserEntityTableAnnotationComposer,
|
i1.$$RemoteAlbumUserEntityTableAnnotationComposer,
|
||||||
$$RemoteAlbumUserEntityTableCreateCompanionBuilder,
|
$$RemoteAlbumUserEntityTableCreateCompanionBuilder,
|
||||||
$$RemoteAlbumUserEntityTableUpdateCompanionBuilder,
|
$$RemoteAlbumUserEntityTableUpdateCompanionBuilder,
|
||||||
(
|
(i1.RemoteAlbumUserEntityData, i1.$$RemoteAlbumUserEntityTableReferences),
|
||||||
i1.RemoteAlbumUserEntityData,
|
i1.RemoteAlbumUserEntityData,
|
||||||
i1.$$RemoteAlbumUserEntityTableReferences
|
i0.PrefetchHooks Function({bool albumId, bool userId})
|
||||||
),
|
>;
|
||||||
i1.RemoteAlbumUserEntityData,
|
|
||||||
i0.PrefetchHooks Function({bool albumId, bool userId})>;
|
|
||||||
|
|
||||||
class $RemoteAlbumUserEntityTable extends i3.RemoteAlbumUserEntity
|
class $RemoteAlbumUserEntityTable extends i3.RemoteAlbumUserEntity
|
||||||
with
|
with
|
||||||
i0
|
i0.TableInfo<
|
||||||
.TableInfo<$RemoteAlbumUserEntityTable, i1.RemoteAlbumUserEntityData> {
|
$RemoteAlbumUserEntityTable,
|
||||||
|
i1.RemoteAlbumUserEntityData
|
||||||
|
> {
|
||||||
@override
|
@override
|
||||||
final i0.GeneratedDatabase attachedDatabase;
|
final i0.GeneratedDatabase attachedDatabase;
|
||||||
final String? _alias;
|
final String? _alias;
|
||||||
$RemoteAlbumUserEntityTable(this.attachedDatabase, [this._alias]);
|
$RemoteAlbumUserEntityTable(this.attachedDatabase, [this._alias]);
|
||||||
static const i0.VerificationMeta _albumIdMeta =
|
static const i0.VerificationMeta _albumIdMeta = const i0.VerificationMeta(
|
||||||
const i0.VerificationMeta('albumId');
|
'albumId',
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumn<String> albumId = i0.GeneratedColumn<String>(
|
late final i0.GeneratedColumn<String> albumId = i0.GeneratedColumn<String>(
|
||||||
'album_id', aliasedName, false,
|
'album_id',
|
||||||
type: i0.DriftSqlType.string,
|
aliasedName,
|
||||||
requiredDuringInsert: true,
|
false,
|
||||||
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
|
type: i0.DriftSqlType.string,
|
||||||
'REFERENCES remote_album_entity (id) ON DELETE CASCADE'));
|
requiredDuringInsert: true,
|
||||||
static const i0.VerificationMeta _userIdMeta =
|
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
|
||||||
const i0.VerificationMeta('userId');
|
'REFERENCES remote_album_entity (id) ON DELETE CASCADE',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
static const i0.VerificationMeta _userIdMeta = const i0.VerificationMeta(
|
||||||
|
'userId',
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumn<String> userId = i0.GeneratedColumn<String>(
|
late final i0.GeneratedColumn<String> userId = i0.GeneratedColumn<String>(
|
||||||
'user_id', aliasedName, false,
|
'user_id',
|
||||||
type: i0.DriftSqlType.string,
|
aliasedName,
|
||||||
requiredDuringInsert: true,
|
false,
|
||||||
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
|
type: i0.DriftSqlType.string,
|
||||||
'REFERENCES user_entity (id) ON DELETE CASCADE'));
|
requiredDuringInsert: true,
|
||||||
|
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
|
||||||
|
'REFERENCES user_entity (id) ON DELETE CASCADE',
|
||||||
|
),
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumnWithTypeConverter<i2.AlbumUserRole, int> role =
|
late final i0.GeneratedColumnWithTypeConverter<i2.AlbumUserRole, int> role =
|
||||||
i0.GeneratedColumn<int>('role', aliasedName, false,
|
i0.GeneratedColumn<int>(
|
||||||
type: i0.DriftSqlType.int, requiredDuringInsert: true)
|
'role',
|
||||||
.withConverter<i2.AlbumUserRole>(
|
aliasedName,
|
||||||
i1.$RemoteAlbumUserEntityTable.$converterrole);
|
false,
|
||||||
|
type: i0.DriftSqlType.int,
|
||||||
|
requiredDuringInsert: true,
|
||||||
|
).withConverter<i2.AlbumUserRole>(
|
||||||
|
i1.$RemoteAlbumUserEntityTable.$converterrole,
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
List<i0.GeneratedColumn> get $columns => [albumId, userId, role];
|
List<i0.GeneratedColumn> get $columns => [albumId, userId, role];
|
||||||
@override
|
@override
|
||||||
|
|
@ -424,19 +518,24 @@ class $RemoteAlbumUserEntityTable extends i3.RemoteAlbumUserEntity
|
||||||
static const String $name = 'remote_album_user_entity';
|
static const String $name = 'remote_album_user_entity';
|
||||||
@override
|
@override
|
||||||
i0.VerificationContext validateIntegrity(
|
i0.VerificationContext validateIntegrity(
|
||||||
i0.Insertable<i1.RemoteAlbumUserEntityData> instance,
|
i0.Insertable<i1.RemoteAlbumUserEntityData> instance, {
|
||||||
{bool isInserting = false}) {
|
bool isInserting = false,
|
||||||
|
}) {
|
||||||
final context = i0.VerificationContext();
|
final context = i0.VerificationContext();
|
||||||
final data = instance.toColumns(true);
|
final data = instance.toColumns(true);
|
||||||
if (data.containsKey('album_id')) {
|
if (data.containsKey('album_id')) {
|
||||||
context.handle(_albumIdMeta,
|
context.handle(
|
||||||
albumId.isAcceptableOrUnknown(data['album_id']!, _albumIdMeta));
|
_albumIdMeta,
|
||||||
|
albumId.isAcceptableOrUnknown(data['album_id']!, _albumIdMeta),
|
||||||
|
);
|
||||||
} else if (isInserting) {
|
} else if (isInserting) {
|
||||||
context.missing(_albumIdMeta);
|
context.missing(_albumIdMeta);
|
||||||
}
|
}
|
||||||
if (data.containsKey('user_id')) {
|
if (data.containsKey('user_id')) {
|
||||||
context.handle(_userIdMeta,
|
context.handle(
|
||||||
userId.isAcceptableOrUnknown(data['user_id']!, _userIdMeta));
|
_userIdMeta,
|
||||||
|
userId.isAcceptableOrUnknown(data['user_id']!, _userIdMeta),
|
||||||
|
);
|
||||||
} else if (isInserting) {
|
} else if (isInserting) {
|
||||||
context.missing(_userIdMeta);
|
context.missing(_userIdMeta);
|
||||||
}
|
}
|
||||||
|
|
@ -446,17 +545,26 @@ class $RemoteAlbumUserEntityTable extends i3.RemoteAlbumUserEntity
|
||||||
@override
|
@override
|
||||||
Set<i0.GeneratedColumn> get $primaryKey => {albumId, userId};
|
Set<i0.GeneratedColumn> get $primaryKey => {albumId, userId};
|
||||||
@override
|
@override
|
||||||
i1.RemoteAlbumUserEntityData map(Map<String, dynamic> data,
|
i1.RemoteAlbumUserEntityData map(
|
||||||
{String? tablePrefix}) {
|
Map<String, dynamic> data, {
|
||||||
|
String? tablePrefix,
|
||||||
|
}) {
|
||||||
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
||||||
return i1.RemoteAlbumUserEntityData(
|
return i1.RemoteAlbumUserEntityData(
|
||||||
albumId: attachedDatabase.typeMapping
|
albumId: attachedDatabase.typeMapping.read(
|
||||||
.read(i0.DriftSqlType.string, data['${effectivePrefix}album_id'])!,
|
i0.DriftSqlType.string,
|
||||||
userId: attachedDatabase.typeMapping
|
data['${effectivePrefix}album_id'],
|
||||||
.read(i0.DriftSqlType.string, data['${effectivePrefix}user_id'])!,
|
)!,
|
||||||
|
userId: attachedDatabase.typeMapping.read(
|
||||||
|
i0.DriftSqlType.string,
|
||||||
|
data['${effectivePrefix}user_id'],
|
||||||
|
)!,
|
||||||
role: i1.$RemoteAlbumUserEntityTable.$converterrole.fromSql(
|
role: i1.$RemoteAlbumUserEntityTable.$converterrole.fromSql(
|
||||||
attachedDatabase.typeMapping
|
attachedDatabase.typeMapping.read(
|
||||||
.read(i0.DriftSqlType.int, data['${effectivePrefix}role'])!),
|
i0.DriftSqlType.int,
|
||||||
|
data['${effectivePrefix}role'],
|
||||||
|
)!,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -478,8 +586,11 @@ class RemoteAlbumUserEntityData extends i0.DataClass
|
||||||
final String albumId;
|
final String albumId;
|
||||||
final String userId;
|
final String userId;
|
||||||
final i2.AlbumUserRole role;
|
final i2.AlbumUserRole role;
|
||||||
const RemoteAlbumUserEntityData(
|
const RemoteAlbumUserEntityData({
|
||||||
{required this.albumId, required this.userId, required this.role});
|
required this.albumId,
|
||||||
|
required this.userId,
|
||||||
|
required this.role,
|
||||||
|
});
|
||||||
@override
|
@override
|
||||||
Map<String, i0.Expression> toColumns(bool nullToAbsent) {
|
Map<String, i0.Expression> toColumns(bool nullToAbsent) {
|
||||||
final map = <String, i0.Expression>{};
|
final map = <String, i0.Expression>{};
|
||||||
|
|
@ -487,19 +598,23 @@ class RemoteAlbumUserEntityData extends i0.DataClass
|
||||||
map['user_id'] = i0.Variable<String>(userId);
|
map['user_id'] = i0.Variable<String>(userId);
|
||||||
{
|
{
|
||||||
map['role'] = i0.Variable<int>(
|
map['role'] = i0.Variable<int>(
|
||||||
i1.$RemoteAlbumUserEntityTable.$converterrole.toSql(role));
|
i1.$RemoteAlbumUserEntityTable.$converterrole.toSql(role),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
factory RemoteAlbumUserEntityData.fromJson(Map<String, dynamic> json,
|
factory RemoteAlbumUserEntityData.fromJson(
|
||||||
{i0.ValueSerializer? serializer}) {
|
Map<String, dynamic> json, {
|
||||||
|
i0.ValueSerializer? serializer,
|
||||||
|
}) {
|
||||||
serializer ??= i0.driftRuntimeOptions.defaultSerializer;
|
serializer ??= i0.driftRuntimeOptions.defaultSerializer;
|
||||||
return RemoteAlbumUserEntityData(
|
return RemoteAlbumUserEntityData(
|
||||||
albumId: serializer.fromJson<String>(json['albumId']),
|
albumId: serializer.fromJson<String>(json['albumId']),
|
||||||
userId: serializer.fromJson<String>(json['userId']),
|
userId: serializer.fromJson<String>(json['userId']),
|
||||||
role: i1.$RemoteAlbumUserEntityTable.$converterrole
|
role: i1.$RemoteAlbumUserEntityTable.$converterrole.fromJson(
|
||||||
.fromJson(serializer.fromJson<int>(json['role'])),
|
serializer.fromJson<int>(json['role']),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@override
|
@override
|
||||||
|
|
@ -509,19 +624,23 @@ class RemoteAlbumUserEntityData extends i0.DataClass
|
||||||
'albumId': serializer.toJson<String>(albumId),
|
'albumId': serializer.toJson<String>(albumId),
|
||||||
'userId': serializer.toJson<String>(userId),
|
'userId': serializer.toJson<String>(userId),
|
||||||
'role': serializer.toJson<int>(
|
'role': serializer.toJson<int>(
|
||||||
i1.$RemoteAlbumUserEntityTable.$converterrole.toJson(role)),
|
i1.$RemoteAlbumUserEntityTable.$converterrole.toJson(role),
|
||||||
|
),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
i1.RemoteAlbumUserEntityData copyWith(
|
i1.RemoteAlbumUserEntityData copyWith({
|
||||||
{String? albumId, String? userId, i2.AlbumUserRole? role}) =>
|
String? albumId,
|
||||||
i1.RemoteAlbumUserEntityData(
|
String? userId,
|
||||||
albumId: albumId ?? this.albumId,
|
i2.AlbumUserRole? role,
|
||||||
userId: userId ?? this.userId,
|
}) => i1.RemoteAlbumUserEntityData(
|
||||||
role: role ?? this.role,
|
albumId: albumId ?? this.albumId,
|
||||||
);
|
userId: userId ?? this.userId,
|
||||||
|
role: role ?? this.role,
|
||||||
|
);
|
||||||
RemoteAlbumUserEntityData copyWithCompanion(
|
RemoteAlbumUserEntityData copyWithCompanion(
|
||||||
i1.RemoteAlbumUserEntityCompanion data) {
|
i1.RemoteAlbumUserEntityCompanion data,
|
||||||
|
) {
|
||||||
return RemoteAlbumUserEntityData(
|
return RemoteAlbumUserEntityData(
|
||||||
albumId: data.albumId.present ? data.albumId.value : this.albumId,
|
albumId: data.albumId.present ? data.albumId.value : this.albumId,
|
||||||
userId: data.userId.present ? data.userId.value : this.userId,
|
userId: data.userId.present ? data.userId.value : this.userId,
|
||||||
|
|
@ -564,9 +683,9 @@ class RemoteAlbumUserEntityCompanion
|
||||||
required String albumId,
|
required String albumId,
|
||||||
required String userId,
|
required String userId,
|
||||||
required i2.AlbumUserRole role,
|
required i2.AlbumUserRole role,
|
||||||
}) : albumId = i0.Value(albumId),
|
}) : albumId = i0.Value(albumId),
|
||||||
userId = i0.Value(userId),
|
userId = i0.Value(userId),
|
||||||
role = i0.Value(role);
|
role = i0.Value(role);
|
||||||
static i0.Insertable<i1.RemoteAlbumUserEntityData> custom({
|
static i0.Insertable<i1.RemoteAlbumUserEntityData> custom({
|
||||||
i0.Expression<String>? albumId,
|
i0.Expression<String>? albumId,
|
||||||
i0.Expression<String>? userId,
|
i0.Expression<String>? userId,
|
||||||
|
|
@ -579,10 +698,11 @@ class RemoteAlbumUserEntityCompanion
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
i1.RemoteAlbumUserEntityCompanion copyWith(
|
i1.RemoteAlbumUserEntityCompanion copyWith({
|
||||||
{i0.Value<String>? albumId,
|
i0.Value<String>? albumId,
|
||||||
i0.Value<String>? userId,
|
i0.Value<String>? userId,
|
||||||
i0.Value<i2.AlbumUserRole>? role}) {
|
i0.Value<i2.AlbumUserRole>? role,
|
||||||
|
}) {
|
||||||
return i1.RemoteAlbumUserEntityCompanion(
|
return i1.RemoteAlbumUserEntityCompanion(
|
||||||
albumId: albumId ?? this.albumId,
|
albumId: albumId ?? this.albumId,
|
||||||
userId: userId ?? this.userId,
|
userId: userId ?? this.userId,
|
||||||
|
|
@ -601,7 +721,8 @@ class RemoteAlbumUserEntityCompanion
|
||||||
}
|
}
|
||||||
if (role.present) {
|
if (role.present) {
|
||||||
map['role'] = i0.Variable<int>(
|
map['role'] = i0.Variable<int>(
|
||||||
i1.$RemoteAlbumUserEntityTable.$converterrole.toSql(role.value));
|
i1.$RemoteAlbumUserEntityTable.$converterrole.toSql(role.value),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,7 @@ import 'package:immich_mobile/infrastructure/entities/user.entity.dart';
|
||||||
import 'package:immich_mobile/infrastructure/utils/asset.mixin.dart';
|
import 'package:immich_mobile/infrastructure/utils/asset.mixin.dart';
|
||||||
import 'package:immich_mobile/infrastructure/utils/drift_default.mixin.dart';
|
import 'package:immich_mobile/infrastructure/utils/drift_default.mixin.dart';
|
||||||
|
|
||||||
@TableIndex(
|
@TableIndex(name: 'UQ_remote_asset_owner_checksum', columns: {#checksum, #ownerId}, unique: true)
|
||||||
name: 'UQ_remote_asset_owner_checksum',
|
|
||||||
columns: {#checksum, #ownerId},
|
|
||||||
unique: true,
|
|
||||||
)
|
|
||||||
@TableIndex(name: 'idx_remote_asset_checksum', columns: {#checksum})
|
@TableIndex(name: 'idx_remote_asset_checksum', columns: {#checksum})
|
||||||
class RemoteAssetEntity extends Table with DriftDefaultsMixin, AssetEntityMixin {
|
class RemoteAssetEntity extends Table with DriftDefaultsMixin, AssetEntityMixin {
|
||||||
const RemoteAssetEntity();
|
const RemoteAssetEntity();
|
||||||
|
|
@ -40,21 +36,21 @@ class RemoteAssetEntity extends Table with DriftDefaultsMixin, AssetEntityMixin
|
||||||
|
|
||||||
extension RemoteAssetEntityDataDomainEx on RemoteAssetEntityData {
|
extension RemoteAssetEntityDataDomainEx on RemoteAssetEntityData {
|
||||||
RemoteAsset toDto() => RemoteAsset(
|
RemoteAsset toDto() => RemoteAsset(
|
||||||
id: id,
|
id: id,
|
||||||
name: name,
|
name: name,
|
||||||
ownerId: ownerId,
|
ownerId: ownerId,
|
||||||
checksum: checksum,
|
checksum: checksum,
|
||||||
type: type,
|
type: type,
|
||||||
createdAt: createdAt,
|
createdAt: createdAt,
|
||||||
updatedAt: updatedAt,
|
updatedAt: updatedAt,
|
||||||
durationInSeconds: durationInSeconds,
|
durationInSeconds: durationInSeconds,
|
||||||
isFavorite: isFavorite,
|
isFavorite: isFavorite,
|
||||||
height: height,
|
height: height,
|
||||||
width: width,
|
width: width,
|
||||||
thumbHash: thumbHash,
|
thumbHash: thumbHash,
|
||||||
visibility: visibility,
|
visibility: visibility,
|
||||||
livePhotoVideoId: livePhotoVideoId,
|
livePhotoVideoId: livePhotoVideoId,
|
||||||
localId: null,
|
localId: null,
|
||||||
stackId: stackId,
|
stackId: stackId,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -9,51 +9,62 @@ import 'package:immich_mobile/infrastructure/entities/user.entity.drift.dart'
|
||||||
as i4;
|
as i4;
|
||||||
import 'package:drift/internal/modular.dart' as i5;
|
import 'package:drift/internal/modular.dart' as i5;
|
||||||
|
|
||||||
typedef $$StackEntityTableCreateCompanionBuilder = i1.StackEntityCompanion
|
typedef $$StackEntityTableCreateCompanionBuilder =
|
||||||
Function({
|
i1.StackEntityCompanion Function({
|
||||||
required String id,
|
required String id,
|
||||||
i0.Value<DateTime> createdAt,
|
i0.Value<DateTime> createdAt,
|
||||||
i0.Value<DateTime> updatedAt,
|
i0.Value<DateTime> updatedAt,
|
||||||
required String ownerId,
|
required String ownerId,
|
||||||
required String primaryAssetId,
|
required String primaryAssetId,
|
||||||
});
|
});
|
||||||
typedef $$StackEntityTableUpdateCompanionBuilder = i1.StackEntityCompanion
|
typedef $$StackEntityTableUpdateCompanionBuilder =
|
||||||
Function({
|
i1.StackEntityCompanion Function({
|
||||||
i0.Value<String> id,
|
i0.Value<String> id,
|
||||||
i0.Value<DateTime> createdAt,
|
i0.Value<DateTime> createdAt,
|
||||||
i0.Value<DateTime> updatedAt,
|
i0.Value<DateTime> updatedAt,
|
||||||
i0.Value<String> ownerId,
|
i0.Value<String> ownerId,
|
||||||
i0.Value<String> primaryAssetId,
|
i0.Value<String> primaryAssetId,
|
||||||
});
|
});
|
||||||
|
|
||||||
final class $$StackEntityTableReferences extends i0.BaseReferences<
|
final class $$StackEntityTableReferences
|
||||||
i0.GeneratedDatabase, i1.$StackEntityTable, i1.StackEntityData> {
|
extends
|
||||||
|
i0.BaseReferences<
|
||||||
|
i0.GeneratedDatabase,
|
||||||
|
i1.$StackEntityTable,
|
||||||
|
i1.StackEntityData
|
||||||
|
> {
|
||||||
$$StackEntityTableReferences(super.$_db, super.$_table, super.$_typedResult);
|
$$StackEntityTableReferences(super.$_db, super.$_table, super.$_typedResult);
|
||||||
|
|
||||||
static i4.$UserEntityTable _ownerIdTable(i0.GeneratedDatabase db) =>
|
static i4.$UserEntityTable _ownerIdTable(i0.GeneratedDatabase db) =>
|
||||||
i5.ReadDatabaseContainer(db)
|
i5.ReadDatabaseContainer(db)
|
||||||
.resultSet<i4.$UserEntityTable>('user_entity')
|
.resultSet<i4.$UserEntityTable>('user_entity')
|
||||||
.createAlias(i0.$_aliasNameGenerator(
|
.createAlias(
|
||||||
i5.ReadDatabaseContainer(db)
|
i0.$_aliasNameGenerator(
|
||||||
.resultSet<i1.$StackEntityTable>('stack_entity')
|
i5.ReadDatabaseContainer(
|
||||||
.ownerId,
|
db,
|
||||||
i5.ReadDatabaseContainer(db)
|
).resultSet<i1.$StackEntityTable>('stack_entity').ownerId,
|
||||||
.resultSet<i4.$UserEntityTable>('user_entity')
|
i5.ReadDatabaseContainer(
|
||||||
.id));
|
db,
|
||||||
|
).resultSet<i4.$UserEntityTable>('user_entity').id,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
i4.$$UserEntityTableProcessedTableManager get ownerId {
|
i4.$$UserEntityTableProcessedTableManager get ownerId {
|
||||||
final $_column = $_itemColumn<String>('owner_id')!;
|
final $_column = $_itemColumn<String>('owner_id')!;
|
||||||
|
|
||||||
final manager = i4
|
final manager = i4
|
||||||
.$$UserEntityTableTableManager(
|
.$$UserEntityTableTableManager(
|
||||||
|
$_db,
|
||||||
|
i5.ReadDatabaseContainer(
|
||||||
$_db,
|
$_db,
|
||||||
i5.ReadDatabaseContainer($_db)
|
).resultSet<i4.$UserEntityTable>('user_entity'),
|
||||||
.resultSet<i4.$UserEntityTable>('user_entity'))
|
)
|
||||||
.filter((f) => f.id.sqlEquals($_column));
|
.filter((f) => f.id.sqlEquals($_column));
|
||||||
final item = $_typedResult.readTableOrNull(_ownerIdTable($_db));
|
final item = $_typedResult.readTableOrNull(_ownerIdTable($_db));
|
||||||
if (item == null) return manager;
|
if (item == null) return manager;
|
||||||
return i0.ProcessedTableManager(
|
return i0.ProcessedTableManager(
|
||||||
manager.$state.copyWith(prefetchedData: [item]));
|
manager.$state.copyWith(prefetchedData: [item]),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -67,37 +78,49 @@ class $$StackEntityTableFilterComposer
|
||||||
super.$removeJoinBuilderFromRootComposer,
|
super.$removeJoinBuilderFromRootComposer,
|
||||||
});
|
});
|
||||||
i0.ColumnFilters<String> get id => $composableBuilder(
|
i0.ColumnFilters<String> get id => $composableBuilder(
|
||||||
column: $table.id, builder: (column) => i0.ColumnFilters(column));
|
column: $table.id,
|
||||||
|
builder: (column) => i0.ColumnFilters(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnFilters<DateTime> get createdAt => $composableBuilder(
|
i0.ColumnFilters<DateTime> get createdAt => $composableBuilder(
|
||||||
column: $table.createdAt, builder: (column) => i0.ColumnFilters(column));
|
column: $table.createdAt,
|
||||||
|
builder: (column) => i0.ColumnFilters(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnFilters<DateTime> get updatedAt => $composableBuilder(
|
i0.ColumnFilters<DateTime> get updatedAt => $composableBuilder(
|
||||||
column: $table.updatedAt, builder: (column) => i0.ColumnFilters(column));
|
column: $table.updatedAt,
|
||||||
|
builder: (column) => i0.ColumnFilters(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnFilters<String> get primaryAssetId => $composableBuilder(
|
i0.ColumnFilters<String> get primaryAssetId => $composableBuilder(
|
||||||
column: $table.primaryAssetId,
|
column: $table.primaryAssetId,
|
||||||
builder: (column) => i0.ColumnFilters(column));
|
builder: (column) => i0.ColumnFilters(column),
|
||||||
|
);
|
||||||
|
|
||||||
i4.$$UserEntityTableFilterComposer get ownerId {
|
i4.$$UserEntityTableFilterComposer get ownerId {
|
||||||
final i4.$$UserEntityTableFilterComposer composer = $composerBuilder(
|
final i4.$$UserEntityTableFilterComposer composer = $composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.ownerId,
|
getCurrentColumn: (t) => t.ownerId,
|
||||||
referencedTable: i5.ReadDatabaseContainer($db)
|
referencedTable: i5.ReadDatabaseContainer(
|
||||||
.resultSet<i4.$UserEntityTable>('user_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i4.$UserEntityTable>('user_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i4.$$UserEntityTableFilterComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i5.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i4.$UserEntityTable>('user_entity'),
|
}) => i4.$$UserEntityTableFilterComposer(
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$db: $db,
|
||||||
joinBuilder: joinBuilder,
|
$table: i5.ReadDatabaseContainer(
|
||||||
$removeJoinBuilderFromRootComposer:
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer,
|
).resultSet<i4.$UserEntityTable>('user_entity'),
|
||||||
));
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -112,39 +135,49 @@ class $$StackEntityTableOrderingComposer
|
||||||
super.$removeJoinBuilderFromRootComposer,
|
super.$removeJoinBuilderFromRootComposer,
|
||||||
});
|
});
|
||||||
i0.ColumnOrderings<String> get id => $composableBuilder(
|
i0.ColumnOrderings<String> get id => $composableBuilder(
|
||||||
column: $table.id, builder: (column) => i0.ColumnOrderings(column));
|
column: $table.id,
|
||||||
|
builder: (column) => i0.ColumnOrderings(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnOrderings<DateTime> get createdAt => $composableBuilder(
|
i0.ColumnOrderings<DateTime> get createdAt => $composableBuilder(
|
||||||
column: $table.createdAt,
|
column: $table.createdAt,
|
||||||
builder: (column) => i0.ColumnOrderings(column));
|
builder: (column) => i0.ColumnOrderings(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnOrderings<DateTime> get updatedAt => $composableBuilder(
|
i0.ColumnOrderings<DateTime> get updatedAt => $composableBuilder(
|
||||||
column: $table.updatedAt,
|
column: $table.updatedAt,
|
||||||
builder: (column) => i0.ColumnOrderings(column));
|
builder: (column) => i0.ColumnOrderings(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnOrderings<String> get primaryAssetId => $composableBuilder(
|
i0.ColumnOrderings<String> get primaryAssetId => $composableBuilder(
|
||||||
column: $table.primaryAssetId,
|
column: $table.primaryAssetId,
|
||||||
builder: (column) => i0.ColumnOrderings(column));
|
builder: (column) => i0.ColumnOrderings(column),
|
||||||
|
);
|
||||||
|
|
||||||
i4.$$UserEntityTableOrderingComposer get ownerId {
|
i4.$$UserEntityTableOrderingComposer get ownerId {
|
||||||
final i4.$$UserEntityTableOrderingComposer composer = $composerBuilder(
|
final i4.$$UserEntityTableOrderingComposer composer = $composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.ownerId,
|
getCurrentColumn: (t) => t.ownerId,
|
||||||
referencedTable: i5.ReadDatabaseContainer($db)
|
referencedTable: i5.ReadDatabaseContainer(
|
||||||
.resultSet<i4.$UserEntityTable>('user_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i4.$UserEntityTable>('user_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i4.$$UserEntityTableOrderingComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i5.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i4.$UserEntityTable>('user_entity'),
|
}) => i4.$$UserEntityTableOrderingComposer(
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$db: $db,
|
||||||
joinBuilder: joinBuilder,
|
$table: i5.ReadDatabaseContainer(
|
||||||
$removeJoinBuilderFromRootComposer:
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer,
|
).resultSet<i4.$UserEntityTable>('user_entity'),
|
||||||
));
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -168,46 +201,58 @@ class $$StackEntityTableAnnotationComposer
|
||||||
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
||||||
|
|
||||||
i0.GeneratedColumn<String> get primaryAssetId => $composableBuilder(
|
i0.GeneratedColumn<String> get primaryAssetId => $composableBuilder(
|
||||||
column: $table.primaryAssetId, builder: (column) => column);
|
column: $table.primaryAssetId,
|
||||||
|
builder: (column) => column,
|
||||||
|
);
|
||||||
|
|
||||||
i4.$$UserEntityTableAnnotationComposer get ownerId {
|
i4.$$UserEntityTableAnnotationComposer get ownerId {
|
||||||
final i4.$$UserEntityTableAnnotationComposer composer = $composerBuilder(
|
final i4.$$UserEntityTableAnnotationComposer composer = $composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.ownerId,
|
getCurrentColumn: (t) => t.ownerId,
|
||||||
referencedTable: i5.ReadDatabaseContainer($db)
|
referencedTable: i5.ReadDatabaseContainer(
|
||||||
.resultSet<i4.$UserEntityTable>('user_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i4.$UserEntityTable>('user_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i4.$$UserEntityTableAnnotationComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i5.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i4.$UserEntityTable>('user_entity'),
|
}) => i4.$$UserEntityTableAnnotationComposer(
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$db: $db,
|
||||||
joinBuilder: joinBuilder,
|
$table: i5.ReadDatabaseContainer(
|
||||||
$removeJoinBuilderFromRootComposer:
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer,
|
).resultSet<i4.$UserEntityTable>('user_entity'),
|
||||||
));
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class $$StackEntityTableTableManager extends i0.RootTableManager<
|
class $$StackEntityTableTableManager
|
||||||
i0.GeneratedDatabase,
|
extends
|
||||||
i1.$StackEntityTable,
|
i0.RootTableManager<
|
||||||
i1.StackEntityData,
|
i0.GeneratedDatabase,
|
||||||
i1.$$StackEntityTableFilterComposer,
|
i1.$StackEntityTable,
|
||||||
i1.$$StackEntityTableOrderingComposer,
|
i1.StackEntityData,
|
||||||
i1.$$StackEntityTableAnnotationComposer,
|
i1.$$StackEntityTableFilterComposer,
|
||||||
$$StackEntityTableCreateCompanionBuilder,
|
i1.$$StackEntityTableOrderingComposer,
|
||||||
$$StackEntityTableUpdateCompanionBuilder,
|
i1.$$StackEntityTableAnnotationComposer,
|
||||||
(i1.StackEntityData, i1.$$StackEntityTableReferences),
|
$$StackEntityTableCreateCompanionBuilder,
|
||||||
i1.StackEntityData,
|
$$StackEntityTableUpdateCompanionBuilder,
|
||||||
i0.PrefetchHooks Function({bool ownerId})> {
|
(i1.StackEntityData, i1.$$StackEntityTableReferences),
|
||||||
|
i1.StackEntityData,
|
||||||
|
i0.PrefetchHooks Function({bool ownerId})
|
||||||
|
> {
|
||||||
$$StackEntityTableTableManager(
|
$$StackEntityTableTableManager(
|
||||||
i0.GeneratedDatabase db, i1.$StackEntityTable table)
|
i0.GeneratedDatabase db,
|
||||||
: super(i0.TableManagerState(
|
i1.$StackEntityTable table,
|
||||||
|
) : super(
|
||||||
|
i0.TableManagerState(
|
||||||
db: db,
|
db: db,
|
||||||
table: table,
|
table: table,
|
||||||
createFilteringComposer: () =>
|
createFilteringComposer: () =>
|
||||||
|
|
@ -216,46 +261,49 @@ class $$StackEntityTableTableManager extends i0.RootTableManager<
|
||||||
i1.$$StackEntityTableOrderingComposer($db: db, $table: table),
|
i1.$$StackEntityTableOrderingComposer($db: db, $table: table),
|
||||||
createComputedFieldComposer: () =>
|
createComputedFieldComposer: () =>
|
||||||
i1.$$StackEntityTableAnnotationComposer($db: db, $table: table),
|
i1.$$StackEntityTableAnnotationComposer($db: db, $table: table),
|
||||||
updateCompanionCallback: ({
|
updateCompanionCallback:
|
||||||
i0.Value<String> id = const i0.Value.absent(),
|
({
|
||||||
i0.Value<DateTime> createdAt = const i0.Value.absent(),
|
i0.Value<String> id = const i0.Value.absent(),
|
||||||
i0.Value<DateTime> updatedAt = const i0.Value.absent(),
|
i0.Value<DateTime> createdAt = const i0.Value.absent(),
|
||||||
i0.Value<String> ownerId = const i0.Value.absent(),
|
i0.Value<DateTime> updatedAt = const i0.Value.absent(),
|
||||||
i0.Value<String> primaryAssetId = const i0.Value.absent(),
|
i0.Value<String> ownerId = const i0.Value.absent(),
|
||||||
}) =>
|
i0.Value<String> primaryAssetId = const i0.Value.absent(),
|
||||||
i1.StackEntityCompanion(
|
}) => i1.StackEntityCompanion(
|
||||||
id: id,
|
id: id,
|
||||||
createdAt: createdAt,
|
createdAt: createdAt,
|
||||||
updatedAt: updatedAt,
|
updatedAt: updatedAt,
|
||||||
ownerId: ownerId,
|
ownerId: ownerId,
|
||||||
primaryAssetId: primaryAssetId,
|
primaryAssetId: primaryAssetId,
|
||||||
),
|
),
|
||||||
createCompanionCallback: ({
|
createCompanionCallback:
|
||||||
required String id,
|
({
|
||||||
i0.Value<DateTime> createdAt = const i0.Value.absent(),
|
required String id,
|
||||||
i0.Value<DateTime> updatedAt = const i0.Value.absent(),
|
i0.Value<DateTime> createdAt = const i0.Value.absent(),
|
||||||
required String ownerId,
|
i0.Value<DateTime> updatedAt = const i0.Value.absent(),
|
||||||
required String primaryAssetId,
|
required String ownerId,
|
||||||
}) =>
|
required String primaryAssetId,
|
||||||
i1.StackEntityCompanion.insert(
|
}) => i1.StackEntityCompanion.insert(
|
||||||
id: id,
|
id: id,
|
||||||
createdAt: createdAt,
|
createdAt: createdAt,
|
||||||
updatedAt: updatedAt,
|
updatedAt: updatedAt,
|
||||||
ownerId: ownerId,
|
ownerId: ownerId,
|
||||||
primaryAssetId: primaryAssetId,
|
primaryAssetId: primaryAssetId,
|
||||||
),
|
),
|
||||||
withReferenceMapper: (p0) => p0
|
withReferenceMapper: (p0) => p0
|
||||||
.map((e) => (
|
.map(
|
||||||
e.readTable(table),
|
(e) => (
|
||||||
i1.$$StackEntityTableReferences(db, table, e)
|
e.readTable(table),
|
||||||
))
|
i1.$$StackEntityTableReferences(db, table, e),
|
||||||
|
),
|
||||||
|
)
|
||||||
.toList(),
|
.toList(),
|
||||||
prefetchHooksCallback: ({ownerId = false}) {
|
prefetchHooksCallback: ({ownerId = false}) {
|
||||||
return i0.PrefetchHooks(
|
return i0.PrefetchHooks(
|
||||||
db: db,
|
db: db,
|
||||||
explicitlyWatchedTables: [],
|
explicitlyWatchedTables: [],
|
||||||
addJoins: <
|
addJoins:
|
||||||
T extends i0.TableManagerState<
|
<
|
||||||
|
T extends i0.TableManagerState<
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic,
|
dynamic,
|
||||||
|
|
@ -266,40 +314,49 @@ class $$StackEntityTableTableManager extends i0.RootTableManager<
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic>>(state) {
|
dynamic
|
||||||
if (ownerId) {
|
>
|
||||||
state = state.withJoin(
|
>(state) {
|
||||||
currentTable: table,
|
if (ownerId) {
|
||||||
currentColumn: table.ownerId,
|
state =
|
||||||
referencedTable:
|
state.withJoin(
|
||||||
i1.$$StackEntityTableReferences._ownerIdTable(db),
|
currentTable: table,
|
||||||
referencedColumn:
|
currentColumn: table.ownerId,
|
||||||
i1.$$StackEntityTableReferences._ownerIdTable(db).id,
|
referencedTable: i1.$$StackEntityTableReferences
|
||||||
) as T;
|
._ownerIdTable(db),
|
||||||
}
|
referencedColumn: i1
|
||||||
|
.$$StackEntityTableReferences
|
||||||
|
._ownerIdTable(db)
|
||||||
|
.id,
|
||||||
|
)
|
||||||
|
as T;
|
||||||
|
}
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
},
|
},
|
||||||
getPrefetchedDataCallback: (items) async {
|
getPrefetchedDataCallback: (items) async {
|
||||||
return [];
|
return [];
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
));
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef $$StackEntityTableProcessedTableManager = i0.ProcessedTableManager<
|
typedef $$StackEntityTableProcessedTableManager =
|
||||||
i0.GeneratedDatabase,
|
i0.ProcessedTableManager<
|
||||||
i1.$StackEntityTable,
|
i0.GeneratedDatabase,
|
||||||
i1.StackEntityData,
|
i1.$StackEntityTable,
|
||||||
i1.$$StackEntityTableFilterComposer,
|
i1.StackEntityData,
|
||||||
i1.$$StackEntityTableOrderingComposer,
|
i1.$$StackEntityTableFilterComposer,
|
||||||
i1.$$StackEntityTableAnnotationComposer,
|
i1.$$StackEntityTableOrderingComposer,
|
||||||
$$StackEntityTableCreateCompanionBuilder,
|
i1.$$StackEntityTableAnnotationComposer,
|
||||||
$$StackEntityTableUpdateCompanionBuilder,
|
$$StackEntityTableCreateCompanionBuilder,
|
||||||
(i1.StackEntityData, i1.$$StackEntityTableReferences),
|
$$StackEntityTableUpdateCompanionBuilder,
|
||||||
i1.StackEntityData,
|
(i1.StackEntityData, i1.$$StackEntityTableReferences),
|
||||||
i0.PrefetchHooks Function({bool ownerId})>;
|
i1.StackEntityData,
|
||||||
|
i0.PrefetchHooks Function({bool ownerId})
|
||||||
|
>;
|
||||||
|
|
||||||
class $StackEntityTable extends i2.StackEntity
|
class $StackEntityTable extends i2.StackEntity
|
||||||
with i0.TableInfo<$StackEntityTable, i1.StackEntityData> {
|
with i0.TableInfo<$StackEntityTable, i1.StackEntityData> {
|
||||||
|
|
@ -310,42 +367,71 @@ class $StackEntityTable extends i2.StackEntity
|
||||||
static const i0.VerificationMeta _idMeta = const i0.VerificationMeta('id');
|
static const i0.VerificationMeta _idMeta = const i0.VerificationMeta('id');
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumn<String> id = i0.GeneratedColumn<String>(
|
late final i0.GeneratedColumn<String> id = i0.GeneratedColumn<String>(
|
||||||
'id', aliasedName, false,
|
'id',
|
||||||
type: i0.DriftSqlType.string, requiredDuringInsert: true);
|
aliasedName,
|
||||||
static const i0.VerificationMeta _createdAtMeta =
|
false,
|
||||||
const i0.VerificationMeta('createdAt');
|
type: i0.DriftSqlType.string,
|
||||||
|
requiredDuringInsert: true,
|
||||||
|
);
|
||||||
|
static const i0.VerificationMeta _createdAtMeta = const i0.VerificationMeta(
|
||||||
|
'createdAt',
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumn<DateTime> createdAt =
|
late final i0.GeneratedColumn<DateTime> createdAt =
|
||||||
i0.GeneratedColumn<DateTime>('created_at', aliasedName, false,
|
i0.GeneratedColumn<DateTime>(
|
||||||
type: i0.DriftSqlType.dateTime,
|
'created_at',
|
||||||
requiredDuringInsert: false,
|
aliasedName,
|
||||||
defaultValue: i3.currentDateAndTime);
|
false,
|
||||||
static const i0.VerificationMeta _updatedAtMeta =
|
type: i0.DriftSqlType.dateTime,
|
||||||
const i0.VerificationMeta('updatedAt');
|
requiredDuringInsert: false,
|
||||||
|
defaultValue: i3.currentDateAndTime,
|
||||||
|
);
|
||||||
|
static const i0.VerificationMeta _updatedAtMeta = const i0.VerificationMeta(
|
||||||
|
'updatedAt',
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumn<DateTime> updatedAt =
|
late final i0.GeneratedColumn<DateTime> updatedAt =
|
||||||
i0.GeneratedColumn<DateTime>('updated_at', aliasedName, false,
|
i0.GeneratedColumn<DateTime>(
|
||||||
type: i0.DriftSqlType.dateTime,
|
'updated_at',
|
||||||
requiredDuringInsert: false,
|
aliasedName,
|
||||||
defaultValue: i3.currentDateAndTime);
|
false,
|
||||||
static const i0.VerificationMeta _ownerIdMeta =
|
type: i0.DriftSqlType.dateTime,
|
||||||
const i0.VerificationMeta('ownerId');
|
requiredDuringInsert: false,
|
||||||
|
defaultValue: i3.currentDateAndTime,
|
||||||
|
);
|
||||||
|
static const i0.VerificationMeta _ownerIdMeta = const i0.VerificationMeta(
|
||||||
|
'ownerId',
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumn<String> ownerId = i0.GeneratedColumn<String>(
|
late final i0.GeneratedColumn<String> ownerId = i0.GeneratedColumn<String>(
|
||||||
'owner_id', aliasedName, false,
|
'owner_id',
|
||||||
type: i0.DriftSqlType.string,
|
aliasedName,
|
||||||
requiredDuringInsert: true,
|
false,
|
||||||
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
|
type: i0.DriftSqlType.string,
|
||||||
'REFERENCES user_entity (id) ON DELETE CASCADE'));
|
requiredDuringInsert: true,
|
||||||
|
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
|
||||||
|
'REFERENCES user_entity (id) ON DELETE CASCADE',
|
||||||
|
),
|
||||||
|
);
|
||||||
static const i0.VerificationMeta _primaryAssetIdMeta =
|
static const i0.VerificationMeta _primaryAssetIdMeta =
|
||||||
const i0.VerificationMeta('primaryAssetId');
|
const i0.VerificationMeta('primaryAssetId');
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumn<String> primaryAssetId =
|
late final i0.GeneratedColumn<String> primaryAssetId =
|
||||||
i0.GeneratedColumn<String>('primary_asset_id', aliasedName, false,
|
i0.GeneratedColumn<String>(
|
||||||
type: i0.DriftSqlType.string, requiredDuringInsert: true);
|
'primary_asset_id',
|
||||||
|
aliasedName,
|
||||||
|
false,
|
||||||
|
type: i0.DriftSqlType.string,
|
||||||
|
requiredDuringInsert: true,
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
List<i0.GeneratedColumn> get $columns =>
|
List<i0.GeneratedColumn> get $columns => [
|
||||||
[id, createdAt, updatedAt, ownerId, primaryAssetId];
|
id,
|
||||||
|
createdAt,
|
||||||
|
updatedAt,
|
||||||
|
ownerId,
|
||||||
|
primaryAssetId,
|
||||||
|
];
|
||||||
@override
|
@override
|
||||||
String get aliasedName => _alias ?? actualTableName;
|
String get aliasedName => _alias ?? actualTableName;
|
||||||
@override
|
@override
|
||||||
|
|
@ -353,8 +439,9 @@ class $StackEntityTable extends i2.StackEntity
|
||||||
static const String $name = 'stack_entity';
|
static const String $name = 'stack_entity';
|
||||||
@override
|
@override
|
||||||
i0.VerificationContext validateIntegrity(
|
i0.VerificationContext validateIntegrity(
|
||||||
i0.Insertable<i1.StackEntityData> instance,
|
i0.Insertable<i1.StackEntityData> instance, {
|
||||||
{bool isInserting = false}) {
|
bool isInserting = false,
|
||||||
|
}) {
|
||||||
final context = i0.VerificationContext();
|
final context = i0.VerificationContext();
|
||||||
final data = instance.toColumns(true);
|
final data = instance.toColumns(true);
|
||||||
if (data.containsKey('id')) {
|
if (data.containsKey('id')) {
|
||||||
|
|
@ -363,24 +450,33 @@ class $StackEntityTable extends i2.StackEntity
|
||||||
context.missing(_idMeta);
|
context.missing(_idMeta);
|
||||||
}
|
}
|
||||||
if (data.containsKey('created_at')) {
|
if (data.containsKey('created_at')) {
|
||||||
context.handle(_createdAtMeta,
|
context.handle(
|
||||||
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta));
|
_createdAtMeta,
|
||||||
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (data.containsKey('updated_at')) {
|
if (data.containsKey('updated_at')) {
|
||||||
context.handle(_updatedAtMeta,
|
context.handle(
|
||||||
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta));
|
_updatedAtMeta,
|
||||||
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (data.containsKey('owner_id')) {
|
if (data.containsKey('owner_id')) {
|
||||||
context.handle(_ownerIdMeta,
|
context.handle(
|
||||||
ownerId.isAcceptableOrUnknown(data['owner_id']!, _ownerIdMeta));
|
_ownerIdMeta,
|
||||||
|
ownerId.isAcceptableOrUnknown(data['owner_id']!, _ownerIdMeta),
|
||||||
|
);
|
||||||
} else if (isInserting) {
|
} else if (isInserting) {
|
||||||
context.missing(_ownerIdMeta);
|
context.missing(_ownerIdMeta);
|
||||||
}
|
}
|
||||||
if (data.containsKey('primary_asset_id')) {
|
if (data.containsKey('primary_asset_id')) {
|
||||||
context.handle(
|
context.handle(
|
||||||
|
_primaryAssetIdMeta,
|
||||||
|
primaryAssetId.isAcceptableOrUnknown(
|
||||||
|
data['primary_asset_id']!,
|
||||||
_primaryAssetIdMeta,
|
_primaryAssetIdMeta,
|
||||||
primaryAssetId.isAcceptableOrUnknown(
|
),
|
||||||
data['primary_asset_id']!, _primaryAssetIdMeta));
|
);
|
||||||
} else if (isInserting) {
|
} else if (isInserting) {
|
||||||
context.missing(_primaryAssetIdMeta);
|
context.missing(_primaryAssetIdMeta);
|
||||||
}
|
}
|
||||||
|
|
@ -393,16 +489,26 @@ class $StackEntityTable extends i2.StackEntity
|
||||||
i1.StackEntityData map(Map<String, dynamic> data, {String? tablePrefix}) {
|
i1.StackEntityData map(Map<String, dynamic> data, {String? tablePrefix}) {
|
||||||
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
||||||
return i1.StackEntityData(
|
return i1.StackEntityData(
|
||||||
id: attachedDatabase.typeMapping
|
id: attachedDatabase.typeMapping.read(
|
||||||
.read(i0.DriftSqlType.string, data['${effectivePrefix}id'])!,
|
i0.DriftSqlType.string,
|
||||||
|
data['${effectivePrefix}id'],
|
||||||
|
)!,
|
||||||
createdAt: attachedDatabase.typeMapping.read(
|
createdAt: attachedDatabase.typeMapping.read(
|
||||||
i0.DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!,
|
i0.DriftSqlType.dateTime,
|
||||||
|
data['${effectivePrefix}created_at'],
|
||||||
|
)!,
|
||||||
updatedAt: attachedDatabase.typeMapping.read(
|
updatedAt: attachedDatabase.typeMapping.read(
|
||||||
i0.DriftSqlType.dateTime, data['${effectivePrefix}updated_at'])!,
|
i0.DriftSqlType.dateTime,
|
||||||
ownerId: attachedDatabase.typeMapping
|
data['${effectivePrefix}updated_at'],
|
||||||
.read(i0.DriftSqlType.string, data['${effectivePrefix}owner_id'])!,
|
)!,
|
||||||
|
ownerId: attachedDatabase.typeMapping.read(
|
||||||
|
i0.DriftSqlType.string,
|
||||||
|
data['${effectivePrefix}owner_id'],
|
||||||
|
)!,
|
||||||
primaryAssetId: attachedDatabase.typeMapping.read(
|
primaryAssetId: attachedDatabase.typeMapping.read(
|
||||||
i0.DriftSqlType.string, data['${effectivePrefix}primary_asset_id'])!,
|
i0.DriftSqlType.string,
|
||||||
|
data['${effectivePrefix}primary_asset_id'],
|
||||||
|
)!,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -424,12 +530,13 @@ class StackEntityData extends i0.DataClass
|
||||||
final DateTime updatedAt;
|
final DateTime updatedAt;
|
||||||
final String ownerId;
|
final String ownerId;
|
||||||
final String primaryAssetId;
|
final String primaryAssetId;
|
||||||
const StackEntityData(
|
const StackEntityData({
|
||||||
{required this.id,
|
required this.id,
|
||||||
required this.createdAt,
|
required this.createdAt,
|
||||||
required this.updatedAt,
|
required this.updatedAt,
|
||||||
required this.ownerId,
|
required this.ownerId,
|
||||||
required this.primaryAssetId});
|
required this.primaryAssetId,
|
||||||
|
});
|
||||||
@override
|
@override
|
||||||
Map<String, i0.Expression> toColumns(bool nullToAbsent) {
|
Map<String, i0.Expression> toColumns(bool nullToAbsent) {
|
||||||
final map = <String, i0.Expression>{};
|
final map = <String, i0.Expression>{};
|
||||||
|
|
@ -441,8 +548,10 @@ class StackEntityData extends i0.DataClass
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
factory StackEntityData.fromJson(Map<String, dynamic> json,
|
factory StackEntityData.fromJson(
|
||||||
{i0.ValueSerializer? serializer}) {
|
Map<String, dynamic> json, {
|
||||||
|
i0.ValueSerializer? serializer,
|
||||||
|
}) {
|
||||||
serializer ??= i0.driftRuntimeOptions.defaultSerializer;
|
serializer ??= i0.driftRuntimeOptions.defaultSerializer;
|
||||||
return StackEntityData(
|
return StackEntityData(
|
||||||
id: serializer.fromJson<String>(json['id']),
|
id: serializer.fromJson<String>(json['id']),
|
||||||
|
|
@ -464,19 +573,19 @@ class StackEntityData extends i0.DataClass
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
i1.StackEntityData copyWith(
|
i1.StackEntityData copyWith({
|
||||||
{String? id,
|
String? id,
|
||||||
DateTime? createdAt,
|
DateTime? createdAt,
|
||||||
DateTime? updatedAt,
|
DateTime? updatedAt,
|
||||||
String? ownerId,
|
String? ownerId,
|
||||||
String? primaryAssetId}) =>
|
String? primaryAssetId,
|
||||||
i1.StackEntityData(
|
}) => i1.StackEntityData(
|
||||||
id: id ?? this.id,
|
id: id ?? this.id,
|
||||||
createdAt: createdAt ?? this.createdAt,
|
createdAt: createdAt ?? this.createdAt,
|
||||||
updatedAt: updatedAt ?? this.updatedAt,
|
updatedAt: updatedAt ?? this.updatedAt,
|
||||||
ownerId: ownerId ?? this.ownerId,
|
ownerId: ownerId ?? this.ownerId,
|
||||||
primaryAssetId: primaryAssetId ?? this.primaryAssetId,
|
primaryAssetId: primaryAssetId ?? this.primaryAssetId,
|
||||||
);
|
);
|
||||||
StackEntityData copyWithCompanion(i1.StackEntityCompanion data) {
|
StackEntityData copyWithCompanion(i1.StackEntityCompanion data) {
|
||||||
return StackEntityData(
|
return StackEntityData(
|
||||||
id: data.id.present ? data.id.value : this.id,
|
id: data.id.present ? data.id.value : this.id,
|
||||||
|
|
@ -534,9 +643,9 @@ class StackEntityCompanion extends i0.UpdateCompanion<i1.StackEntityData> {
|
||||||
this.updatedAt = const i0.Value.absent(),
|
this.updatedAt = const i0.Value.absent(),
|
||||||
required String ownerId,
|
required String ownerId,
|
||||||
required String primaryAssetId,
|
required String primaryAssetId,
|
||||||
}) : id = i0.Value(id),
|
}) : id = i0.Value(id),
|
||||||
ownerId = i0.Value(ownerId),
|
ownerId = i0.Value(ownerId),
|
||||||
primaryAssetId = i0.Value(primaryAssetId);
|
primaryAssetId = i0.Value(primaryAssetId);
|
||||||
static i0.Insertable<i1.StackEntityData> custom({
|
static i0.Insertable<i1.StackEntityData> custom({
|
||||||
i0.Expression<String>? id,
|
i0.Expression<String>? id,
|
||||||
i0.Expression<DateTime>? createdAt,
|
i0.Expression<DateTime>? createdAt,
|
||||||
|
|
@ -553,12 +662,13 @@ class StackEntityCompanion extends i0.UpdateCompanion<i1.StackEntityData> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
i1.StackEntityCompanion copyWith(
|
i1.StackEntityCompanion copyWith({
|
||||||
{i0.Value<String>? id,
|
i0.Value<String>? id,
|
||||||
i0.Value<DateTime>? createdAt,
|
i0.Value<DateTime>? createdAt,
|
||||||
i0.Value<DateTime>? updatedAt,
|
i0.Value<DateTime>? updatedAt,
|
||||||
i0.Value<String>? ownerId,
|
i0.Value<String>? ownerId,
|
||||||
i0.Value<String>? primaryAssetId}) {
|
i0.Value<String>? primaryAssetId,
|
||||||
|
}) {
|
||||||
return i1.StackEntityCompanion(
|
return i1.StackEntityCompanion(
|
||||||
id: id ?? this.id,
|
id: id ?? this.id,
|
||||||
createdAt: createdAt ?? this.createdAt,
|
createdAt: createdAt ?? this.createdAt,
|
||||||
|
|
|
||||||
320
mobile/lib/infrastructure/entities/store.entity.g.dart
generated
320
mobile/lib/infrastructure/entities/store.entity.g.dart
generated
|
|
@ -17,17 +17,14 @@ const StoreValueSchema = CollectionSchema(
|
||||||
name: r'StoreValue',
|
name: r'StoreValue',
|
||||||
id: 902899285492123510,
|
id: 902899285492123510,
|
||||||
properties: {
|
properties: {
|
||||||
r'intValue': PropertySchema(
|
r'intValue': PropertySchema(id: 0, name: r'intValue', type: IsarType.long),
|
||||||
id: 0,
|
|
||||||
name: r'intValue',
|
|
||||||
type: IsarType.long,
|
|
||||||
),
|
|
||||||
r'strValue': PropertySchema(
|
r'strValue': PropertySchema(
|
||||||
id: 1,
|
id: 1,
|
||||||
name: r'strValue',
|
name: r'strValue',
|
||||||
type: IsarType.string,
|
type: IsarType.string,
|
||||||
)
|
),
|
||||||
},
|
},
|
||||||
|
|
||||||
estimateSize: _storeValueEstimateSize,
|
estimateSize: _storeValueEstimateSize,
|
||||||
serialize: _storeValueSerialize,
|
serialize: _storeValueSerialize,
|
||||||
deserialize: _storeValueDeserialize,
|
deserialize: _storeValueDeserialize,
|
||||||
|
|
@ -36,6 +33,7 @@ const StoreValueSchema = CollectionSchema(
|
||||||
indexes: {},
|
indexes: {},
|
||||||
links: {},
|
links: {},
|
||||||
embeddedSchemas: {},
|
embeddedSchemas: {},
|
||||||
|
|
||||||
getId: _storeValueGetId,
|
getId: _storeValueGetId,
|
||||||
getLinks: _storeValueGetLinks,
|
getLinks: _storeValueGetLinks,
|
||||||
attach: _storeValueAttach,
|
attach: _storeValueAttach,
|
||||||
|
|
@ -120,10 +118,7 @@ extension StoreValueQueryWhere
|
||||||
on QueryBuilder<StoreValue, StoreValue, QWhereClause> {
|
on QueryBuilder<StoreValue, StoreValue, QWhereClause> {
|
||||||
QueryBuilder<StoreValue, StoreValue, QAfterWhereClause> idEqualTo(Id id) {
|
QueryBuilder<StoreValue, StoreValue, QAfterWhereClause> idEqualTo(Id id) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(IdWhereClause.between(
|
return query.addWhereClause(IdWhereClause.between(lower: id, upper: id));
|
||||||
lower: id,
|
|
||||||
upper: id,
|
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -149,8 +144,10 @@ extension StoreValueQueryWhere
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<StoreValue, StoreValue, QAfterWhereClause> idGreaterThan(Id id,
|
QueryBuilder<StoreValue, StoreValue, QAfterWhereClause> idGreaterThan(
|
||||||
{bool include = false}) {
|
Id id, {
|
||||||
|
bool include = false,
|
||||||
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(
|
return query.addWhereClause(
|
||||||
IdWhereClause.greaterThan(lower: id, includeLower: include),
|
IdWhereClause.greaterThan(lower: id, includeLower: include),
|
||||||
|
|
@ -158,8 +155,10 @@ extension StoreValueQueryWhere
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<StoreValue, StoreValue, QAfterWhereClause> idLessThan(Id id,
|
QueryBuilder<StoreValue, StoreValue, QAfterWhereClause> idLessThan(
|
||||||
{bool include = false}) {
|
Id id, {
|
||||||
|
bool include = false,
|
||||||
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(
|
return query.addWhereClause(
|
||||||
IdWhereClause.lessThan(upper: id, includeUpper: include),
|
IdWhereClause.lessThan(upper: id, includeUpper: include),
|
||||||
|
|
@ -174,12 +173,14 @@ extension StoreValueQueryWhere
|
||||||
bool includeUpper = true,
|
bool includeUpper = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addWhereClause(IdWhereClause.between(
|
return query.addWhereClause(
|
||||||
lower: lowerId,
|
IdWhereClause.between(
|
||||||
includeLower: includeLower,
|
lower: lowerId,
|
||||||
upper: upperId,
|
includeLower: includeLower,
|
||||||
includeUpper: includeUpper,
|
upper: upperId,
|
||||||
));
|
includeUpper: includeUpper,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -187,12 +188,12 @@ extension StoreValueQueryWhere
|
||||||
extension StoreValueQueryFilter
|
extension StoreValueQueryFilter
|
||||||
on QueryBuilder<StoreValue, StoreValue, QFilterCondition> {
|
on QueryBuilder<StoreValue, StoreValue, QFilterCondition> {
|
||||||
QueryBuilder<StoreValue, StoreValue, QAfterFilterCondition> idEqualTo(
|
QueryBuilder<StoreValue, StoreValue, QAfterFilterCondition> idEqualTo(
|
||||||
Id value) {
|
Id value,
|
||||||
|
) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.equalTo(property: r'id', value: value),
|
||||||
value: value,
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -201,11 +202,13 @@ extension StoreValueQueryFilter
|
||||||
bool include = false,
|
bool include = false,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.greaterThan(
|
||||||
property: r'id',
|
include: include,
|
||||||
value: value,
|
property: r'id',
|
||||||
));
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -214,11 +217,13 @@ extension StoreValueQueryFilter
|
||||||
bool include = false,
|
bool include = false,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.lessThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.lessThan(
|
||||||
property: r'id',
|
include: include,
|
||||||
value: value,
|
property: r'id',
|
||||||
));
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -229,54 +234,55 @@ extension StoreValueQueryFilter
|
||||||
bool includeUpper = true,
|
bool includeUpper = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.between(
|
return query.addFilterCondition(
|
||||||
property: r'id',
|
FilterCondition.between(
|
||||||
lower: lower,
|
property: r'id',
|
||||||
includeLower: includeLower,
|
lower: lower,
|
||||||
upper: upper,
|
includeLower: includeLower,
|
||||||
includeUpper: includeUpper,
|
upper: upper,
|
||||||
));
|
includeUpper: includeUpper,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<StoreValue, StoreValue, QAfterFilterCondition> intValueIsNull() {
|
QueryBuilder<StoreValue, StoreValue, QAfterFilterCondition> intValueIsNull() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(const FilterCondition.isNull(
|
return query.addFilterCondition(
|
||||||
property: r'intValue',
|
const FilterCondition.isNull(property: r'intValue'),
|
||||||
));
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<StoreValue, StoreValue, QAfterFilterCondition>
|
QueryBuilder<StoreValue, StoreValue, QAfterFilterCondition>
|
||||||
intValueIsNotNull() {
|
intValueIsNotNull() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(const FilterCondition.isNotNull(
|
return query.addFilterCondition(
|
||||||
property: r'intValue',
|
const FilterCondition.isNotNull(property: r'intValue'),
|
||||||
));
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<StoreValue, StoreValue, QAfterFilterCondition> intValueEqualTo(
|
QueryBuilder<StoreValue, StoreValue, QAfterFilterCondition> intValueEqualTo(
|
||||||
int? value) {
|
int? value,
|
||||||
|
) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
return query.addFilterCondition(
|
||||||
property: r'intValue',
|
FilterCondition.equalTo(property: r'intValue', value: value),
|
||||||
value: value,
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<StoreValue, StoreValue, QAfterFilterCondition>
|
QueryBuilder<StoreValue, StoreValue, QAfterFilterCondition>
|
||||||
intValueGreaterThan(
|
intValueGreaterThan(int? value, {bool include = false}) {
|
||||||
int? value, {
|
|
||||||
bool include = false,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.greaterThan(
|
||||||
property: r'intValue',
|
include: include,
|
||||||
value: value,
|
property: r'intValue',
|
||||||
));
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -285,11 +291,13 @@ extension StoreValueQueryFilter
|
||||||
bool include = false,
|
bool include = false,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.lessThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.lessThan(
|
||||||
property: r'intValue',
|
include: include,
|
||||||
value: value,
|
property: r'intValue',
|
||||||
));
|
value: value,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -300,30 +308,32 @@ extension StoreValueQueryFilter
|
||||||
bool includeUpper = true,
|
bool includeUpper = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.between(
|
return query.addFilterCondition(
|
||||||
property: r'intValue',
|
FilterCondition.between(
|
||||||
lower: lower,
|
property: r'intValue',
|
||||||
includeLower: includeLower,
|
lower: lower,
|
||||||
upper: upper,
|
includeLower: includeLower,
|
||||||
includeUpper: includeUpper,
|
upper: upper,
|
||||||
));
|
includeUpper: includeUpper,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<StoreValue, StoreValue, QAfterFilterCondition> strValueIsNull() {
|
QueryBuilder<StoreValue, StoreValue, QAfterFilterCondition> strValueIsNull() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(const FilterCondition.isNull(
|
return query.addFilterCondition(
|
||||||
property: r'strValue',
|
const FilterCondition.isNull(property: r'strValue'),
|
||||||
));
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<StoreValue, StoreValue, QAfterFilterCondition>
|
QueryBuilder<StoreValue, StoreValue, QAfterFilterCondition>
|
||||||
strValueIsNotNull() {
|
strValueIsNotNull() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(const FilterCondition.isNotNull(
|
return query.addFilterCondition(
|
||||||
property: r'strValue',
|
const FilterCondition.isNotNull(property: r'strValue'),
|
||||||
));
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -332,27 +342,31 @@ extension StoreValueQueryFilter
|
||||||
bool caseSensitive = true,
|
bool caseSensitive = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
return query.addFilterCondition(
|
||||||
property: r'strValue',
|
FilterCondition.equalTo(
|
||||||
value: value,
|
property: r'strValue',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<StoreValue, StoreValue, QAfterFilterCondition>
|
QueryBuilder<StoreValue, StoreValue, QAfterFilterCondition>
|
||||||
strValueGreaterThan(
|
strValueGreaterThan(
|
||||||
String? value, {
|
String? value, {
|
||||||
bool include = false,
|
bool include = false,
|
||||||
bool caseSensitive = true,
|
bool caseSensitive = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.greaterThan(
|
||||||
property: r'strValue',
|
include: include,
|
||||||
value: value,
|
property: r'strValue',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -362,12 +376,14 @@ extension StoreValueQueryFilter
|
||||||
bool caseSensitive = true,
|
bool caseSensitive = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.lessThan(
|
return query.addFilterCondition(
|
||||||
include: include,
|
FilterCondition.lessThan(
|
||||||
property: r'strValue',
|
include: include,
|
||||||
value: value,
|
property: r'strValue',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -379,28 +395,29 @@ extension StoreValueQueryFilter
|
||||||
bool caseSensitive = true,
|
bool caseSensitive = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.between(
|
return query.addFilterCondition(
|
||||||
property: r'strValue',
|
FilterCondition.between(
|
||||||
lower: lower,
|
property: r'strValue',
|
||||||
includeLower: includeLower,
|
lower: lower,
|
||||||
upper: upper,
|
includeLower: includeLower,
|
||||||
includeUpper: includeUpper,
|
upper: upper,
|
||||||
caseSensitive: caseSensitive,
|
includeUpper: includeUpper,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<StoreValue, StoreValue, QAfterFilterCondition>
|
QueryBuilder<StoreValue, StoreValue, QAfterFilterCondition>
|
||||||
strValueStartsWith(
|
strValueStartsWith(String value, {bool caseSensitive = true}) {
|
||||||
String value, {
|
|
||||||
bool caseSensitive = true,
|
|
||||||
}) {
|
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.startsWith(
|
return query.addFilterCondition(
|
||||||
property: r'strValue',
|
FilterCondition.startsWith(
|
||||||
value: value,
|
property: r'strValue',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -409,55 +426,61 @@ extension StoreValueQueryFilter
|
||||||
bool caseSensitive = true,
|
bool caseSensitive = true,
|
||||||
}) {
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.endsWith(
|
return query.addFilterCondition(
|
||||||
property: r'strValue',
|
FilterCondition.endsWith(
|
||||||
value: value,
|
property: r'strValue',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<StoreValue, StoreValue, QAfterFilterCondition> strValueContains(
|
QueryBuilder<StoreValue, StoreValue, QAfterFilterCondition> strValueContains(
|
||||||
String value,
|
String value, {
|
||||||
{bool caseSensitive = true}) {
|
bool caseSensitive = true,
|
||||||
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.contains(
|
return query.addFilterCondition(
|
||||||
property: r'strValue',
|
FilterCondition.contains(
|
||||||
value: value,
|
property: r'strValue',
|
||||||
caseSensitive: caseSensitive,
|
value: value,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<StoreValue, StoreValue, QAfterFilterCondition> strValueMatches(
|
QueryBuilder<StoreValue, StoreValue, QAfterFilterCondition> strValueMatches(
|
||||||
String pattern,
|
String pattern, {
|
||||||
{bool caseSensitive = true}) {
|
bool caseSensitive = true,
|
||||||
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.matches(
|
return query.addFilterCondition(
|
||||||
property: r'strValue',
|
FilterCondition.matches(
|
||||||
wildcard: pattern,
|
property: r'strValue',
|
||||||
caseSensitive: caseSensitive,
|
wildcard: pattern,
|
||||||
));
|
caseSensitive: caseSensitive,
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<StoreValue, StoreValue, QAfterFilterCondition>
|
QueryBuilder<StoreValue, StoreValue, QAfterFilterCondition>
|
||||||
strValueIsEmpty() {
|
strValueIsEmpty() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.equalTo(
|
return query.addFilterCondition(
|
||||||
property: r'strValue',
|
FilterCondition.equalTo(property: r'strValue', value: ''),
|
||||||
value: '',
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<StoreValue, StoreValue, QAfterFilterCondition>
|
QueryBuilder<StoreValue, StoreValue, QAfterFilterCondition>
|
||||||
strValueIsNotEmpty() {
|
strValueIsNotEmpty() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(FilterCondition.greaterThan(
|
return query.addFilterCondition(
|
||||||
property: r'strValue',
|
FilterCondition.greaterThan(property: r'strValue', value: ''),
|
||||||
value: '',
|
);
|
||||||
));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -542,8 +565,9 @@ extension StoreValueQueryWhereDistinct
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryBuilder<StoreValue, StoreValue, QDistinct> distinctByStrValue(
|
QueryBuilder<StoreValue, StoreValue, QDistinct> distinctByStrValue({
|
||||||
{bool caseSensitive = true}) {
|
bool caseSensitive = true,
|
||||||
|
}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addDistinctBy(r'strValue', caseSensitive: caseSensitive);
|
return query.addDistinctBy(r'strValue', caseSensitive: caseSensitive);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -43,36 +43,36 @@ class User {
|
||||||
});
|
});
|
||||||
|
|
||||||
static User fromDto(UserDto dto) => User(
|
static User fromDto(UserDto dto) => User(
|
||||||
id: dto.id,
|
id: dto.id,
|
||||||
updatedAt: dto.updatedAt,
|
updatedAt: dto.updatedAt,
|
||||||
email: dto.email,
|
email: dto.email,
|
||||||
name: dto.name,
|
name: dto.name,
|
||||||
isAdmin: dto.isAdmin,
|
isAdmin: dto.isAdmin,
|
||||||
isPartnerSharedBy: dto.isPartnerSharedBy,
|
isPartnerSharedBy: dto.isPartnerSharedBy,
|
||||||
isPartnerSharedWith: dto.isPartnerSharedWith,
|
isPartnerSharedWith: dto.isPartnerSharedWith,
|
||||||
profileImagePath: dto.profileImagePath ?? "",
|
profileImagePath: dto.profileImagePath ?? "",
|
||||||
avatarColor: dto.avatarColor,
|
avatarColor: dto.avatarColor,
|
||||||
memoryEnabled: dto.memoryEnabled,
|
memoryEnabled: dto.memoryEnabled,
|
||||||
inTimeline: dto.inTimeline,
|
inTimeline: dto.inTimeline,
|
||||||
quotaUsageInBytes: dto.quotaUsageInBytes,
|
quotaUsageInBytes: dto.quotaUsageInBytes,
|
||||||
quotaSizeInBytes: dto.quotaSizeInBytes,
|
quotaSizeInBytes: dto.quotaSizeInBytes,
|
||||||
);
|
);
|
||||||
|
|
||||||
UserDto toDto() => UserDto(
|
UserDto toDto() => UserDto(
|
||||||
id: id,
|
id: id,
|
||||||
email: email,
|
email: email,
|
||||||
name: name,
|
name: name,
|
||||||
isAdmin: isAdmin,
|
isAdmin: isAdmin,
|
||||||
updatedAt: updatedAt,
|
updatedAt: updatedAt,
|
||||||
profileImagePath: profileImagePath.isEmpty ? null : profileImagePath,
|
profileImagePath: profileImagePath.isEmpty ? null : profileImagePath,
|
||||||
avatarColor: avatarColor,
|
avatarColor: avatarColor,
|
||||||
memoryEnabled: memoryEnabled,
|
memoryEnabled: memoryEnabled,
|
||||||
inTimeline: inTimeline,
|
inTimeline: inTimeline,
|
||||||
isPartnerSharedBy: isPartnerSharedBy,
|
isPartnerSharedBy: isPartnerSharedBy,
|
||||||
isPartnerSharedWith: isPartnerSharedWith,
|
isPartnerSharedWith: isPartnerSharedWith,
|
||||||
quotaUsageInBytes: quotaUsageInBytes,
|
quotaUsageInBytes: quotaUsageInBytes,
|
||||||
quotaSizeInBytes: quotaSizeInBytes,
|
quotaSizeInBytes: quotaSizeInBytes,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
class UserEntity extends Table with DriftDefaultsMixin {
|
class UserEntity extends Table with DriftDefaultsMixin {
|
||||||
|
|
|
||||||
|
|
@ -6,28 +6,28 @@ import 'package:immich_mobile/infrastructure/entities/user.entity.drift.dart'
|
||||||
import 'package:immich_mobile/infrastructure/entities/user.entity.dart' as i2;
|
import 'package:immich_mobile/infrastructure/entities/user.entity.dart' as i2;
|
||||||
import 'package:drift/src/runtime/query_builder/query_builder.dart' as i3;
|
import 'package:drift/src/runtime/query_builder/query_builder.dart' as i3;
|
||||||
|
|
||||||
typedef $$UserEntityTableCreateCompanionBuilder = i1.UserEntityCompanion
|
typedef $$UserEntityTableCreateCompanionBuilder =
|
||||||
Function({
|
i1.UserEntityCompanion Function({
|
||||||
required String id,
|
required String id,
|
||||||
required String name,
|
required String name,
|
||||||
i0.Value<bool> isAdmin,
|
i0.Value<bool> isAdmin,
|
||||||
required String email,
|
required String email,
|
||||||
i0.Value<String?> profileImagePath,
|
i0.Value<String?> profileImagePath,
|
||||||
i0.Value<DateTime> updatedAt,
|
i0.Value<DateTime> updatedAt,
|
||||||
i0.Value<int?> quotaSizeInBytes,
|
i0.Value<int?> quotaSizeInBytes,
|
||||||
i0.Value<int> quotaUsageInBytes,
|
i0.Value<int> quotaUsageInBytes,
|
||||||
});
|
});
|
||||||
typedef $$UserEntityTableUpdateCompanionBuilder = i1.UserEntityCompanion
|
typedef $$UserEntityTableUpdateCompanionBuilder =
|
||||||
Function({
|
i1.UserEntityCompanion Function({
|
||||||
i0.Value<String> id,
|
i0.Value<String> id,
|
||||||
i0.Value<String> name,
|
i0.Value<String> name,
|
||||||
i0.Value<bool> isAdmin,
|
i0.Value<bool> isAdmin,
|
||||||
i0.Value<String> email,
|
i0.Value<String> email,
|
||||||
i0.Value<String?> profileImagePath,
|
i0.Value<String?> profileImagePath,
|
||||||
i0.Value<DateTime> updatedAt,
|
i0.Value<DateTime> updatedAt,
|
||||||
i0.Value<int?> quotaSizeInBytes,
|
i0.Value<int?> quotaSizeInBytes,
|
||||||
i0.Value<int> quotaUsageInBytes,
|
i0.Value<int> quotaUsageInBytes,
|
||||||
});
|
});
|
||||||
|
|
||||||
class $$UserEntityTableFilterComposer
|
class $$UserEntityTableFilterComposer
|
||||||
extends i0.Composer<i0.GeneratedDatabase, i1.$UserEntityTable> {
|
extends i0.Composer<i0.GeneratedDatabase, i1.$UserEntityTable> {
|
||||||
|
|
@ -39,31 +39,44 @@ class $$UserEntityTableFilterComposer
|
||||||
super.$removeJoinBuilderFromRootComposer,
|
super.$removeJoinBuilderFromRootComposer,
|
||||||
});
|
});
|
||||||
i0.ColumnFilters<String> get id => $composableBuilder(
|
i0.ColumnFilters<String> get id => $composableBuilder(
|
||||||
column: $table.id, builder: (column) => i0.ColumnFilters(column));
|
column: $table.id,
|
||||||
|
builder: (column) => i0.ColumnFilters(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnFilters<String> get name => $composableBuilder(
|
i0.ColumnFilters<String> get name => $composableBuilder(
|
||||||
column: $table.name, builder: (column) => i0.ColumnFilters(column));
|
column: $table.name,
|
||||||
|
builder: (column) => i0.ColumnFilters(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnFilters<bool> get isAdmin => $composableBuilder(
|
i0.ColumnFilters<bool> get isAdmin => $composableBuilder(
|
||||||
column: $table.isAdmin, builder: (column) => i0.ColumnFilters(column));
|
column: $table.isAdmin,
|
||||||
|
builder: (column) => i0.ColumnFilters(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnFilters<String> get email => $composableBuilder(
|
i0.ColumnFilters<String> get email => $composableBuilder(
|
||||||
column: $table.email, builder: (column) => i0.ColumnFilters(column));
|
column: $table.email,
|
||||||
|
builder: (column) => i0.ColumnFilters(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnFilters<String> get profileImagePath => $composableBuilder(
|
i0.ColumnFilters<String> get profileImagePath => $composableBuilder(
|
||||||
column: $table.profileImagePath,
|
column: $table.profileImagePath,
|
||||||
builder: (column) => i0.ColumnFilters(column));
|
builder: (column) => i0.ColumnFilters(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnFilters<DateTime> get updatedAt => $composableBuilder(
|
i0.ColumnFilters<DateTime> get updatedAt => $composableBuilder(
|
||||||
column: $table.updatedAt, builder: (column) => i0.ColumnFilters(column));
|
column: $table.updatedAt,
|
||||||
|
builder: (column) => i0.ColumnFilters(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnFilters<int> get quotaSizeInBytes => $composableBuilder(
|
i0.ColumnFilters<int> get quotaSizeInBytes => $composableBuilder(
|
||||||
column: $table.quotaSizeInBytes,
|
column: $table.quotaSizeInBytes,
|
||||||
builder: (column) => i0.ColumnFilters(column));
|
builder: (column) => i0.ColumnFilters(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnFilters<int> get quotaUsageInBytes => $composableBuilder(
|
i0.ColumnFilters<int> get quotaUsageInBytes => $composableBuilder(
|
||||||
column: $table.quotaUsageInBytes,
|
column: $table.quotaUsageInBytes,
|
||||||
builder: (column) => i0.ColumnFilters(column));
|
builder: (column) => i0.ColumnFilters(column),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
class $$UserEntityTableOrderingComposer
|
class $$UserEntityTableOrderingComposer
|
||||||
|
|
@ -76,32 +89,44 @@ class $$UserEntityTableOrderingComposer
|
||||||
super.$removeJoinBuilderFromRootComposer,
|
super.$removeJoinBuilderFromRootComposer,
|
||||||
});
|
});
|
||||||
i0.ColumnOrderings<String> get id => $composableBuilder(
|
i0.ColumnOrderings<String> get id => $composableBuilder(
|
||||||
column: $table.id, builder: (column) => i0.ColumnOrderings(column));
|
column: $table.id,
|
||||||
|
builder: (column) => i0.ColumnOrderings(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnOrderings<String> get name => $composableBuilder(
|
i0.ColumnOrderings<String> get name => $composableBuilder(
|
||||||
column: $table.name, builder: (column) => i0.ColumnOrderings(column));
|
column: $table.name,
|
||||||
|
builder: (column) => i0.ColumnOrderings(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnOrderings<bool> get isAdmin => $composableBuilder(
|
i0.ColumnOrderings<bool> get isAdmin => $composableBuilder(
|
||||||
column: $table.isAdmin, builder: (column) => i0.ColumnOrderings(column));
|
column: $table.isAdmin,
|
||||||
|
builder: (column) => i0.ColumnOrderings(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnOrderings<String> get email => $composableBuilder(
|
i0.ColumnOrderings<String> get email => $composableBuilder(
|
||||||
column: $table.email, builder: (column) => i0.ColumnOrderings(column));
|
column: $table.email,
|
||||||
|
builder: (column) => i0.ColumnOrderings(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnOrderings<String> get profileImagePath => $composableBuilder(
|
i0.ColumnOrderings<String> get profileImagePath => $composableBuilder(
|
||||||
column: $table.profileImagePath,
|
column: $table.profileImagePath,
|
||||||
builder: (column) => i0.ColumnOrderings(column));
|
builder: (column) => i0.ColumnOrderings(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnOrderings<DateTime> get updatedAt => $composableBuilder(
|
i0.ColumnOrderings<DateTime> get updatedAt => $composableBuilder(
|
||||||
column: $table.updatedAt,
|
column: $table.updatedAt,
|
||||||
builder: (column) => i0.ColumnOrderings(column));
|
builder: (column) => i0.ColumnOrderings(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnOrderings<int> get quotaSizeInBytes => $composableBuilder(
|
i0.ColumnOrderings<int> get quotaSizeInBytes => $composableBuilder(
|
||||||
column: $table.quotaSizeInBytes,
|
column: $table.quotaSizeInBytes,
|
||||||
builder: (column) => i0.ColumnOrderings(column));
|
builder: (column) => i0.ColumnOrderings(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnOrderings<int> get quotaUsageInBytes => $composableBuilder(
|
i0.ColumnOrderings<int> get quotaUsageInBytes => $composableBuilder(
|
||||||
column: $table.quotaUsageInBytes,
|
column: $table.quotaUsageInBytes,
|
||||||
builder: (column) => i0.ColumnOrderings(column));
|
builder: (column) => i0.ColumnOrderings(column),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
class $$UserEntityTableAnnotationComposer
|
class $$UserEntityTableAnnotationComposer
|
||||||
|
|
@ -126,37 +151,51 @@ class $$UserEntityTableAnnotationComposer
|
||||||
$composableBuilder(column: $table.email, builder: (column) => column);
|
$composableBuilder(column: $table.email, builder: (column) => column);
|
||||||
|
|
||||||
i0.GeneratedColumn<String> get profileImagePath => $composableBuilder(
|
i0.GeneratedColumn<String> get profileImagePath => $composableBuilder(
|
||||||
column: $table.profileImagePath, builder: (column) => column);
|
column: $table.profileImagePath,
|
||||||
|
builder: (column) => column,
|
||||||
|
);
|
||||||
|
|
||||||
i0.GeneratedColumn<DateTime> get updatedAt =>
|
i0.GeneratedColumn<DateTime> get updatedAt =>
|
||||||
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
|
||||||
|
|
||||||
i0.GeneratedColumn<int> get quotaSizeInBytes => $composableBuilder(
|
i0.GeneratedColumn<int> get quotaSizeInBytes => $composableBuilder(
|
||||||
column: $table.quotaSizeInBytes, builder: (column) => column);
|
column: $table.quotaSizeInBytes,
|
||||||
|
builder: (column) => column,
|
||||||
|
);
|
||||||
|
|
||||||
i0.GeneratedColumn<int> get quotaUsageInBytes => $composableBuilder(
|
i0.GeneratedColumn<int> get quotaUsageInBytes => $composableBuilder(
|
||||||
column: $table.quotaUsageInBytes, builder: (column) => column);
|
column: $table.quotaUsageInBytes,
|
||||||
|
builder: (column) => column,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
class $$UserEntityTableTableManager extends i0.RootTableManager<
|
class $$UserEntityTableTableManager
|
||||||
i0.GeneratedDatabase,
|
extends
|
||||||
i1.$UserEntityTable,
|
i0.RootTableManager<
|
||||||
i1.UserEntityData,
|
i0.GeneratedDatabase,
|
||||||
i1.$$UserEntityTableFilterComposer,
|
i1.$UserEntityTable,
|
||||||
i1.$$UserEntityTableOrderingComposer,
|
i1.UserEntityData,
|
||||||
i1.$$UserEntityTableAnnotationComposer,
|
i1.$$UserEntityTableFilterComposer,
|
||||||
$$UserEntityTableCreateCompanionBuilder,
|
i1.$$UserEntityTableOrderingComposer,
|
||||||
$$UserEntityTableUpdateCompanionBuilder,
|
i1.$$UserEntityTableAnnotationComposer,
|
||||||
(
|
$$UserEntityTableCreateCompanionBuilder,
|
||||||
i1.UserEntityData,
|
$$UserEntityTableUpdateCompanionBuilder,
|
||||||
i0.BaseReferences<i0.GeneratedDatabase, i1.$UserEntityTable,
|
(
|
||||||
i1.UserEntityData>
|
i1.UserEntityData,
|
||||||
),
|
i0.BaseReferences<
|
||||||
i1.UserEntityData,
|
i0.GeneratedDatabase,
|
||||||
i0.PrefetchHooks Function()> {
|
i1.$UserEntityTable,
|
||||||
|
i1.UserEntityData
|
||||||
|
>,
|
||||||
|
),
|
||||||
|
i1.UserEntityData,
|
||||||
|
i0.PrefetchHooks Function()
|
||||||
|
> {
|
||||||
$$UserEntityTableTableManager(
|
$$UserEntityTableTableManager(
|
||||||
i0.GeneratedDatabase db, i1.$UserEntityTable table)
|
i0.GeneratedDatabase db,
|
||||||
: super(i0.TableManagerState(
|
i1.$UserEntityTable table,
|
||||||
|
) : super(
|
||||||
|
i0.TableManagerState(
|
||||||
db: db,
|
db: db,
|
||||||
table: table,
|
table: table,
|
||||||
createFilteringComposer: () =>
|
createFilteringComposer: () =>
|
||||||
|
|
@ -165,69 +204,75 @@ class $$UserEntityTableTableManager extends i0.RootTableManager<
|
||||||
i1.$$UserEntityTableOrderingComposer($db: db, $table: table),
|
i1.$$UserEntityTableOrderingComposer($db: db, $table: table),
|
||||||
createComputedFieldComposer: () =>
|
createComputedFieldComposer: () =>
|
||||||
i1.$$UserEntityTableAnnotationComposer($db: db, $table: table),
|
i1.$$UserEntityTableAnnotationComposer($db: db, $table: table),
|
||||||
updateCompanionCallback: ({
|
updateCompanionCallback:
|
||||||
i0.Value<String> id = const i0.Value.absent(),
|
({
|
||||||
i0.Value<String> name = const i0.Value.absent(),
|
i0.Value<String> id = const i0.Value.absent(),
|
||||||
i0.Value<bool> isAdmin = const i0.Value.absent(),
|
i0.Value<String> name = const i0.Value.absent(),
|
||||||
i0.Value<String> email = const i0.Value.absent(),
|
i0.Value<bool> isAdmin = const i0.Value.absent(),
|
||||||
i0.Value<String?> profileImagePath = const i0.Value.absent(),
|
i0.Value<String> email = const i0.Value.absent(),
|
||||||
i0.Value<DateTime> updatedAt = const i0.Value.absent(),
|
i0.Value<String?> profileImagePath = const i0.Value.absent(),
|
||||||
i0.Value<int?> quotaSizeInBytes = const i0.Value.absent(),
|
i0.Value<DateTime> updatedAt = const i0.Value.absent(),
|
||||||
i0.Value<int> quotaUsageInBytes = const i0.Value.absent(),
|
i0.Value<int?> quotaSizeInBytes = const i0.Value.absent(),
|
||||||
}) =>
|
i0.Value<int> quotaUsageInBytes = const i0.Value.absent(),
|
||||||
i1.UserEntityCompanion(
|
}) => i1.UserEntityCompanion(
|
||||||
id: id,
|
id: id,
|
||||||
name: name,
|
name: name,
|
||||||
isAdmin: isAdmin,
|
isAdmin: isAdmin,
|
||||||
email: email,
|
email: email,
|
||||||
profileImagePath: profileImagePath,
|
profileImagePath: profileImagePath,
|
||||||
updatedAt: updatedAt,
|
updatedAt: updatedAt,
|
||||||
quotaSizeInBytes: quotaSizeInBytes,
|
quotaSizeInBytes: quotaSizeInBytes,
|
||||||
quotaUsageInBytes: quotaUsageInBytes,
|
quotaUsageInBytes: quotaUsageInBytes,
|
||||||
),
|
),
|
||||||
createCompanionCallback: ({
|
createCompanionCallback:
|
||||||
required String id,
|
({
|
||||||
required String name,
|
required String id,
|
||||||
i0.Value<bool> isAdmin = const i0.Value.absent(),
|
required String name,
|
||||||
required String email,
|
i0.Value<bool> isAdmin = const i0.Value.absent(),
|
||||||
i0.Value<String?> profileImagePath = const i0.Value.absent(),
|
required String email,
|
||||||
i0.Value<DateTime> updatedAt = const i0.Value.absent(),
|
i0.Value<String?> profileImagePath = const i0.Value.absent(),
|
||||||
i0.Value<int?> quotaSizeInBytes = const i0.Value.absent(),
|
i0.Value<DateTime> updatedAt = const i0.Value.absent(),
|
||||||
i0.Value<int> quotaUsageInBytes = const i0.Value.absent(),
|
i0.Value<int?> quotaSizeInBytes = const i0.Value.absent(),
|
||||||
}) =>
|
i0.Value<int> quotaUsageInBytes = const i0.Value.absent(),
|
||||||
i1.UserEntityCompanion.insert(
|
}) => i1.UserEntityCompanion.insert(
|
||||||
id: id,
|
id: id,
|
||||||
name: name,
|
name: name,
|
||||||
isAdmin: isAdmin,
|
isAdmin: isAdmin,
|
||||||
email: email,
|
email: email,
|
||||||
profileImagePath: profileImagePath,
|
profileImagePath: profileImagePath,
|
||||||
updatedAt: updatedAt,
|
updatedAt: updatedAt,
|
||||||
quotaSizeInBytes: quotaSizeInBytes,
|
quotaSizeInBytes: quotaSizeInBytes,
|
||||||
quotaUsageInBytes: quotaUsageInBytes,
|
quotaUsageInBytes: quotaUsageInBytes,
|
||||||
),
|
),
|
||||||
withReferenceMapper: (p0) => p0
|
withReferenceMapper: (p0) => p0
|
||||||
.map((e) => (e.readTable(table), i0.BaseReferences(db, table, e)))
|
.map((e) => (e.readTable(table), i0.BaseReferences(db, table, e)))
|
||||||
.toList(),
|
.toList(),
|
||||||
prefetchHooksCallback: null,
|
prefetchHooksCallback: null,
|
||||||
));
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef $$UserEntityTableProcessedTableManager = i0.ProcessedTableManager<
|
typedef $$UserEntityTableProcessedTableManager =
|
||||||
i0.GeneratedDatabase,
|
i0.ProcessedTableManager<
|
||||||
i1.$UserEntityTable,
|
i0.GeneratedDatabase,
|
||||||
i1.UserEntityData,
|
i1.$UserEntityTable,
|
||||||
i1.$$UserEntityTableFilterComposer,
|
|
||||||
i1.$$UserEntityTableOrderingComposer,
|
|
||||||
i1.$$UserEntityTableAnnotationComposer,
|
|
||||||
$$UserEntityTableCreateCompanionBuilder,
|
|
||||||
$$UserEntityTableUpdateCompanionBuilder,
|
|
||||||
(
|
|
||||||
i1.UserEntityData,
|
i1.UserEntityData,
|
||||||
i0.BaseReferences<i0.GeneratedDatabase, i1.$UserEntityTable,
|
i1.$$UserEntityTableFilterComposer,
|
||||||
i1.UserEntityData>
|
i1.$$UserEntityTableOrderingComposer,
|
||||||
),
|
i1.$$UserEntityTableAnnotationComposer,
|
||||||
i1.UserEntityData,
|
$$UserEntityTableCreateCompanionBuilder,
|
||||||
i0.PrefetchHooks Function()>;
|
$$UserEntityTableUpdateCompanionBuilder,
|
||||||
|
(
|
||||||
|
i1.UserEntityData,
|
||||||
|
i0.BaseReferences<
|
||||||
|
i0.GeneratedDatabase,
|
||||||
|
i1.$UserEntityTable,
|
||||||
|
i1.UserEntityData
|
||||||
|
>,
|
||||||
|
),
|
||||||
|
i1.UserEntityData,
|
||||||
|
i0.PrefetchHooks Function()
|
||||||
|
>;
|
||||||
|
|
||||||
class $UserEntityTable extends i2.UserEntity
|
class $UserEntityTable extends i2.UserEntity
|
||||||
with i0.TableInfo<$UserEntityTable, i1.UserEntityData> {
|
with i0.TableInfo<$UserEntityTable, i1.UserEntityData> {
|
||||||
|
|
@ -238,69 +283,106 @@ class $UserEntityTable extends i2.UserEntity
|
||||||
static const i0.VerificationMeta _idMeta = const i0.VerificationMeta('id');
|
static const i0.VerificationMeta _idMeta = const i0.VerificationMeta('id');
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumn<String> id = i0.GeneratedColumn<String>(
|
late final i0.GeneratedColumn<String> id = i0.GeneratedColumn<String>(
|
||||||
'id', aliasedName, false,
|
'id',
|
||||||
type: i0.DriftSqlType.string, requiredDuringInsert: true);
|
aliasedName,
|
||||||
static const i0.VerificationMeta _nameMeta =
|
false,
|
||||||
const i0.VerificationMeta('name');
|
type: i0.DriftSqlType.string,
|
||||||
|
requiredDuringInsert: true,
|
||||||
|
);
|
||||||
|
static const i0.VerificationMeta _nameMeta = const i0.VerificationMeta(
|
||||||
|
'name',
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumn<String> name = i0.GeneratedColumn<String>(
|
late final i0.GeneratedColumn<String> name = i0.GeneratedColumn<String>(
|
||||||
'name', aliasedName, false,
|
'name',
|
||||||
type: i0.DriftSqlType.string, requiredDuringInsert: true);
|
aliasedName,
|
||||||
static const i0.VerificationMeta _isAdminMeta =
|
false,
|
||||||
const i0.VerificationMeta('isAdmin');
|
type: i0.DriftSqlType.string,
|
||||||
|
requiredDuringInsert: true,
|
||||||
|
);
|
||||||
|
static const i0.VerificationMeta _isAdminMeta = const i0.VerificationMeta(
|
||||||
|
'isAdmin',
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumn<bool> isAdmin = i0.GeneratedColumn<bool>(
|
late final i0.GeneratedColumn<bool> isAdmin = i0.GeneratedColumn<bool>(
|
||||||
'is_admin', aliasedName, false,
|
'is_admin',
|
||||||
type: i0.DriftSqlType.bool,
|
aliasedName,
|
||||||
requiredDuringInsert: false,
|
false,
|
||||||
defaultConstraints:
|
type: i0.DriftSqlType.bool,
|
||||||
i0.GeneratedColumn.constraintIsAlways('CHECK ("is_admin" IN (0, 1))'),
|
requiredDuringInsert: false,
|
||||||
defaultValue: const i3.Constant(false));
|
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
|
||||||
static const i0.VerificationMeta _emailMeta =
|
'CHECK ("is_admin" IN (0, 1))',
|
||||||
const i0.VerificationMeta('email');
|
),
|
||||||
|
defaultValue: const i3.Constant(false),
|
||||||
|
);
|
||||||
|
static const i0.VerificationMeta _emailMeta = const i0.VerificationMeta(
|
||||||
|
'email',
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumn<String> email = i0.GeneratedColumn<String>(
|
late final i0.GeneratedColumn<String> email = i0.GeneratedColumn<String>(
|
||||||
'email', aliasedName, false,
|
'email',
|
||||||
type: i0.DriftSqlType.string, requiredDuringInsert: true);
|
aliasedName,
|
||||||
|
false,
|
||||||
|
type: i0.DriftSqlType.string,
|
||||||
|
requiredDuringInsert: true,
|
||||||
|
);
|
||||||
static const i0.VerificationMeta _profileImagePathMeta =
|
static const i0.VerificationMeta _profileImagePathMeta =
|
||||||
const i0.VerificationMeta('profileImagePath');
|
const i0.VerificationMeta('profileImagePath');
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumn<String> profileImagePath =
|
late final i0.GeneratedColumn<String> profileImagePath =
|
||||||
i0.GeneratedColumn<String>('profile_image_path', aliasedName, true,
|
i0.GeneratedColumn<String>(
|
||||||
type: i0.DriftSqlType.string, requiredDuringInsert: false);
|
'profile_image_path',
|
||||||
static const i0.VerificationMeta _updatedAtMeta =
|
aliasedName,
|
||||||
const i0.VerificationMeta('updatedAt');
|
true,
|
||||||
|
type: i0.DriftSqlType.string,
|
||||||
|
requiredDuringInsert: false,
|
||||||
|
);
|
||||||
|
static const i0.VerificationMeta _updatedAtMeta = const i0.VerificationMeta(
|
||||||
|
'updatedAt',
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumn<DateTime> updatedAt =
|
late final i0.GeneratedColumn<DateTime> updatedAt =
|
||||||
i0.GeneratedColumn<DateTime>('updated_at', aliasedName, false,
|
i0.GeneratedColumn<DateTime>(
|
||||||
type: i0.DriftSqlType.dateTime,
|
'updated_at',
|
||||||
requiredDuringInsert: false,
|
aliasedName,
|
||||||
defaultValue: i3.currentDateAndTime);
|
false,
|
||||||
|
type: i0.DriftSqlType.dateTime,
|
||||||
|
requiredDuringInsert: false,
|
||||||
|
defaultValue: i3.currentDateAndTime,
|
||||||
|
);
|
||||||
static const i0.VerificationMeta _quotaSizeInBytesMeta =
|
static const i0.VerificationMeta _quotaSizeInBytesMeta =
|
||||||
const i0.VerificationMeta('quotaSizeInBytes');
|
const i0.VerificationMeta('quotaSizeInBytes');
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumn<int> quotaSizeInBytes = i0.GeneratedColumn<int>(
|
late final i0.GeneratedColumn<int> quotaSizeInBytes = i0.GeneratedColumn<int>(
|
||||||
'quota_size_in_bytes', aliasedName, true,
|
'quota_size_in_bytes',
|
||||||
type: i0.DriftSqlType.int, requiredDuringInsert: false);
|
aliasedName,
|
||||||
|
true,
|
||||||
|
type: i0.DriftSqlType.int,
|
||||||
|
requiredDuringInsert: false,
|
||||||
|
);
|
||||||
static const i0.VerificationMeta _quotaUsageInBytesMeta =
|
static const i0.VerificationMeta _quotaUsageInBytesMeta =
|
||||||
const i0.VerificationMeta('quotaUsageInBytes');
|
const i0.VerificationMeta('quotaUsageInBytes');
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumn<int> quotaUsageInBytes =
|
late final i0.GeneratedColumn<int> quotaUsageInBytes =
|
||||||
i0.GeneratedColumn<int>('quota_usage_in_bytes', aliasedName, false,
|
i0.GeneratedColumn<int>(
|
||||||
type: i0.DriftSqlType.int,
|
'quota_usage_in_bytes',
|
||||||
requiredDuringInsert: false,
|
aliasedName,
|
||||||
defaultValue: const i3.Constant(0));
|
false,
|
||||||
|
type: i0.DriftSqlType.int,
|
||||||
|
requiredDuringInsert: false,
|
||||||
|
defaultValue: const i3.Constant(0),
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
List<i0.GeneratedColumn> get $columns => [
|
List<i0.GeneratedColumn> get $columns => [
|
||||||
id,
|
id,
|
||||||
name,
|
name,
|
||||||
isAdmin,
|
isAdmin,
|
||||||
email,
|
email,
|
||||||
profileImagePath,
|
profileImagePath,
|
||||||
updatedAt,
|
updatedAt,
|
||||||
quotaSizeInBytes,
|
quotaSizeInBytes,
|
||||||
quotaUsageInBytes
|
quotaUsageInBytes,
|
||||||
];
|
];
|
||||||
@override
|
@override
|
||||||
String get aliasedName => _alias ?? actualTableName;
|
String get aliasedName => _alias ?? actualTableName;
|
||||||
@override
|
@override
|
||||||
|
|
@ -308,8 +390,9 @@ class $UserEntityTable extends i2.UserEntity
|
||||||
static const String $name = 'user_entity';
|
static const String $name = 'user_entity';
|
||||||
@override
|
@override
|
||||||
i0.VerificationContext validateIntegrity(
|
i0.VerificationContext validateIntegrity(
|
||||||
i0.Insertable<i1.UserEntityData> instance,
|
i0.Insertable<i1.UserEntityData> instance, {
|
||||||
{bool isInserting = false}) {
|
bool isInserting = false,
|
||||||
|
}) {
|
||||||
final context = i0.VerificationContext();
|
final context = i0.VerificationContext();
|
||||||
final data = instance.toColumns(true);
|
final data = instance.toColumns(true);
|
||||||
if (data.containsKey('id')) {
|
if (data.containsKey('id')) {
|
||||||
|
|
@ -319,41 +402,58 @@ class $UserEntityTable extends i2.UserEntity
|
||||||
}
|
}
|
||||||
if (data.containsKey('name')) {
|
if (data.containsKey('name')) {
|
||||||
context.handle(
|
context.handle(
|
||||||
_nameMeta, name.isAcceptableOrUnknown(data['name']!, _nameMeta));
|
_nameMeta,
|
||||||
|
name.isAcceptableOrUnknown(data['name']!, _nameMeta),
|
||||||
|
);
|
||||||
} else if (isInserting) {
|
} else if (isInserting) {
|
||||||
context.missing(_nameMeta);
|
context.missing(_nameMeta);
|
||||||
}
|
}
|
||||||
if (data.containsKey('is_admin')) {
|
if (data.containsKey('is_admin')) {
|
||||||
context.handle(_isAdminMeta,
|
context.handle(
|
||||||
isAdmin.isAcceptableOrUnknown(data['is_admin']!, _isAdminMeta));
|
_isAdminMeta,
|
||||||
|
isAdmin.isAcceptableOrUnknown(data['is_admin']!, _isAdminMeta),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (data.containsKey('email')) {
|
if (data.containsKey('email')) {
|
||||||
context.handle(
|
context.handle(
|
||||||
_emailMeta, email.isAcceptableOrUnknown(data['email']!, _emailMeta));
|
_emailMeta,
|
||||||
|
email.isAcceptableOrUnknown(data['email']!, _emailMeta),
|
||||||
|
);
|
||||||
} else if (isInserting) {
|
} else if (isInserting) {
|
||||||
context.missing(_emailMeta);
|
context.missing(_emailMeta);
|
||||||
}
|
}
|
||||||
if (data.containsKey('profile_image_path')) {
|
if (data.containsKey('profile_image_path')) {
|
||||||
context.handle(
|
context.handle(
|
||||||
|
_profileImagePathMeta,
|
||||||
|
profileImagePath.isAcceptableOrUnknown(
|
||||||
|
data['profile_image_path']!,
|
||||||
_profileImagePathMeta,
|
_profileImagePathMeta,
|
||||||
profileImagePath.isAcceptableOrUnknown(
|
),
|
||||||
data['profile_image_path']!, _profileImagePathMeta));
|
);
|
||||||
}
|
}
|
||||||
if (data.containsKey('updated_at')) {
|
if (data.containsKey('updated_at')) {
|
||||||
context.handle(_updatedAtMeta,
|
context.handle(
|
||||||
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta));
|
_updatedAtMeta,
|
||||||
|
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (data.containsKey('quota_size_in_bytes')) {
|
if (data.containsKey('quota_size_in_bytes')) {
|
||||||
context.handle(
|
context.handle(
|
||||||
|
_quotaSizeInBytesMeta,
|
||||||
|
quotaSizeInBytes.isAcceptableOrUnknown(
|
||||||
|
data['quota_size_in_bytes']!,
|
||||||
_quotaSizeInBytesMeta,
|
_quotaSizeInBytesMeta,
|
||||||
quotaSizeInBytes.isAcceptableOrUnknown(
|
),
|
||||||
data['quota_size_in_bytes']!, _quotaSizeInBytesMeta));
|
);
|
||||||
}
|
}
|
||||||
if (data.containsKey('quota_usage_in_bytes')) {
|
if (data.containsKey('quota_usage_in_bytes')) {
|
||||||
context.handle(
|
context.handle(
|
||||||
|
_quotaUsageInBytesMeta,
|
||||||
|
quotaUsageInBytes.isAcceptableOrUnknown(
|
||||||
|
data['quota_usage_in_bytes']!,
|
||||||
_quotaUsageInBytesMeta,
|
_quotaUsageInBytesMeta,
|
||||||
quotaUsageInBytes.isAcceptableOrUnknown(
|
),
|
||||||
data['quota_usage_in_bytes']!, _quotaUsageInBytesMeta));
|
);
|
||||||
}
|
}
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
@ -364,22 +464,38 @@ class $UserEntityTable extends i2.UserEntity
|
||||||
i1.UserEntityData map(Map<String, dynamic> data, {String? tablePrefix}) {
|
i1.UserEntityData map(Map<String, dynamic> data, {String? tablePrefix}) {
|
||||||
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
||||||
return i1.UserEntityData(
|
return i1.UserEntityData(
|
||||||
id: attachedDatabase.typeMapping
|
id: attachedDatabase.typeMapping.read(
|
||||||
.read(i0.DriftSqlType.string, data['${effectivePrefix}id'])!,
|
i0.DriftSqlType.string,
|
||||||
name: attachedDatabase.typeMapping
|
data['${effectivePrefix}id'],
|
||||||
.read(i0.DriftSqlType.string, data['${effectivePrefix}name'])!,
|
)!,
|
||||||
isAdmin: attachedDatabase.typeMapping
|
name: attachedDatabase.typeMapping.read(
|
||||||
.read(i0.DriftSqlType.bool, data['${effectivePrefix}is_admin'])!,
|
i0.DriftSqlType.string,
|
||||||
email: attachedDatabase.typeMapping
|
data['${effectivePrefix}name'],
|
||||||
.read(i0.DriftSqlType.string, data['${effectivePrefix}email'])!,
|
)!,
|
||||||
|
isAdmin: attachedDatabase.typeMapping.read(
|
||||||
|
i0.DriftSqlType.bool,
|
||||||
|
data['${effectivePrefix}is_admin'],
|
||||||
|
)!,
|
||||||
|
email: attachedDatabase.typeMapping.read(
|
||||||
|
i0.DriftSqlType.string,
|
||||||
|
data['${effectivePrefix}email'],
|
||||||
|
)!,
|
||||||
profileImagePath: attachedDatabase.typeMapping.read(
|
profileImagePath: attachedDatabase.typeMapping.read(
|
||||||
i0.DriftSqlType.string, data['${effectivePrefix}profile_image_path']),
|
i0.DriftSqlType.string,
|
||||||
|
data['${effectivePrefix}profile_image_path'],
|
||||||
|
),
|
||||||
updatedAt: attachedDatabase.typeMapping.read(
|
updatedAt: attachedDatabase.typeMapping.read(
|
||||||
i0.DriftSqlType.dateTime, data['${effectivePrefix}updated_at'])!,
|
i0.DriftSqlType.dateTime,
|
||||||
|
data['${effectivePrefix}updated_at'],
|
||||||
|
)!,
|
||||||
quotaSizeInBytes: attachedDatabase.typeMapping.read(
|
quotaSizeInBytes: attachedDatabase.typeMapping.read(
|
||||||
i0.DriftSqlType.int, data['${effectivePrefix}quota_size_in_bytes']),
|
i0.DriftSqlType.int,
|
||||||
|
data['${effectivePrefix}quota_size_in_bytes'],
|
||||||
|
),
|
||||||
quotaUsageInBytes: attachedDatabase.typeMapping.read(
|
quotaUsageInBytes: attachedDatabase.typeMapping.read(
|
||||||
i0.DriftSqlType.int, data['${effectivePrefix}quota_usage_in_bytes'])!,
|
i0.DriftSqlType.int,
|
||||||
|
data['${effectivePrefix}quota_usage_in_bytes'],
|
||||||
|
)!,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -404,15 +520,16 @@ class UserEntityData extends i0.DataClass
|
||||||
final DateTime updatedAt;
|
final DateTime updatedAt;
|
||||||
final int? quotaSizeInBytes;
|
final int? quotaSizeInBytes;
|
||||||
final int quotaUsageInBytes;
|
final int quotaUsageInBytes;
|
||||||
const UserEntityData(
|
const UserEntityData({
|
||||||
{required this.id,
|
required this.id,
|
||||||
required this.name,
|
required this.name,
|
||||||
required this.isAdmin,
|
required this.isAdmin,
|
||||||
required this.email,
|
required this.email,
|
||||||
this.profileImagePath,
|
this.profileImagePath,
|
||||||
required this.updatedAt,
|
required this.updatedAt,
|
||||||
this.quotaSizeInBytes,
|
this.quotaSizeInBytes,
|
||||||
required this.quotaUsageInBytes});
|
required this.quotaUsageInBytes,
|
||||||
|
});
|
||||||
@override
|
@override
|
||||||
Map<String, i0.Expression> toColumns(bool nullToAbsent) {
|
Map<String, i0.Expression> toColumns(bool nullToAbsent) {
|
||||||
final map = <String, i0.Expression>{};
|
final map = <String, i0.Expression>{};
|
||||||
|
|
@ -431,8 +548,10 @@ class UserEntityData extends i0.DataClass
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
factory UserEntityData.fromJson(Map<String, dynamic> json,
|
factory UserEntityData.fromJson(
|
||||||
{i0.ValueSerializer? serializer}) {
|
Map<String, dynamic> json, {
|
||||||
|
i0.ValueSerializer? serializer,
|
||||||
|
}) {
|
||||||
serializer ??= i0.driftRuntimeOptions.defaultSerializer;
|
serializer ??= i0.driftRuntimeOptions.defaultSerializer;
|
||||||
return UserEntityData(
|
return UserEntityData(
|
||||||
id: serializer.fromJson<String>(json['id']),
|
id: serializer.fromJson<String>(json['id']),
|
||||||
|
|
@ -460,29 +579,29 @@ class UserEntityData extends i0.DataClass
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
i1.UserEntityData copyWith(
|
i1.UserEntityData copyWith({
|
||||||
{String? id,
|
String? id,
|
||||||
String? name,
|
String? name,
|
||||||
bool? isAdmin,
|
bool? isAdmin,
|
||||||
String? email,
|
String? email,
|
||||||
i0.Value<String?> profileImagePath = const i0.Value.absent(),
|
i0.Value<String?> profileImagePath = const i0.Value.absent(),
|
||||||
DateTime? updatedAt,
|
DateTime? updatedAt,
|
||||||
i0.Value<int?> quotaSizeInBytes = const i0.Value.absent(),
|
i0.Value<int?> quotaSizeInBytes = const i0.Value.absent(),
|
||||||
int? quotaUsageInBytes}) =>
|
int? quotaUsageInBytes,
|
||||||
i1.UserEntityData(
|
}) => i1.UserEntityData(
|
||||||
id: id ?? this.id,
|
id: id ?? this.id,
|
||||||
name: name ?? this.name,
|
name: name ?? this.name,
|
||||||
isAdmin: isAdmin ?? this.isAdmin,
|
isAdmin: isAdmin ?? this.isAdmin,
|
||||||
email: email ?? this.email,
|
email: email ?? this.email,
|
||||||
profileImagePath: profileImagePath.present
|
profileImagePath: profileImagePath.present
|
||||||
? profileImagePath.value
|
? profileImagePath.value
|
||||||
: this.profileImagePath,
|
: this.profileImagePath,
|
||||||
updatedAt: updatedAt ?? this.updatedAt,
|
updatedAt: updatedAt ?? this.updatedAt,
|
||||||
quotaSizeInBytes: quotaSizeInBytes.present
|
quotaSizeInBytes: quotaSizeInBytes.present
|
||||||
? quotaSizeInBytes.value
|
? quotaSizeInBytes.value
|
||||||
: this.quotaSizeInBytes,
|
: this.quotaSizeInBytes,
|
||||||
quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes,
|
quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes,
|
||||||
);
|
);
|
||||||
UserEntityData copyWithCompanion(i1.UserEntityCompanion data) {
|
UserEntityData copyWithCompanion(i1.UserEntityCompanion data) {
|
||||||
return UserEntityData(
|
return UserEntityData(
|
||||||
id: data.id.present ? data.id.value : this.id,
|
id: data.id.present ? data.id.value : this.id,
|
||||||
|
|
@ -518,8 +637,16 @@ class UserEntityData extends i0.DataClass
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode => Object.hash(id, name, isAdmin, email, profileImagePath,
|
int get hashCode => Object.hash(
|
||||||
updatedAt, quotaSizeInBytes, quotaUsageInBytes);
|
id,
|
||||||
|
name,
|
||||||
|
isAdmin,
|
||||||
|
email,
|
||||||
|
profileImagePath,
|
||||||
|
updatedAt,
|
||||||
|
quotaSizeInBytes,
|
||||||
|
quotaUsageInBytes,
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) =>
|
bool operator ==(Object other) =>
|
||||||
identical(this, other) ||
|
identical(this, other) ||
|
||||||
|
|
@ -562,9 +689,9 @@ class UserEntityCompanion extends i0.UpdateCompanion<i1.UserEntityData> {
|
||||||
this.updatedAt = const i0.Value.absent(),
|
this.updatedAt = const i0.Value.absent(),
|
||||||
this.quotaSizeInBytes = const i0.Value.absent(),
|
this.quotaSizeInBytes = const i0.Value.absent(),
|
||||||
this.quotaUsageInBytes = const i0.Value.absent(),
|
this.quotaUsageInBytes = const i0.Value.absent(),
|
||||||
}) : id = i0.Value(id),
|
}) : id = i0.Value(id),
|
||||||
name = i0.Value(name),
|
name = i0.Value(name),
|
||||||
email = i0.Value(email);
|
email = i0.Value(email);
|
||||||
static i0.Insertable<i1.UserEntityData> custom({
|
static i0.Insertable<i1.UserEntityData> custom({
|
||||||
i0.Expression<String>? id,
|
i0.Expression<String>? id,
|
||||||
i0.Expression<String>? name,
|
i0.Expression<String>? name,
|
||||||
|
|
@ -587,15 +714,16 @@ class UserEntityCompanion extends i0.UpdateCompanion<i1.UserEntityData> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
i1.UserEntityCompanion copyWith(
|
i1.UserEntityCompanion copyWith({
|
||||||
{i0.Value<String>? id,
|
i0.Value<String>? id,
|
||||||
i0.Value<String>? name,
|
i0.Value<String>? name,
|
||||||
i0.Value<bool>? isAdmin,
|
i0.Value<bool>? isAdmin,
|
||||||
i0.Value<String>? email,
|
i0.Value<String>? email,
|
||||||
i0.Value<String?>? profileImagePath,
|
i0.Value<String?>? profileImagePath,
|
||||||
i0.Value<DateTime>? updatedAt,
|
i0.Value<DateTime>? updatedAt,
|
||||||
i0.Value<int?>? quotaSizeInBytes,
|
i0.Value<int?>? quotaSizeInBytes,
|
||||||
i0.Value<int>? quotaUsageInBytes}) {
|
i0.Value<int>? quotaUsageInBytes,
|
||||||
|
}) {
|
||||||
return i1.UserEntityCompanion(
|
return i1.UserEntityCompanion(
|
||||||
id: id ?? this.id,
|
id: id ?? this.id,
|
||||||
name: name ?? this.name,
|
name: name ?? this.name,
|
||||||
|
|
|
||||||
979
mobile/lib/infrastructure/entities/user.entity.g.dart
generated
979
mobile/lib/infrastructure/entities/user.entity.g.dart
generated
File diff suppressed because it is too large
Load diff
|
|
@ -11,51 +11,64 @@ import 'package:immich_mobile/infrastructure/entities/user.entity.drift.dart'
|
||||||
as i5;
|
as i5;
|
||||||
import 'package:drift/internal/modular.dart' as i6;
|
import 'package:drift/internal/modular.dart' as i6;
|
||||||
|
|
||||||
typedef $$UserMetadataEntityTableCreateCompanionBuilder
|
typedef $$UserMetadataEntityTableCreateCompanionBuilder =
|
||||||
= i1.UserMetadataEntityCompanion Function({
|
i1.UserMetadataEntityCompanion Function({
|
||||||
required String userId,
|
required String userId,
|
||||||
required i2.UserMetadataKey key,
|
required i2.UserMetadataKey key,
|
||||||
required Map<String, Object?> value,
|
required Map<String, Object?> value,
|
||||||
});
|
});
|
||||||
typedef $$UserMetadataEntityTableUpdateCompanionBuilder
|
typedef $$UserMetadataEntityTableUpdateCompanionBuilder =
|
||||||
= i1.UserMetadataEntityCompanion Function({
|
i1.UserMetadataEntityCompanion Function({
|
||||||
i0.Value<String> userId,
|
i0.Value<String> userId,
|
||||||
i0.Value<i2.UserMetadataKey> key,
|
i0.Value<i2.UserMetadataKey> key,
|
||||||
i0.Value<Map<String, Object?>> value,
|
i0.Value<Map<String, Object?>> value,
|
||||||
});
|
});
|
||||||
|
|
||||||
final class $$UserMetadataEntityTableReferences extends i0.BaseReferences<
|
final class $$UserMetadataEntityTableReferences
|
||||||
i0.GeneratedDatabase,
|
extends
|
||||||
i1.$UserMetadataEntityTable,
|
i0.BaseReferences<
|
||||||
i1.UserMetadataEntityData> {
|
i0.GeneratedDatabase,
|
||||||
|
i1.$UserMetadataEntityTable,
|
||||||
|
i1.UserMetadataEntityData
|
||||||
|
> {
|
||||||
$$UserMetadataEntityTableReferences(
|
$$UserMetadataEntityTableReferences(
|
||||||
super.$_db, super.$_table, super.$_typedResult);
|
super.$_db,
|
||||||
|
super.$_table,
|
||||||
|
super.$_typedResult,
|
||||||
|
);
|
||||||
|
|
||||||
static i5.$UserEntityTable _userIdTable(i0.GeneratedDatabase db) =>
|
static i5.$UserEntityTable _userIdTable(i0.GeneratedDatabase db) =>
|
||||||
i6.ReadDatabaseContainer(db)
|
i6.ReadDatabaseContainer(db)
|
||||||
.resultSet<i5.$UserEntityTable>('user_entity')
|
.resultSet<i5.$UserEntityTable>('user_entity')
|
||||||
.createAlias(i0.$_aliasNameGenerator(
|
.createAlias(
|
||||||
|
i0.$_aliasNameGenerator(
|
||||||
i6.ReadDatabaseContainer(db)
|
i6.ReadDatabaseContainer(db)
|
||||||
.resultSet<i1.$UserMetadataEntityTable>(
|
.resultSet<i1.$UserMetadataEntityTable>(
|
||||||
'user_metadata_entity')
|
'user_metadata_entity',
|
||||||
|
)
|
||||||
.userId,
|
.userId,
|
||||||
i6.ReadDatabaseContainer(db)
|
i6.ReadDatabaseContainer(
|
||||||
.resultSet<i5.$UserEntityTable>('user_entity')
|
db,
|
||||||
.id));
|
).resultSet<i5.$UserEntityTable>('user_entity').id,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
i5.$$UserEntityTableProcessedTableManager get userId {
|
i5.$$UserEntityTableProcessedTableManager get userId {
|
||||||
final $_column = $_itemColumn<String>('user_id')!;
|
final $_column = $_itemColumn<String>('user_id')!;
|
||||||
|
|
||||||
final manager = i5
|
final manager = i5
|
||||||
.$$UserEntityTableTableManager(
|
.$$UserEntityTableTableManager(
|
||||||
|
$_db,
|
||||||
|
i6.ReadDatabaseContainer(
|
||||||
$_db,
|
$_db,
|
||||||
i6.ReadDatabaseContainer($_db)
|
).resultSet<i5.$UserEntityTable>('user_entity'),
|
||||||
.resultSet<i5.$UserEntityTable>('user_entity'))
|
)
|
||||||
.filter((f) => f.id.sqlEquals($_column));
|
.filter((f) => f.id.sqlEquals($_column));
|
||||||
final item = $_typedResult.readTableOrNull(_userIdTable($_db));
|
final item = $_typedResult.readTableOrNull(_userIdTable($_db));
|
||||||
if (item == null) return manager;
|
if (item == null) return manager;
|
||||||
return i0.ProcessedTableManager(
|
return i0.ProcessedTableManager(
|
||||||
manager.$state.copyWith(prefetchedData: [item]));
|
manager.$state.copyWith(prefetchedData: [item]),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -69,35 +82,45 @@ class $$UserMetadataEntityTableFilterComposer
|
||||||
super.$removeJoinBuilderFromRootComposer,
|
super.$removeJoinBuilderFromRootComposer,
|
||||||
});
|
});
|
||||||
i0.ColumnWithTypeConverterFilters<i2.UserMetadataKey, i2.UserMetadataKey, int>
|
i0.ColumnWithTypeConverterFilters<i2.UserMetadataKey, i2.UserMetadataKey, int>
|
||||||
get key => $composableBuilder(
|
get key => $composableBuilder(
|
||||||
column: $table.key,
|
column: $table.key,
|
||||||
builder: (column) => i0.ColumnWithTypeConverterFilters(column));
|
builder: (column) => i0.ColumnWithTypeConverterFilters(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnWithTypeConverterFilters<Map<String, Object?>, Map<String, Object>,
|
i0.ColumnWithTypeConverterFilters<
|
||||||
i3.Uint8List>
|
Map<String, Object?>,
|
||||||
get value => $composableBuilder(
|
Map<String, Object>,
|
||||||
column: $table.value,
|
i3.Uint8List
|
||||||
builder: (column) => i0.ColumnWithTypeConverterFilters(column));
|
>
|
||||||
|
get value => $composableBuilder(
|
||||||
|
column: $table.value,
|
||||||
|
builder: (column) => i0.ColumnWithTypeConverterFilters(column),
|
||||||
|
);
|
||||||
|
|
||||||
i5.$$UserEntityTableFilterComposer get userId {
|
i5.$$UserEntityTableFilterComposer get userId {
|
||||||
final i5.$$UserEntityTableFilterComposer composer = $composerBuilder(
|
final i5.$$UserEntityTableFilterComposer composer = $composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.userId,
|
getCurrentColumn: (t) => t.userId,
|
||||||
referencedTable: i6.ReadDatabaseContainer($db)
|
referencedTable: i6.ReadDatabaseContainer(
|
||||||
.resultSet<i5.$UserEntityTable>('user_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i5.$UserEntityTable>('user_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i5.$$UserEntityTableFilterComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i6.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i5.$UserEntityTable>('user_entity'),
|
}) => i5.$$UserEntityTableFilterComposer(
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$db: $db,
|
||||||
joinBuilder: joinBuilder,
|
$table: i6.ReadDatabaseContainer(
|
||||||
$removeJoinBuilderFromRootComposer:
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer,
|
).resultSet<i5.$UserEntityTable>('user_entity'),
|
||||||
));
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -112,30 +135,39 @@ class $$UserMetadataEntityTableOrderingComposer
|
||||||
super.$removeJoinBuilderFromRootComposer,
|
super.$removeJoinBuilderFromRootComposer,
|
||||||
});
|
});
|
||||||
i0.ColumnOrderings<int> get key => $composableBuilder(
|
i0.ColumnOrderings<int> get key => $composableBuilder(
|
||||||
column: $table.key, builder: (column) => i0.ColumnOrderings(column));
|
column: $table.key,
|
||||||
|
builder: (column) => i0.ColumnOrderings(column),
|
||||||
|
);
|
||||||
|
|
||||||
i0.ColumnOrderings<i3.Uint8List> get value => $composableBuilder(
|
i0.ColumnOrderings<i3.Uint8List> get value => $composableBuilder(
|
||||||
column: $table.value, builder: (column) => i0.ColumnOrderings(column));
|
column: $table.value,
|
||||||
|
builder: (column) => i0.ColumnOrderings(column),
|
||||||
|
);
|
||||||
|
|
||||||
i5.$$UserEntityTableOrderingComposer get userId {
|
i5.$$UserEntityTableOrderingComposer get userId {
|
||||||
final i5.$$UserEntityTableOrderingComposer composer = $composerBuilder(
|
final i5.$$UserEntityTableOrderingComposer composer = $composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.userId,
|
getCurrentColumn: (t) => t.userId,
|
||||||
referencedTable: i6.ReadDatabaseContainer($db)
|
referencedTable: i6.ReadDatabaseContainer(
|
||||||
.resultSet<i5.$UserEntityTable>('user_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i5.$UserEntityTable>('user_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i5.$$UserEntityTableOrderingComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i6.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i5.$UserEntityTable>('user_entity'),
|
}) => i5.$$UserEntityTableOrderingComposer(
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$db: $db,
|
||||||
joinBuilder: joinBuilder,
|
$table: i6.ReadDatabaseContainer(
|
||||||
$removeJoinBuilderFromRootComposer:
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer,
|
).resultSet<i5.$UserEntityTable>('user_entity'),
|
||||||
));
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -153,89 +185,106 @@ class $$UserMetadataEntityTableAnnotationComposer
|
||||||
$composableBuilder(column: $table.key, builder: (column) => column);
|
$composableBuilder(column: $table.key, builder: (column) => column);
|
||||||
|
|
||||||
i0.GeneratedColumnWithTypeConverter<Map<String, Object?>, i3.Uint8List>
|
i0.GeneratedColumnWithTypeConverter<Map<String, Object?>, i3.Uint8List>
|
||||||
get value =>
|
get value =>
|
||||||
$composableBuilder(column: $table.value, builder: (column) => column);
|
$composableBuilder(column: $table.value, builder: (column) => column);
|
||||||
|
|
||||||
i5.$$UserEntityTableAnnotationComposer get userId {
|
i5.$$UserEntityTableAnnotationComposer get userId {
|
||||||
final i5.$$UserEntityTableAnnotationComposer composer = $composerBuilder(
|
final i5.$$UserEntityTableAnnotationComposer composer = $composerBuilder(
|
||||||
composer: this,
|
composer: this,
|
||||||
getCurrentColumn: (t) => t.userId,
|
getCurrentColumn: (t) => t.userId,
|
||||||
referencedTable: i6.ReadDatabaseContainer($db)
|
referencedTable: i6.ReadDatabaseContainer(
|
||||||
.resultSet<i5.$UserEntityTable>('user_entity'),
|
$db,
|
||||||
getReferencedColumn: (t) => t.id,
|
).resultSet<i5.$UserEntityTable>('user_entity'),
|
||||||
builder: (joinBuilder,
|
getReferencedColumn: (t) => t.id,
|
||||||
{$addJoinBuilderToRootComposer,
|
builder:
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
(
|
||||||
i5.$$UserEntityTableAnnotationComposer(
|
joinBuilder, {
|
||||||
$db: $db,
|
$addJoinBuilderToRootComposer,
|
||||||
$table: i6.ReadDatabaseContainer($db)
|
$removeJoinBuilderFromRootComposer,
|
||||||
.resultSet<i5.$UserEntityTable>('user_entity'),
|
}) => i5.$$UserEntityTableAnnotationComposer(
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
$db: $db,
|
||||||
joinBuilder: joinBuilder,
|
$table: i6.ReadDatabaseContainer(
|
||||||
$removeJoinBuilderFromRootComposer:
|
$db,
|
||||||
$removeJoinBuilderFromRootComposer,
|
).resultSet<i5.$UserEntityTable>('user_entity'),
|
||||||
));
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
),
|
||||||
|
);
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class $$UserMetadataEntityTableTableManager extends i0.RootTableManager<
|
class $$UserMetadataEntityTableTableManager
|
||||||
i0.GeneratedDatabase,
|
extends
|
||||||
i1.$UserMetadataEntityTable,
|
i0.RootTableManager<
|
||||||
i1.UserMetadataEntityData,
|
i0.GeneratedDatabase,
|
||||||
i1.$$UserMetadataEntityTableFilterComposer,
|
i1.$UserMetadataEntityTable,
|
||||||
i1.$$UserMetadataEntityTableOrderingComposer,
|
i1.UserMetadataEntityData,
|
||||||
i1.$$UserMetadataEntityTableAnnotationComposer,
|
i1.$$UserMetadataEntityTableFilterComposer,
|
||||||
$$UserMetadataEntityTableCreateCompanionBuilder,
|
i1.$$UserMetadataEntityTableOrderingComposer,
|
||||||
$$UserMetadataEntityTableUpdateCompanionBuilder,
|
i1.$$UserMetadataEntityTableAnnotationComposer,
|
||||||
(i1.UserMetadataEntityData, i1.$$UserMetadataEntityTableReferences),
|
$$UserMetadataEntityTableCreateCompanionBuilder,
|
||||||
i1.UserMetadataEntityData,
|
$$UserMetadataEntityTableUpdateCompanionBuilder,
|
||||||
i0.PrefetchHooks Function({bool userId})> {
|
(i1.UserMetadataEntityData, i1.$$UserMetadataEntityTableReferences),
|
||||||
|
i1.UserMetadataEntityData,
|
||||||
|
i0.PrefetchHooks Function({bool userId})
|
||||||
|
> {
|
||||||
$$UserMetadataEntityTableTableManager(
|
$$UserMetadataEntityTableTableManager(
|
||||||
i0.GeneratedDatabase db, i1.$UserMetadataEntityTable table)
|
i0.GeneratedDatabase db,
|
||||||
: super(i0.TableManagerState(
|
i1.$UserMetadataEntityTable table,
|
||||||
|
) : super(
|
||||||
|
i0.TableManagerState(
|
||||||
db: db,
|
db: db,
|
||||||
table: table,
|
table: table,
|
||||||
createFilteringComposer: () => i1
|
createFilteringComposer: () => i1
|
||||||
.$$UserMetadataEntityTableFilterComposer($db: db, $table: table),
|
.$$UserMetadataEntityTableFilterComposer($db: db, $table: table),
|
||||||
createOrderingComposer: () =>
|
createOrderingComposer: () =>
|
||||||
i1.$$UserMetadataEntityTableOrderingComposer(
|
i1.$$UserMetadataEntityTableOrderingComposer(
|
||||||
$db: db, $table: table),
|
$db: db,
|
||||||
|
$table: table,
|
||||||
|
),
|
||||||
createComputedFieldComposer: () =>
|
createComputedFieldComposer: () =>
|
||||||
i1.$$UserMetadataEntityTableAnnotationComposer(
|
i1.$$UserMetadataEntityTableAnnotationComposer(
|
||||||
$db: db, $table: table),
|
$db: db,
|
||||||
updateCompanionCallback: ({
|
$table: table,
|
||||||
i0.Value<String> userId = const i0.Value.absent(),
|
),
|
||||||
i0.Value<i2.UserMetadataKey> key = const i0.Value.absent(),
|
updateCompanionCallback:
|
||||||
i0.Value<Map<String, Object?>> value = const i0.Value.absent(),
|
({
|
||||||
}) =>
|
i0.Value<String> userId = const i0.Value.absent(),
|
||||||
i1.UserMetadataEntityCompanion(
|
i0.Value<i2.UserMetadataKey> key = const i0.Value.absent(),
|
||||||
userId: userId,
|
i0.Value<Map<String, Object?>> value = const i0.Value.absent(),
|
||||||
key: key,
|
}) => i1.UserMetadataEntityCompanion(
|
||||||
value: value,
|
userId: userId,
|
||||||
),
|
key: key,
|
||||||
createCompanionCallback: ({
|
value: value,
|
||||||
required String userId,
|
),
|
||||||
required i2.UserMetadataKey key,
|
createCompanionCallback:
|
||||||
required Map<String, Object?> value,
|
({
|
||||||
}) =>
|
required String userId,
|
||||||
i1.UserMetadataEntityCompanion.insert(
|
required i2.UserMetadataKey key,
|
||||||
userId: userId,
|
required Map<String, Object?> value,
|
||||||
key: key,
|
}) => i1.UserMetadataEntityCompanion.insert(
|
||||||
value: value,
|
userId: userId,
|
||||||
),
|
key: key,
|
||||||
|
value: value,
|
||||||
|
),
|
||||||
withReferenceMapper: (p0) => p0
|
withReferenceMapper: (p0) => p0
|
||||||
.map((e) => (
|
.map(
|
||||||
e.readTable(table),
|
(e) => (
|
||||||
i1.$$UserMetadataEntityTableReferences(db, table, e)
|
e.readTable(table),
|
||||||
))
|
i1.$$UserMetadataEntityTableReferences(db, table, e),
|
||||||
|
),
|
||||||
|
)
|
||||||
.toList(),
|
.toList(),
|
||||||
prefetchHooksCallback: ({userId = false}) {
|
prefetchHooksCallback: ({userId = false}) {
|
||||||
return i0.PrefetchHooks(
|
return i0.PrefetchHooks(
|
||||||
db: db,
|
db: db,
|
||||||
explicitlyWatchedTables: [],
|
explicitlyWatchedTables: [],
|
||||||
addJoins: <
|
addJoins:
|
||||||
T extends i0.TableManagerState<
|
<
|
||||||
|
T extends i0.TableManagerState<
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic,
|
dynamic,
|
||||||
|
|
@ -246,42 +295,50 @@ class $$UserMetadataEntityTableTableManager extends i0.RootTableManager<
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic,
|
dynamic,
|
||||||
dynamic>>(state) {
|
dynamic
|
||||||
if (userId) {
|
>
|
||||||
state = state.withJoin(
|
>(state) {
|
||||||
currentTable: table,
|
if (userId) {
|
||||||
currentColumn: table.userId,
|
state =
|
||||||
referencedTable:
|
state.withJoin(
|
||||||
i1.$$UserMetadataEntityTableReferences._userIdTable(db),
|
currentTable: table,
|
||||||
referencedColumn: i1.$$UserMetadataEntityTableReferences
|
currentColumn: table.userId,
|
||||||
._userIdTable(db)
|
referencedTable: i1
|
||||||
.id,
|
.$$UserMetadataEntityTableReferences
|
||||||
) as T;
|
._userIdTable(db),
|
||||||
}
|
referencedColumn: i1
|
||||||
|
.$$UserMetadataEntityTableReferences
|
||||||
|
._userIdTable(db)
|
||||||
|
.id,
|
||||||
|
)
|
||||||
|
as T;
|
||||||
|
}
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
},
|
},
|
||||||
getPrefetchedDataCallback: (items) async {
|
getPrefetchedDataCallback: (items) async {
|
||||||
return [];
|
return [];
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
));
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef $$UserMetadataEntityTableProcessedTableManager
|
typedef $$UserMetadataEntityTableProcessedTableManager =
|
||||||
= i0.ProcessedTableManager<
|
i0.ProcessedTableManager<
|
||||||
i0.GeneratedDatabase,
|
i0.GeneratedDatabase,
|
||||||
i1.$UserMetadataEntityTable,
|
i1.$UserMetadataEntityTable,
|
||||||
i1.UserMetadataEntityData,
|
i1.UserMetadataEntityData,
|
||||||
i1.$$UserMetadataEntityTableFilterComposer,
|
i1.$$UserMetadataEntityTableFilterComposer,
|
||||||
i1.$$UserMetadataEntityTableOrderingComposer,
|
i1.$$UserMetadataEntityTableOrderingComposer,
|
||||||
i1.$$UserMetadataEntityTableAnnotationComposer,
|
i1.$$UserMetadataEntityTableAnnotationComposer,
|
||||||
$$UserMetadataEntityTableCreateCompanionBuilder,
|
$$UserMetadataEntityTableCreateCompanionBuilder,
|
||||||
$$UserMetadataEntityTableUpdateCompanionBuilder,
|
$$UserMetadataEntityTableUpdateCompanionBuilder,
|
||||||
(i1.UserMetadataEntityData, i1.$$UserMetadataEntityTableReferences),
|
(i1.UserMetadataEntityData, i1.$$UserMetadataEntityTableReferences),
|
||||||
i1.UserMetadataEntityData,
|
i1.UserMetadataEntityData,
|
||||||
i0.PrefetchHooks Function({bool userId})>;
|
i0.PrefetchHooks Function({bool userId})
|
||||||
|
>;
|
||||||
|
|
||||||
class $UserMetadataEntityTable extends i4.UserMetadataEntity
|
class $UserMetadataEntityTable extends i4.UserMetadataEntity
|
||||||
with i0.TableInfo<$UserMetadataEntityTable, i1.UserMetadataEntityData> {
|
with i0.TableInfo<$UserMetadataEntityTable, i1.UserMetadataEntityData> {
|
||||||
|
|
@ -289,28 +346,46 @@ class $UserMetadataEntityTable extends i4.UserMetadataEntity
|
||||||
final i0.GeneratedDatabase attachedDatabase;
|
final i0.GeneratedDatabase attachedDatabase;
|
||||||
final String? _alias;
|
final String? _alias;
|
||||||
$UserMetadataEntityTable(this.attachedDatabase, [this._alias]);
|
$UserMetadataEntityTable(this.attachedDatabase, [this._alias]);
|
||||||
static const i0.VerificationMeta _userIdMeta =
|
static const i0.VerificationMeta _userIdMeta = const i0.VerificationMeta(
|
||||||
const i0.VerificationMeta('userId');
|
'userId',
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumn<String> userId = i0.GeneratedColumn<String>(
|
late final i0.GeneratedColumn<String> userId = i0.GeneratedColumn<String>(
|
||||||
'user_id', aliasedName, false,
|
'user_id',
|
||||||
type: i0.DriftSqlType.string,
|
aliasedName,
|
||||||
requiredDuringInsert: true,
|
false,
|
||||||
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
|
type: i0.DriftSqlType.string,
|
||||||
'REFERENCES user_entity (id) ON DELETE CASCADE'));
|
requiredDuringInsert: true,
|
||||||
|
defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
|
||||||
|
'REFERENCES user_entity (id) ON DELETE CASCADE',
|
||||||
|
),
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
late final i0.GeneratedColumnWithTypeConverter<i2.UserMetadataKey, int> key =
|
late final i0.GeneratedColumnWithTypeConverter<i2.UserMetadataKey, int> key =
|
||||||
i0.GeneratedColumn<int>('key', aliasedName, false,
|
i0.GeneratedColumn<int>(
|
||||||
type: i0.DriftSqlType.int, requiredDuringInsert: true)
|
'key',
|
||||||
.withConverter<i2.UserMetadataKey>(
|
aliasedName,
|
||||||
i1.$UserMetadataEntityTable.$converterkey);
|
false,
|
||||||
|
type: i0.DriftSqlType.int,
|
||||||
|
requiredDuringInsert: true,
|
||||||
|
).withConverter<i2.UserMetadataKey>(
|
||||||
|
i1.$UserMetadataEntityTable.$converterkey,
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
late final i0
|
late final i0.GeneratedColumnWithTypeConverter<
|
||||||
.GeneratedColumnWithTypeConverter<Map<String, Object?>, i3.Uint8List>
|
Map<String, Object?>,
|
||||||
value = i0.GeneratedColumn<i3.Uint8List>('value', aliasedName, false,
|
i3.Uint8List
|
||||||
type: i0.DriftSqlType.blob, requiredDuringInsert: true)
|
>
|
||||||
.withConverter<Map<String, Object?>>(
|
value =
|
||||||
i1.$UserMetadataEntityTable.$convertervalue);
|
i0.GeneratedColumn<i3.Uint8List>(
|
||||||
|
'value',
|
||||||
|
aliasedName,
|
||||||
|
false,
|
||||||
|
type: i0.DriftSqlType.blob,
|
||||||
|
requiredDuringInsert: true,
|
||||||
|
).withConverter<Map<String, Object?>>(
|
||||||
|
i1.$UserMetadataEntityTable.$convertervalue,
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
List<i0.GeneratedColumn> get $columns => [userId, key, value];
|
List<i0.GeneratedColumn> get $columns => [userId, key, value];
|
||||||
@override
|
@override
|
||||||
|
|
@ -320,13 +395,16 @@ class $UserMetadataEntityTable extends i4.UserMetadataEntity
|
||||||
static const String $name = 'user_metadata_entity';
|
static const String $name = 'user_metadata_entity';
|
||||||
@override
|
@override
|
||||||
i0.VerificationContext validateIntegrity(
|
i0.VerificationContext validateIntegrity(
|
||||||
i0.Insertable<i1.UserMetadataEntityData> instance,
|
i0.Insertable<i1.UserMetadataEntityData> instance, {
|
||||||
{bool isInserting = false}) {
|
bool isInserting = false,
|
||||||
|
}) {
|
||||||
final context = i0.VerificationContext();
|
final context = i0.VerificationContext();
|
||||||
final data = instance.toColumns(true);
|
final data = instance.toColumns(true);
|
||||||
if (data.containsKey('user_id')) {
|
if (data.containsKey('user_id')) {
|
||||||
context.handle(_userIdMeta,
|
context.handle(
|
||||||
userId.isAcceptableOrUnknown(data['user_id']!, _userIdMeta));
|
_userIdMeta,
|
||||||
|
userId.isAcceptableOrUnknown(data['user_id']!, _userIdMeta),
|
||||||
|
);
|
||||||
} else if (isInserting) {
|
} else if (isInserting) {
|
||||||
context.missing(_userIdMeta);
|
context.missing(_userIdMeta);
|
||||||
}
|
}
|
||||||
|
|
@ -336,18 +414,28 @@ class $UserMetadataEntityTable extends i4.UserMetadataEntity
|
||||||
@override
|
@override
|
||||||
Set<i0.GeneratedColumn> get $primaryKey => {userId, key};
|
Set<i0.GeneratedColumn> get $primaryKey => {userId, key};
|
||||||
@override
|
@override
|
||||||
i1.UserMetadataEntityData map(Map<String, dynamic> data,
|
i1.UserMetadataEntityData map(
|
||||||
{String? tablePrefix}) {
|
Map<String, dynamic> data, {
|
||||||
|
String? tablePrefix,
|
||||||
|
}) {
|
||||||
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
||||||
return i1.UserMetadataEntityData(
|
return i1.UserMetadataEntityData(
|
||||||
userId: attachedDatabase.typeMapping
|
userId: attachedDatabase.typeMapping.read(
|
||||||
.read(i0.DriftSqlType.string, data['${effectivePrefix}user_id'])!,
|
i0.DriftSqlType.string,
|
||||||
key: i1.$UserMetadataEntityTable.$converterkey.fromSql(attachedDatabase
|
data['${effectivePrefix}user_id'],
|
||||||
.typeMapping
|
)!,
|
||||||
.read(i0.DriftSqlType.int, data['${effectivePrefix}key'])!),
|
key: i1.$UserMetadataEntityTable.$converterkey.fromSql(
|
||||||
|
attachedDatabase.typeMapping.read(
|
||||||
|
i0.DriftSqlType.int,
|
||||||
|
data['${effectivePrefix}key'],
|
||||||
|
)!,
|
||||||
|
),
|
||||||
value: i1.$UserMetadataEntityTable.$convertervalue.fromSql(
|
value: i1.$UserMetadataEntityTable.$convertervalue.fromSql(
|
||||||
attachedDatabase.typeMapping
|
attachedDatabase.typeMapping.read(
|
||||||
.read(i0.DriftSqlType.blob, data['${effectivePrefix}value'])!),
|
i0.DriftSqlType.blob,
|
||||||
|
data['${effectivePrefix}value'],
|
||||||
|
)!,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -358,9 +446,10 @@ class $UserMetadataEntityTable extends i4.UserMetadataEntity
|
||||||
|
|
||||||
static i0.JsonTypeConverter2<i2.UserMetadataKey, int, int> $converterkey =
|
static i0.JsonTypeConverter2<i2.UserMetadataKey, int, int> $converterkey =
|
||||||
const i0.EnumIndexConverter<i2.UserMetadataKey>(
|
const i0.EnumIndexConverter<i2.UserMetadataKey>(
|
||||||
i2.UserMetadataKey.values);
|
i2.UserMetadataKey.values,
|
||||||
|
);
|
||||||
static i0.JsonTypeConverter2<Map<String, Object?>, i3.Uint8List, Object?>
|
static i0.JsonTypeConverter2<Map<String, Object?>, i3.Uint8List, Object?>
|
||||||
$convertervalue = i4.userMetadataConverter;
|
$convertervalue = i4.userMetadataConverter;
|
||||||
@override
|
@override
|
||||||
bool get withoutRowId => true;
|
bool get withoutRowId => true;
|
||||||
@override
|
@override
|
||||||
|
|
@ -372,32 +461,41 @@ class UserMetadataEntityData extends i0.DataClass
|
||||||
final String userId;
|
final String userId;
|
||||||
final i2.UserMetadataKey key;
|
final i2.UserMetadataKey key;
|
||||||
final Map<String, Object?> value;
|
final Map<String, Object?> value;
|
||||||
const UserMetadataEntityData(
|
const UserMetadataEntityData({
|
||||||
{required this.userId, required this.key, required this.value});
|
required this.userId,
|
||||||
|
required this.key,
|
||||||
|
required this.value,
|
||||||
|
});
|
||||||
@override
|
@override
|
||||||
Map<String, i0.Expression> toColumns(bool nullToAbsent) {
|
Map<String, i0.Expression> toColumns(bool nullToAbsent) {
|
||||||
final map = <String, i0.Expression>{};
|
final map = <String, i0.Expression>{};
|
||||||
map['user_id'] = i0.Variable<String>(userId);
|
map['user_id'] = i0.Variable<String>(userId);
|
||||||
{
|
{
|
||||||
map['key'] = i0.Variable<int>(
|
map['key'] = i0.Variable<int>(
|
||||||
i1.$UserMetadataEntityTable.$converterkey.toSql(key));
|
i1.$UserMetadataEntityTable.$converterkey.toSql(key),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
map['value'] = i0.Variable<i3.Uint8List>(
|
map['value'] = i0.Variable<i3.Uint8List>(
|
||||||
i1.$UserMetadataEntityTable.$convertervalue.toSql(value));
|
i1.$UserMetadataEntityTable.$convertervalue.toSql(value),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
factory UserMetadataEntityData.fromJson(Map<String, dynamic> json,
|
factory UserMetadataEntityData.fromJson(
|
||||||
{i0.ValueSerializer? serializer}) {
|
Map<String, dynamic> json, {
|
||||||
|
i0.ValueSerializer? serializer,
|
||||||
|
}) {
|
||||||
serializer ??= i0.driftRuntimeOptions.defaultSerializer;
|
serializer ??= i0.driftRuntimeOptions.defaultSerializer;
|
||||||
return UserMetadataEntityData(
|
return UserMetadataEntityData(
|
||||||
userId: serializer.fromJson<String>(json['userId']),
|
userId: serializer.fromJson<String>(json['userId']),
|
||||||
key: i1.$UserMetadataEntityTable.$converterkey
|
key: i1.$UserMetadataEntityTable.$converterkey.fromJson(
|
||||||
.fromJson(serializer.fromJson<int>(json['key'])),
|
serializer.fromJson<int>(json['key']),
|
||||||
value: i1.$UserMetadataEntityTable.$convertervalue
|
),
|
||||||
.fromJson(serializer.fromJson<Object?>(json['value'])),
|
value: i1.$UserMetadataEntityTable.$convertervalue.fromJson(
|
||||||
|
serializer.fromJson<Object?>(json['value']),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@override
|
@override
|
||||||
|
|
@ -405,24 +503,27 @@ class UserMetadataEntityData extends i0.DataClass
|
||||||
serializer ??= i0.driftRuntimeOptions.defaultSerializer;
|
serializer ??= i0.driftRuntimeOptions.defaultSerializer;
|
||||||
return <String, dynamic>{
|
return <String, dynamic>{
|
||||||
'userId': serializer.toJson<String>(userId),
|
'userId': serializer.toJson<String>(userId),
|
||||||
'key': serializer
|
'key': serializer.toJson<int>(
|
||||||
.toJson<int>(i1.$UserMetadataEntityTable.$converterkey.toJson(key)),
|
i1.$UserMetadataEntityTable.$converterkey.toJson(key),
|
||||||
|
),
|
||||||
'value': serializer.toJson<Object?>(
|
'value': serializer.toJson<Object?>(
|
||||||
i1.$UserMetadataEntityTable.$convertervalue.toJson(value)),
|
i1.$UserMetadataEntityTable.$convertervalue.toJson(value),
|
||||||
|
),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
i1.UserMetadataEntityData copyWith(
|
i1.UserMetadataEntityData copyWith({
|
||||||
{String? userId,
|
String? userId,
|
||||||
i2.UserMetadataKey? key,
|
i2.UserMetadataKey? key,
|
||||||
Map<String, Object?>? value}) =>
|
Map<String, Object?>? value,
|
||||||
i1.UserMetadataEntityData(
|
}) => i1.UserMetadataEntityData(
|
||||||
userId: userId ?? this.userId,
|
userId: userId ?? this.userId,
|
||||||
key: key ?? this.key,
|
key: key ?? this.key,
|
||||||
value: value ?? this.value,
|
value: value ?? this.value,
|
||||||
);
|
);
|
||||||
UserMetadataEntityData copyWithCompanion(
|
UserMetadataEntityData copyWithCompanion(
|
||||||
i1.UserMetadataEntityCompanion data) {
|
i1.UserMetadataEntityCompanion data,
|
||||||
|
) {
|
||||||
return UserMetadataEntityData(
|
return UserMetadataEntityData(
|
||||||
userId: data.userId.present ? data.userId.value : this.userId,
|
userId: data.userId.present ? data.userId.value : this.userId,
|
||||||
key: data.key.present ? data.key.value : this.key,
|
key: data.key.present ? data.key.value : this.key,
|
||||||
|
|
@ -465,9 +566,9 @@ class UserMetadataEntityCompanion
|
||||||
required String userId,
|
required String userId,
|
||||||
required i2.UserMetadataKey key,
|
required i2.UserMetadataKey key,
|
||||||
required Map<String, Object?> value,
|
required Map<String, Object?> value,
|
||||||
}) : userId = i0.Value(userId),
|
}) : userId = i0.Value(userId),
|
||||||
key = i0.Value(key),
|
key = i0.Value(key),
|
||||||
value = i0.Value(value);
|
value = i0.Value(value);
|
||||||
static i0.Insertable<i1.UserMetadataEntityData> custom({
|
static i0.Insertable<i1.UserMetadataEntityData> custom({
|
||||||
i0.Expression<String>? userId,
|
i0.Expression<String>? userId,
|
||||||
i0.Expression<int>? key,
|
i0.Expression<int>? key,
|
||||||
|
|
@ -480,10 +581,11 @@ class UserMetadataEntityCompanion
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
i1.UserMetadataEntityCompanion copyWith(
|
i1.UserMetadataEntityCompanion copyWith({
|
||||||
{i0.Value<String>? userId,
|
i0.Value<String>? userId,
|
||||||
i0.Value<i2.UserMetadataKey>? key,
|
i0.Value<i2.UserMetadataKey>? key,
|
||||||
i0.Value<Map<String, Object?>>? value}) {
|
i0.Value<Map<String, Object?>>? value,
|
||||||
|
}) {
|
||||||
return i1.UserMetadataEntityCompanion(
|
return i1.UserMetadataEntityCompanion(
|
||||||
userId: userId ?? this.userId,
|
userId: userId ?? this.userId,
|
||||||
key: key ?? this.key,
|
key: key ?? this.key,
|
||||||
|
|
@ -499,11 +601,13 @@ class UserMetadataEntityCompanion
|
||||||
}
|
}
|
||||||
if (key.present) {
|
if (key.present) {
|
||||||
map['key'] = i0.Variable<int>(
|
map['key'] = i0.Variable<int>(
|
||||||
i1.$UserMetadataEntityTable.$converterkey.toSql(key.value));
|
i1.$UserMetadataEntityTable.$converterkey.toSql(key.value),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (value.present) {
|
if (value.present) {
|
||||||
map['value'] = i0.Variable<i3.Uint8List>(
|
map['value'] = i0.Variable<i3.Uint8List>(
|
||||||
i1.$UserMetadataEntityTable.$convertervalue.toSql(value.value));
|
i1.$UserMetadataEntityTable.$convertervalue.toSql(value.value),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,21 +6,13 @@ import 'package:photo_manager/photo_manager.dart';
|
||||||
class AssetMediaRepository {
|
class AssetMediaRepository {
|
||||||
const AssetMediaRepository();
|
const AssetMediaRepository();
|
||||||
|
|
||||||
Future<Uint8List?> getThumbnail(
|
Future<Uint8List?> getThumbnail(String id, {int quality = 80, Size size = const Size.square(256)}) => AssetEntity(
|
||||||
String id, {
|
id: id,
|
||||||
int quality = 80,
|
// The below fields are not used in thumbnailDataWithSize but are required
|
||||||
Size size = const Size.square(256),
|
// to create an AssetEntity instance. It is faster to create a dummy AssetEntity
|
||||||
}) =>
|
// instance than to fetch the asset from the device first.
|
||||||
AssetEntity(
|
typeInt: AssetType.image.index,
|
||||||
id: id,
|
width: size.width.toInt(),
|
||||||
// The below fields are not used in thumbnailDataWithSize but are required
|
height: size.height.toInt(),
|
||||||
// to create an AssetEntity instance. It is faster to create a dummy AssetEntity
|
).thumbnailDataWithSize(ThumbnailSize(size.width.toInt(), size.height.toInt()), quality: quality);
|
||||||
// instance than to fetch the asset from the device first.
|
|
||||||
typeInt: AssetType.image.index,
|
|
||||||
width: size.width.toInt(),
|
|
||||||
height: size.height.toInt(),
|
|
||||||
).thumbnailDataWithSize(
|
|
||||||
ThumbnailSize(size.width.toInt(), size.height.toInt()),
|
|
||||||
quality: quality,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,7 @@ class DriftBackupRepository extends DriftDatabaseRepository {
|
||||||
useColumns: false,
|
useColumns: false,
|
||||||
),
|
),
|
||||||
])
|
])
|
||||||
..where(
|
..where(_db.localAlbumEntity.backupSelection.equalsValue(BackupSelection.excluded));
|
||||||
_db.localAlbumEntity.backupSelection.equalsValue(BackupSelection.excluded),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<int> getTotalCount() async {
|
Future<int> getTotalCount() async {
|
||||||
|
|
@ -79,9 +77,7 @@ class DriftBackupRepository extends DriftDatabaseRepository {
|
||||||
|
|
||||||
Future<int> getBackupCount(String userId) async {
|
Future<int> getBackupCount(String userId) async {
|
||||||
final query = _db.localAlbumAssetEntity.selectOnly(distinct: true)
|
final query = _db.localAlbumAssetEntity.selectOnly(distinct: true)
|
||||||
..addColumns(
|
..addColumns([_db.localAlbumAssetEntity.assetId])
|
||||||
[_db.localAlbumAssetEntity.assetId],
|
|
||||||
)
|
|
||||||
..join([
|
..join([
|
||||||
innerJoin(
|
innerJoin(
|
||||||
_db.localAlbumEntity,
|
_db.localAlbumEntity,
|
||||||
|
|
@ -112,9 +108,7 @@ class DriftBackupRepository extends DriftDatabaseRepository {
|
||||||
Future<List<LocalAsset>> getCandidates(String userId) async {
|
Future<List<LocalAsset>> getCandidates(String userId) async {
|
||||||
final selectedAlbumIds = _db.localAlbumEntity.selectOnly(distinct: true)
|
final selectedAlbumIds = _db.localAlbumEntity.selectOnly(distinct: true)
|
||||||
..addColumns([_db.localAlbumEntity.id])
|
..addColumns([_db.localAlbumEntity.id])
|
||||||
..where(
|
..where(_db.localAlbumEntity.backupSelection.equalsValue(BackupSelection.selected));
|
||||||
_db.localAlbumEntity.backupSelection.equalsValue(BackupSelection.selected),
|
|
||||||
);
|
|
||||||
|
|
||||||
final query = _db.localAssetEntity.select()
|
final query = _db.localAssetEntity.select()
|
||||||
..where(
|
..where(
|
||||||
|
|
@ -138,11 +132,7 @@ class DriftBackupRepository extends DriftDatabaseRepository {
|
||||||
) &
|
) &
|
||||||
lae.id.isNotInQuery(_getExcludedSubquery()),
|
lae.id.isNotInQuery(_getExcludedSubquery()),
|
||||||
)
|
)
|
||||||
..orderBy(
|
..orderBy([(localAsset) => OrderingTerm.desc(localAsset.createdAt)]);
|
||||||
[
|
|
||||||
(localAsset) => OrderingTerm.desc(localAsset.createdAt),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
|
|
||||||
return query.map((localAsset) => localAsset.toDto()).get();
|
return query.map((localAsset) => localAsset.toDto()).get();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,66 +59,58 @@ class IsarDatabaseRepository implements IDatabaseRepository {
|
||||||
PersonEntity,
|
PersonEntity,
|
||||||
AssetFaceEntity,
|
AssetFaceEntity,
|
||||||
],
|
],
|
||||||
include: {
|
include: {'package:immich_mobile/infrastructure/entities/merged_asset.drift'},
|
||||||
'package:immich_mobile/infrastructure/entities/merged_asset.drift',
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
class Drift extends $Drift implements IDatabaseRepository {
|
class Drift extends $Drift implements IDatabaseRepository {
|
||||||
Drift([QueryExecutor? executor])
|
Drift([QueryExecutor? executor])
|
||||||
: super(
|
: super(executor ?? driftDatabase(name: 'immich', native: const DriftNativeOptions(shareAcrossIsolates: true)));
|
||||||
executor ??
|
|
||||||
driftDatabase(
|
|
||||||
name: 'immich',
|
|
||||||
native: const DriftNativeOptions(shareAcrossIsolates: true),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get schemaVersion => 4;
|
int get schemaVersion => 4;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
MigrationStrategy get migration => MigrationStrategy(
|
MigrationStrategy get migration => MigrationStrategy(
|
||||||
onUpgrade: (m, from, to) async {
|
onUpgrade: (m, from, to) async {
|
||||||
// Run migration steps without foreign keys and re-enable them later
|
// Run migration steps without foreign keys and re-enable them later
|
||||||
await customStatement('PRAGMA foreign_keys = OFF');
|
await customStatement('PRAGMA foreign_keys = OFF');
|
||||||
|
|
||||||
await m.runMigrationSteps(
|
await m.runMigrationSteps(
|
||||||
from: from,
|
from: from,
|
||||||
to: to,
|
to: to,
|
||||||
steps: migrationSteps(
|
steps: migrationSteps(
|
||||||
from1To2: (m, v2) async {
|
from1To2: (m, v2) async {
|
||||||
for (final entity in v2.entities) {
|
for (final entity in v2.entities) {
|
||||||
await m.drop(entity);
|
await m.drop(entity);
|
||||||
await m.create(entity);
|
await m.create(entity);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
from2To3: (m, v3) async {
|
from2To3: (m, v3) async {
|
||||||
// Removed foreign key constraint on stack.primaryAssetId
|
// Removed foreign key constraint on stack.primaryAssetId
|
||||||
await m.alterTable(TableMigration(v3.stackEntity));
|
await m.alterTable(TableMigration(v3.stackEntity));
|
||||||
},
|
},
|
||||||
from3To4: (m, v4) async {
|
from3To4: (m, v4) async {
|
||||||
// Thumbnail path column got removed from person_entity
|
// Thumbnail path column got removed from person_entity
|
||||||
await m.alterTable(TableMigration(v4.personEntity));
|
await m.alterTable(TableMigration(v4.personEntity));
|
||||||
// asset_face_entity is added
|
// asset_face_entity is added
|
||||||
await m.create(v4.assetFaceEntity);
|
await m.create(v4.assetFaceEntity);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
|
||||||
|
|
||||||
if (kDebugMode) {
|
|
||||||
// Fail if the migration broke foreign keys
|
|
||||||
final wrongFKs = await customSelect('PRAGMA foreign_key_check').get();
|
|
||||||
assert(wrongFKs.isEmpty, '${wrongFKs.map((e) => e.data)}');
|
|
||||||
}
|
|
||||||
|
|
||||||
await customStatement('PRAGMA foreign_keys = ON;');
|
|
||||||
},
|
|
||||||
beforeOpen: (details) async {
|
|
||||||
await customStatement('PRAGMA foreign_keys = ON');
|
|
||||||
await customStatement('PRAGMA synchronous = NORMAL');
|
|
||||||
await customStatement('PRAGMA journal_mode = WAL');
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (kDebugMode) {
|
||||||
|
// Fail if the migration broke foreign keys
|
||||||
|
final wrongFKs = await customSelect('PRAGMA foreign_key_check').get();
|
||||||
|
assert(wrongFKs.isEmpty, '${wrongFKs.map((e) => e.data)}');
|
||||||
|
}
|
||||||
|
|
||||||
|
await customStatement('PRAGMA foreign_keys = ON;');
|
||||||
|
},
|
||||||
|
beforeOpen: (details) async {
|
||||||
|
await customStatement('PRAGMA foreign_keys = ON');
|
||||||
|
await customStatement('PRAGMA synchronous = NORMAL');
|
||||||
|
await customStatement('PRAGMA journal_mode = WAL');
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
class DriftDatabaseRepository implements IDatabaseRepository {
|
class DriftDatabaseRepository implements IDatabaseRepository {
|
||||||
|
|
|
||||||
|
|
@ -41,213 +41,232 @@ abstract class $Drift extends i0.GeneratedDatabase {
|
||||||
$Drift(i0.QueryExecutor e) : super(e);
|
$Drift(i0.QueryExecutor e) : super(e);
|
||||||
$DriftManager get managers => $DriftManager(this);
|
$DriftManager get managers => $DriftManager(this);
|
||||||
late final i1.$UserEntityTable userEntity = i1.$UserEntityTable(this);
|
late final i1.$UserEntityTable userEntity = i1.$UserEntityTable(this);
|
||||||
late final i2.$RemoteAssetEntityTable remoteAssetEntity =
|
late final i2.$RemoteAssetEntityTable remoteAssetEntity = i2
|
||||||
i2.$RemoteAssetEntityTable(this);
|
.$RemoteAssetEntityTable(this);
|
||||||
late final i3.$StackEntityTable stackEntity = i3.$StackEntityTable(this);
|
late final i3.$StackEntityTable stackEntity = i3.$StackEntityTable(this);
|
||||||
late final i4.$LocalAssetEntityTable localAssetEntity =
|
late final i4.$LocalAssetEntityTable localAssetEntity = i4
|
||||||
i4.$LocalAssetEntityTable(this);
|
.$LocalAssetEntityTable(this);
|
||||||
late final i5.$LocalAlbumEntityTable localAlbumEntity =
|
late final i5.$LocalAlbumEntityTable localAlbumEntity = i5
|
||||||
i5.$LocalAlbumEntityTable(this);
|
.$LocalAlbumEntityTable(this);
|
||||||
late final i6.$LocalAlbumAssetEntityTable localAlbumAssetEntity =
|
late final i6.$LocalAlbumAssetEntityTable localAlbumAssetEntity = i6
|
||||||
i6.$LocalAlbumAssetEntityTable(this);
|
.$LocalAlbumAssetEntityTable(this);
|
||||||
late final i7.$UserMetadataEntityTable userMetadataEntity =
|
late final i7.$UserMetadataEntityTable userMetadataEntity = i7
|
||||||
i7.$UserMetadataEntityTable(this);
|
.$UserMetadataEntityTable(this);
|
||||||
late final i8.$PartnerEntityTable partnerEntity =
|
late final i8.$PartnerEntityTable partnerEntity = i8.$PartnerEntityTable(
|
||||||
i8.$PartnerEntityTable(this);
|
this,
|
||||||
late final i9.$RemoteExifEntityTable remoteExifEntity =
|
);
|
||||||
i9.$RemoteExifEntityTable(this);
|
late final i9.$RemoteExifEntityTable remoteExifEntity = i9
|
||||||
late final i10.$RemoteAlbumEntityTable remoteAlbumEntity =
|
.$RemoteExifEntityTable(this);
|
||||||
i10.$RemoteAlbumEntityTable(this);
|
late final i10.$RemoteAlbumEntityTable remoteAlbumEntity = i10
|
||||||
late final i11.$RemoteAlbumAssetEntityTable remoteAlbumAssetEntity =
|
.$RemoteAlbumEntityTable(this);
|
||||||
i11.$RemoteAlbumAssetEntityTable(this);
|
late final i11.$RemoteAlbumAssetEntityTable remoteAlbumAssetEntity = i11
|
||||||
late final i12.$RemoteAlbumUserEntityTable remoteAlbumUserEntity =
|
.$RemoteAlbumAssetEntityTable(this);
|
||||||
i12.$RemoteAlbumUserEntityTable(this);
|
late final i12.$RemoteAlbumUserEntityTable remoteAlbumUserEntity = i12
|
||||||
|
.$RemoteAlbumUserEntityTable(this);
|
||||||
late final i13.$MemoryEntityTable memoryEntity = i13.$MemoryEntityTable(this);
|
late final i13.$MemoryEntityTable memoryEntity = i13.$MemoryEntityTable(this);
|
||||||
late final i14.$MemoryAssetEntityTable memoryAssetEntity =
|
late final i14.$MemoryAssetEntityTable memoryAssetEntity = i14
|
||||||
i14.$MemoryAssetEntityTable(this);
|
.$MemoryAssetEntityTable(this);
|
||||||
late final i15.$PersonEntityTable personEntity = i15.$PersonEntityTable(this);
|
late final i15.$PersonEntityTable personEntity = i15.$PersonEntityTable(this);
|
||||||
late final i16.$AssetFaceEntityTable assetFaceEntity =
|
late final i16.$AssetFaceEntityTable assetFaceEntity = i16
|
||||||
i16.$AssetFaceEntityTable(this);
|
.$AssetFaceEntityTable(this);
|
||||||
i17.MergedAssetDrift get mergedAssetDrift => i18.ReadDatabaseContainer(this)
|
i17.MergedAssetDrift get mergedAssetDrift => i18.ReadDatabaseContainer(
|
||||||
.accessor<i17.MergedAssetDrift>(i17.MergedAssetDrift.new);
|
this,
|
||||||
|
).accessor<i17.MergedAssetDrift>(i17.MergedAssetDrift.new);
|
||||||
@override
|
@override
|
||||||
Iterable<i0.TableInfo<i0.Table, Object?>> get allTables =>
|
Iterable<i0.TableInfo<i0.Table, Object?>> get allTables =>
|
||||||
allSchemaEntities.whereType<i0.TableInfo<i0.Table, Object?>>();
|
allSchemaEntities.whereType<i0.TableInfo<i0.Table, Object?>>();
|
||||||
@override
|
@override
|
||||||
List<i0.DatabaseSchemaEntity> get allSchemaEntities => [
|
List<i0.DatabaseSchemaEntity> get allSchemaEntities => [
|
||||||
userEntity,
|
userEntity,
|
||||||
remoteAssetEntity,
|
remoteAssetEntity,
|
||||||
stackEntity,
|
stackEntity,
|
||||||
localAssetEntity,
|
localAssetEntity,
|
||||||
localAlbumEntity,
|
localAlbumEntity,
|
||||||
localAlbumAssetEntity,
|
localAlbumAssetEntity,
|
||||||
i4.idxLocalAssetChecksum,
|
i4.idxLocalAssetChecksum,
|
||||||
i2.uQRemoteAssetOwnerChecksum,
|
i2.uQRemoteAssetOwnerChecksum,
|
||||||
i2.idxRemoteAssetChecksum,
|
i2.idxRemoteAssetChecksum,
|
||||||
userMetadataEntity,
|
userMetadataEntity,
|
||||||
partnerEntity,
|
partnerEntity,
|
||||||
remoteExifEntity,
|
remoteExifEntity,
|
||||||
remoteAlbumEntity,
|
remoteAlbumEntity,
|
||||||
remoteAlbumAssetEntity,
|
remoteAlbumAssetEntity,
|
||||||
remoteAlbumUserEntity,
|
remoteAlbumUserEntity,
|
||||||
memoryEntity,
|
memoryEntity,
|
||||||
memoryAssetEntity,
|
memoryAssetEntity,
|
||||||
personEntity,
|
personEntity,
|
||||||
assetFaceEntity
|
assetFaceEntity,
|
||||||
];
|
];
|
||||||
@override
|
@override
|
||||||
i0.StreamQueryUpdateRules get streamUpdateRules =>
|
i0.StreamQueryUpdateRules
|
||||||
const i0.StreamQueryUpdateRules(
|
get streamUpdateRules => const i0.StreamQueryUpdateRules([
|
||||||
[
|
i0.WritePropagation(
|
||||||
i0.WritePropagation(
|
on: i0.TableUpdateQuery.onTableName(
|
||||||
on: i0.TableUpdateQuery.onTableName('user_entity',
|
'user_entity',
|
||||||
limitUpdateKind: i0.UpdateKind.delete),
|
limitUpdateKind: i0.UpdateKind.delete,
|
||||||
result: [
|
),
|
||||||
i0.TableUpdate('remote_asset_entity', kind: i0.UpdateKind.delete),
|
result: [
|
||||||
],
|
i0.TableUpdate('remote_asset_entity', kind: i0.UpdateKind.delete),
|
||||||
),
|
],
|
||||||
i0.WritePropagation(
|
),
|
||||||
on: i0.TableUpdateQuery.onTableName('user_entity',
|
i0.WritePropagation(
|
||||||
limitUpdateKind: i0.UpdateKind.delete),
|
on: i0.TableUpdateQuery.onTableName(
|
||||||
result: [
|
'user_entity',
|
||||||
i0.TableUpdate('stack_entity', kind: i0.UpdateKind.delete),
|
limitUpdateKind: i0.UpdateKind.delete,
|
||||||
],
|
),
|
||||||
),
|
result: [i0.TableUpdate('stack_entity', kind: i0.UpdateKind.delete)],
|
||||||
i0.WritePropagation(
|
),
|
||||||
on: i0.TableUpdateQuery.onTableName('local_asset_entity',
|
i0.WritePropagation(
|
||||||
limitUpdateKind: i0.UpdateKind.delete),
|
on: i0.TableUpdateQuery.onTableName(
|
||||||
result: [
|
'local_asset_entity',
|
||||||
i0.TableUpdate('local_album_asset_entity',
|
limitUpdateKind: i0.UpdateKind.delete,
|
||||||
kind: i0.UpdateKind.delete),
|
),
|
||||||
],
|
result: [
|
||||||
),
|
i0.TableUpdate('local_album_asset_entity', kind: i0.UpdateKind.delete),
|
||||||
i0.WritePropagation(
|
],
|
||||||
on: i0.TableUpdateQuery.onTableName('local_album_entity',
|
),
|
||||||
limitUpdateKind: i0.UpdateKind.delete),
|
i0.WritePropagation(
|
||||||
result: [
|
on: i0.TableUpdateQuery.onTableName(
|
||||||
i0.TableUpdate('local_album_asset_entity',
|
'local_album_entity',
|
||||||
kind: i0.UpdateKind.delete),
|
limitUpdateKind: i0.UpdateKind.delete,
|
||||||
],
|
),
|
||||||
),
|
result: [
|
||||||
i0.WritePropagation(
|
i0.TableUpdate('local_album_asset_entity', kind: i0.UpdateKind.delete),
|
||||||
on: i0.TableUpdateQuery.onTableName('user_entity',
|
],
|
||||||
limitUpdateKind: i0.UpdateKind.delete),
|
),
|
||||||
result: [
|
i0.WritePropagation(
|
||||||
i0.TableUpdate('user_metadata_entity',
|
on: i0.TableUpdateQuery.onTableName(
|
||||||
kind: i0.UpdateKind.delete),
|
'user_entity',
|
||||||
],
|
limitUpdateKind: i0.UpdateKind.delete,
|
||||||
),
|
),
|
||||||
i0.WritePropagation(
|
result: [
|
||||||
on: i0.TableUpdateQuery.onTableName('user_entity',
|
i0.TableUpdate('user_metadata_entity', kind: i0.UpdateKind.delete),
|
||||||
limitUpdateKind: i0.UpdateKind.delete),
|
],
|
||||||
result: [
|
),
|
||||||
i0.TableUpdate('partner_entity', kind: i0.UpdateKind.delete),
|
i0.WritePropagation(
|
||||||
],
|
on: i0.TableUpdateQuery.onTableName(
|
||||||
),
|
'user_entity',
|
||||||
i0.WritePropagation(
|
limitUpdateKind: i0.UpdateKind.delete,
|
||||||
on: i0.TableUpdateQuery.onTableName('user_entity',
|
),
|
||||||
limitUpdateKind: i0.UpdateKind.delete),
|
result: [i0.TableUpdate('partner_entity', kind: i0.UpdateKind.delete)],
|
||||||
result: [
|
),
|
||||||
i0.TableUpdate('partner_entity', kind: i0.UpdateKind.delete),
|
i0.WritePropagation(
|
||||||
],
|
on: i0.TableUpdateQuery.onTableName(
|
||||||
),
|
'user_entity',
|
||||||
i0.WritePropagation(
|
limitUpdateKind: i0.UpdateKind.delete,
|
||||||
on: i0.TableUpdateQuery.onTableName('remote_asset_entity',
|
),
|
||||||
limitUpdateKind: i0.UpdateKind.delete),
|
result: [i0.TableUpdate('partner_entity', kind: i0.UpdateKind.delete)],
|
||||||
result: [
|
),
|
||||||
i0.TableUpdate('remote_exif_entity', kind: i0.UpdateKind.delete),
|
i0.WritePropagation(
|
||||||
],
|
on: i0.TableUpdateQuery.onTableName(
|
||||||
),
|
'remote_asset_entity',
|
||||||
i0.WritePropagation(
|
limitUpdateKind: i0.UpdateKind.delete,
|
||||||
on: i0.TableUpdateQuery.onTableName('user_entity',
|
),
|
||||||
limitUpdateKind: i0.UpdateKind.delete),
|
result: [
|
||||||
result: [
|
i0.TableUpdate('remote_exif_entity', kind: i0.UpdateKind.delete),
|
||||||
i0.TableUpdate('remote_album_entity', kind: i0.UpdateKind.delete),
|
],
|
||||||
],
|
),
|
||||||
),
|
i0.WritePropagation(
|
||||||
i0.WritePropagation(
|
on: i0.TableUpdateQuery.onTableName(
|
||||||
on: i0.TableUpdateQuery.onTableName('remote_asset_entity',
|
'user_entity',
|
||||||
limitUpdateKind: i0.UpdateKind.delete),
|
limitUpdateKind: i0.UpdateKind.delete,
|
||||||
result: [
|
),
|
||||||
i0.TableUpdate('remote_album_entity', kind: i0.UpdateKind.update),
|
result: [
|
||||||
],
|
i0.TableUpdate('remote_album_entity', kind: i0.UpdateKind.delete),
|
||||||
),
|
],
|
||||||
i0.WritePropagation(
|
),
|
||||||
on: i0.TableUpdateQuery.onTableName('remote_asset_entity',
|
i0.WritePropagation(
|
||||||
limitUpdateKind: i0.UpdateKind.delete),
|
on: i0.TableUpdateQuery.onTableName(
|
||||||
result: [
|
'remote_asset_entity',
|
||||||
i0.TableUpdate('remote_album_asset_entity',
|
limitUpdateKind: i0.UpdateKind.delete,
|
||||||
kind: i0.UpdateKind.delete),
|
),
|
||||||
],
|
result: [
|
||||||
),
|
i0.TableUpdate('remote_album_entity', kind: i0.UpdateKind.update),
|
||||||
i0.WritePropagation(
|
],
|
||||||
on: i0.TableUpdateQuery.onTableName('remote_album_entity',
|
),
|
||||||
limitUpdateKind: i0.UpdateKind.delete),
|
i0.WritePropagation(
|
||||||
result: [
|
on: i0.TableUpdateQuery.onTableName(
|
||||||
i0.TableUpdate('remote_album_asset_entity',
|
'remote_asset_entity',
|
||||||
kind: i0.UpdateKind.delete),
|
limitUpdateKind: i0.UpdateKind.delete,
|
||||||
],
|
),
|
||||||
),
|
result: [
|
||||||
i0.WritePropagation(
|
i0.TableUpdate('remote_album_asset_entity', kind: i0.UpdateKind.delete),
|
||||||
on: i0.TableUpdateQuery.onTableName('remote_album_entity',
|
],
|
||||||
limitUpdateKind: i0.UpdateKind.delete),
|
),
|
||||||
result: [
|
i0.WritePropagation(
|
||||||
i0.TableUpdate('remote_album_user_entity',
|
on: i0.TableUpdateQuery.onTableName(
|
||||||
kind: i0.UpdateKind.delete),
|
'remote_album_entity',
|
||||||
],
|
limitUpdateKind: i0.UpdateKind.delete,
|
||||||
),
|
),
|
||||||
i0.WritePropagation(
|
result: [
|
||||||
on: i0.TableUpdateQuery.onTableName('user_entity',
|
i0.TableUpdate('remote_album_asset_entity', kind: i0.UpdateKind.delete),
|
||||||
limitUpdateKind: i0.UpdateKind.delete),
|
],
|
||||||
result: [
|
),
|
||||||
i0.TableUpdate('remote_album_user_entity',
|
i0.WritePropagation(
|
||||||
kind: i0.UpdateKind.delete),
|
on: i0.TableUpdateQuery.onTableName(
|
||||||
],
|
'remote_album_entity',
|
||||||
),
|
limitUpdateKind: i0.UpdateKind.delete,
|
||||||
i0.WritePropagation(
|
),
|
||||||
on: i0.TableUpdateQuery.onTableName('user_entity',
|
result: [
|
||||||
limitUpdateKind: i0.UpdateKind.delete),
|
i0.TableUpdate('remote_album_user_entity', kind: i0.UpdateKind.delete),
|
||||||
result: [
|
],
|
||||||
i0.TableUpdate('memory_entity', kind: i0.UpdateKind.delete),
|
),
|
||||||
],
|
i0.WritePropagation(
|
||||||
),
|
on: i0.TableUpdateQuery.onTableName(
|
||||||
i0.WritePropagation(
|
'user_entity',
|
||||||
on: i0.TableUpdateQuery.onTableName('remote_asset_entity',
|
limitUpdateKind: i0.UpdateKind.delete,
|
||||||
limitUpdateKind: i0.UpdateKind.delete),
|
),
|
||||||
result: [
|
result: [
|
||||||
i0.TableUpdate('memory_asset_entity', kind: i0.UpdateKind.delete),
|
i0.TableUpdate('remote_album_user_entity', kind: i0.UpdateKind.delete),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
i0.WritePropagation(
|
i0.WritePropagation(
|
||||||
on: i0.TableUpdateQuery.onTableName('memory_entity',
|
on: i0.TableUpdateQuery.onTableName(
|
||||||
limitUpdateKind: i0.UpdateKind.delete),
|
'user_entity',
|
||||||
result: [
|
limitUpdateKind: i0.UpdateKind.delete,
|
||||||
i0.TableUpdate('memory_asset_entity', kind: i0.UpdateKind.delete),
|
),
|
||||||
],
|
result: [i0.TableUpdate('memory_entity', kind: i0.UpdateKind.delete)],
|
||||||
),
|
),
|
||||||
i0.WritePropagation(
|
i0.WritePropagation(
|
||||||
on: i0.TableUpdateQuery.onTableName('user_entity',
|
on: i0.TableUpdateQuery.onTableName(
|
||||||
limitUpdateKind: i0.UpdateKind.delete),
|
'remote_asset_entity',
|
||||||
result: [
|
limitUpdateKind: i0.UpdateKind.delete,
|
||||||
i0.TableUpdate('person_entity', kind: i0.UpdateKind.delete),
|
),
|
||||||
],
|
result: [
|
||||||
),
|
i0.TableUpdate('memory_asset_entity', kind: i0.UpdateKind.delete),
|
||||||
i0.WritePropagation(
|
],
|
||||||
on: i0.TableUpdateQuery.onTableName('remote_asset_entity',
|
),
|
||||||
limitUpdateKind: i0.UpdateKind.delete),
|
i0.WritePropagation(
|
||||||
result: [
|
on: i0.TableUpdateQuery.onTableName(
|
||||||
i0.TableUpdate('asset_face_entity', kind: i0.UpdateKind.delete),
|
'memory_entity',
|
||||||
],
|
limitUpdateKind: i0.UpdateKind.delete,
|
||||||
),
|
),
|
||||||
i0.WritePropagation(
|
result: [
|
||||||
on: i0.TableUpdateQuery.onTableName('person_entity',
|
i0.TableUpdate('memory_asset_entity', kind: i0.UpdateKind.delete),
|
||||||
limitUpdateKind: i0.UpdateKind.delete),
|
],
|
||||||
result: [
|
),
|
||||||
i0.TableUpdate('asset_face_entity', kind: i0.UpdateKind.update),
|
i0.WritePropagation(
|
||||||
],
|
on: i0.TableUpdateQuery.onTableName(
|
||||||
),
|
'user_entity',
|
||||||
],
|
limitUpdateKind: i0.UpdateKind.delete,
|
||||||
);
|
),
|
||||||
|
result: [i0.TableUpdate('person_entity', kind: i0.UpdateKind.delete)],
|
||||||
|
),
|
||||||
|
i0.WritePropagation(
|
||||||
|
on: i0.TableUpdateQuery.onTableName(
|
||||||
|
'remote_asset_entity',
|
||||||
|
limitUpdateKind: i0.UpdateKind.delete,
|
||||||
|
),
|
||||||
|
result: [i0.TableUpdate('asset_face_entity', kind: i0.UpdateKind.delete)],
|
||||||
|
),
|
||||||
|
i0.WritePropagation(
|
||||||
|
on: i0.TableUpdateQuery.onTableName(
|
||||||
|
'person_entity',
|
||||||
|
limitUpdateKind: i0.UpdateKind.delete,
|
||||||
|
),
|
||||||
|
result: [i0.TableUpdate('asset_face_entity', kind: i0.UpdateKind.update)],
|
||||||
|
),
|
||||||
|
]);
|
||||||
@override
|
@override
|
||||||
i0.DriftDatabaseOptions get options =>
|
i0.DriftDatabaseOptions get options =>
|
||||||
const i0.DriftDatabaseOptions(storeDateTimeAsText: true);
|
const i0.DriftDatabaseOptions(storeDateTimeAsText: true);
|
||||||
|
|
@ -278,7 +297,9 @@ class $DriftManager {
|
||||||
i10.$$RemoteAlbumEntityTableTableManager(_db, _db.remoteAlbumEntity);
|
i10.$$RemoteAlbumEntityTableTableManager(_db, _db.remoteAlbumEntity);
|
||||||
i11.$$RemoteAlbumAssetEntityTableTableManager get remoteAlbumAssetEntity =>
|
i11.$$RemoteAlbumAssetEntityTableTableManager get remoteAlbumAssetEntity =>
|
||||||
i11.$$RemoteAlbumAssetEntityTableTableManager(
|
i11.$$RemoteAlbumAssetEntityTableTableManager(
|
||||||
_db, _db.remoteAlbumAssetEntity);
|
_db,
|
||||||
|
_db.remoteAlbumAssetEntity,
|
||||||
|
);
|
||||||
i12.$$RemoteAlbumUserEntityTableTableManager get remoteAlbumUserEntity => i12
|
i12.$$RemoteAlbumUserEntityTableTableManager get remoteAlbumUserEntity => i12
|
||||||
.$$RemoteAlbumUserEntityTableTableManager(_db, _db.remoteAlbumUserEntity);
|
.$$RemoteAlbumUserEntityTableTableManager(_db, _db.remoteAlbumUserEntity);
|
||||||
i13.$$MemoryEntityTableTableManager get memoryEntity =>
|
i13.$$MemoryEntityTableTableManager get memoryEntity =>
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -33,9 +33,7 @@ class IsarExifRepository extends IsarDatabaseRepository {
|
||||||
|
|
||||||
Future<List<ExifInfo>> updateAll(List<ExifInfo> exifInfos) {
|
Future<List<ExifInfo>> updateAll(List<ExifInfo> exifInfos) {
|
||||||
return transaction(() async {
|
return transaction(() async {
|
||||||
await _db.exifInfos.putAll(
|
await _db.exifInfos.putAll(exifInfos.map(entity.ExifInfo.fromDto).toList());
|
||||||
exifInfos.map(entity.ExifInfo.fromDto).toList(),
|
|
||||||
);
|
|
||||||
return exifInfos;
|
return exifInfos;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,8 @@ class DriftLocalAlbumRepository extends DriftDatabaseRepository {
|
||||||
final Drift _db;
|
final Drift _db;
|
||||||
final Platform _platform;
|
final Platform _platform;
|
||||||
const DriftLocalAlbumRepository(this._db, {Platform? platform})
|
const DriftLocalAlbumRepository(this._db, {Platform? platform})
|
||||||
: _platform = platform ?? const LocalPlatform(),
|
: _platform = platform ?? const LocalPlatform(),
|
||||||
super(_db);
|
super(_db);
|
||||||
|
|
||||||
Future<List<LocalAlbum>> getAll({Set<SortLocalAlbumsBy> sortBy = const {}}) {
|
Future<List<LocalAlbum>> getAll({Set<SortLocalAlbumsBy> sortBy = const {}}) {
|
||||||
final assetCount = _db.localAlbumAssetEntity.assetId.count();
|
final assetCount = _db.localAlbumAssetEntity.assetId.count();
|
||||||
|
|
@ -34,41 +34,32 @@ class DriftLocalAlbumRepository extends DriftDatabaseRepository {
|
||||||
if (sortBy.isNotEmpty) {
|
if (sortBy.isNotEmpty) {
|
||||||
final orderings = <OrderingTerm>[];
|
final orderings = <OrderingTerm>[];
|
||||||
for (final sort in sortBy) {
|
for (final sort in sortBy) {
|
||||||
orderings.add(
|
orderings.add(switch (sort) {
|
||||||
switch (sort) {
|
SortLocalAlbumsBy.id => OrderingTerm.asc(_db.localAlbumEntity.id),
|
||||||
SortLocalAlbumsBy.id => OrderingTerm.asc(_db.localAlbumEntity.id),
|
SortLocalAlbumsBy.backupSelection => OrderingTerm.asc(_db.localAlbumEntity.backupSelection),
|
||||||
SortLocalAlbumsBy.backupSelection => OrderingTerm.asc(_db.localAlbumEntity.backupSelection),
|
SortLocalAlbumsBy.isIosSharedAlbum => OrderingTerm.asc(_db.localAlbumEntity.isIosSharedAlbum),
|
||||||
SortLocalAlbumsBy.isIosSharedAlbum => OrderingTerm.asc(_db.localAlbumEntity.isIosSharedAlbum),
|
SortLocalAlbumsBy.name => OrderingTerm.asc(_db.localAlbumEntity.name),
|
||||||
SortLocalAlbumsBy.name => OrderingTerm.asc(_db.localAlbumEntity.name),
|
SortLocalAlbumsBy.assetCount => OrderingTerm.desc(assetCount),
|
||||||
SortLocalAlbumsBy.assetCount => OrderingTerm.desc(assetCount),
|
});
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
query.orderBy(orderings);
|
query.orderBy(orderings);
|
||||||
}
|
}
|
||||||
|
|
||||||
return query
|
return query.map((row) => row.readTable(_db.localAlbumEntity).toDto(assetCount: row.read(assetCount) ?? 0)).get();
|
||||||
.map(
|
|
||||||
(row) => row.readTable(_db.localAlbumEntity).toDto(assetCount: row.read(assetCount) ?? 0),
|
|
||||||
)
|
|
||||||
.get();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> delete(String albumId) => transaction(() async {
|
Future<void> delete(String albumId) => transaction(() async {
|
||||||
// Remove all assets that are only in this particular album
|
// Remove all assets that are only in this particular album
|
||||||
// We cannot remove all assets in the album because they might be in other albums in iOS
|
// We cannot remove all assets in the album because they might be in other albums in iOS
|
||||||
// That is not the case on Android since asset <-> album has one:one mapping
|
// That is not the case on Android since asset <-> album has one:one mapping
|
||||||
final assetsToDelete = _platform.isIOS ? await _getUniqueAssetsInAlbum(albumId) : await getAssetIds(albumId);
|
final assetsToDelete = _platform.isIOS ? await _getUniqueAssetsInAlbum(albumId) : await getAssetIds(albumId);
|
||||||
await _deleteAssets(assetsToDelete);
|
await _deleteAssets(assetsToDelete);
|
||||||
|
|
||||||
// All the other assets that are still associated will be unlinked automatically on-cascade
|
// All the other assets that are still associated will be unlinked automatically on-cascade
|
||||||
await _db.managers.localAlbumEntity.filter((a) => a.id.equals(albumId)).delete();
|
await _db.managers.localAlbumEntity.filter((a) => a.id.equals(albumId)).delete();
|
||||||
});
|
});
|
||||||
|
|
||||||
Future<void> syncDeletes(
|
Future<void> syncDeletes(String albumId, Iterable<String> assetIdsToKeep) async {
|
||||||
String albumId,
|
|
||||||
Iterable<String> assetIdsToKeep,
|
|
||||||
) async {
|
|
||||||
if (assetIdsToKeep.isEmpty) {
|
if (assetIdsToKeep.isEmpty) {
|
||||||
return Future.value();
|
return Future.value();
|
||||||
}
|
}
|
||||||
|
|
@ -77,12 +68,7 @@ class DriftLocalAlbumRepository extends DriftDatabaseRepository {
|
||||||
deleteSmt.where((localAsset) {
|
deleteSmt.where((localAsset) {
|
||||||
final subQuery = _db.localAlbumAssetEntity.selectOnly()
|
final subQuery = _db.localAlbumAssetEntity.selectOnly()
|
||||||
..addColumns([_db.localAlbumAssetEntity.assetId])
|
..addColumns([_db.localAlbumAssetEntity.assetId])
|
||||||
..join([
|
..join([innerJoin(_db.localAlbumEntity, _db.localAlbumAssetEntity.albumId.equalsExp(_db.localAlbumEntity.id))]);
|
||||||
innerJoin(
|
|
||||||
_db.localAlbumEntity,
|
|
||||||
_db.localAlbumAssetEntity.albumId.equalsExp(_db.localAlbumEntity.id),
|
|
||||||
),
|
|
||||||
]);
|
|
||||||
subQuery.where(
|
subQuery.where(
|
||||||
_db.localAlbumEntity.id.equals(albumId) & _db.localAlbumAssetEntity.assetId.isNotIn(assetIdsToKeep),
|
_db.localAlbumEntity.id.equals(albumId) & _db.localAlbumAssetEntity.assetId.isNotIn(assetIdsToKeep),
|
||||||
);
|
);
|
||||||
|
|
@ -109,12 +95,7 @@ class DriftLocalAlbumRepository extends DriftDatabaseRepository {
|
||||||
if (toUpsert.isNotEmpty) {
|
if (toUpsert.isNotEmpty) {
|
||||||
await _upsertAssets(toUpsert);
|
await _upsertAssets(toUpsert);
|
||||||
await _db.localAlbumAssetEntity.insertAll(
|
await _db.localAlbumAssetEntity.insertAll(
|
||||||
toUpsert.map(
|
toUpsert.map((a) => LocalAlbumAssetEntityCompanion.insert(assetId: a.id, albumId: localAlbum.id)),
|
||||||
(a) => LocalAlbumAssetEntityCompanion.insert(
|
|
||||||
assetId: a.id,
|
|
||||||
albumId: localAlbum.id,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
mode: InsertMode.insertOrIgnore,
|
mode: InsertMode.insertOrIgnore,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -162,10 +143,7 @@ class DriftLocalAlbumRepository extends DriftDatabaseRepository {
|
||||||
final subQuery = _db.localAlbumAssetEntity.selectOnly()
|
final subQuery = _db.localAlbumAssetEntity.selectOnly()
|
||||||
..addColumns([_db.localAlbumAssetEntity.assetId])
|
..addColumns([_db.localAlbumAssetEntity.assetId])
|
||||||
..join([
|
..join([
|
||||||
innerJoin(
|
innerJoin(_db.localAlbumEntity, _db.localAlbumAssetEntity.albumId.equalsExp(_db.localAlbumEntity.id)),
|
||||||
_db.localAlbumEntity,
|
|
||||||
_db.localAlbumAssetEntity.albumId.equalsExp(_db.localAlbumEntity.id),
|
|
||||||
),
|
|
||||||
]);
|
]);
|
||||||
subQuery.where(_db.localAlbumEntity.marker_.isNotNull());
|
subQuery.where(_db.localAlbumEntity.marker_.isNotNull());
|
||||||
return localAsset.id.isInQuery(subQuery);
|
return localAsset.id.isInQuery(subQuery);
|
||||||
|
|
@ -178,16 +156,12 @@ class DriftLocalAlbumRepository extends DriftDatabaseRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<List<LocalAsset>> getAssets(String albumId) {
|
Future<List<LocalAsset>> getAssets(String albumId) {
|
||||||
final query = _db.localAlbumAssetEntity.select().join(
|
final query =
|
||||||
[
|
_db.localAlbumAssetEntity.select().join([
|
||||||
innerJoin(
|
innerJoin(_db.localAssetEntity, _db.localAlbumAssetEntity.assetId.equalsExp(_db.localAssetEntity.id)),
|
||||||
_db.localAssetEntity,
|
])
|
||||||
_db.localAlbumAssetEntity.assetId.equalsExp(_db.localAssetEntity.id),
|
..where(_db.localAlbumAssetEntity.albumId.equals(albumId))
|
||||||
),
|
..orderBy([OrderingTerm.asc(_db.localAssetEntity.id)]);
|
||||||
],
|
|
||||||
)
|
|
||||||
..where(_db.localAlbumAssetEntity.albumId.equals(albumId))
|
|
||||||
..orderBy([OrderingTerm.asc(_db.localAssetEntity.id)]);
|
|
||||||
return query.map((row) => row.readTable(_db.localAssetEntity).toDto()).get();
|
return query.map((row) => row.readTable(_db.localAssetEntity).toDto()).get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -224,11 +198,8 @@ class DriftLocalAlbumRepository extends DriftDatabaseRepository {
|
||||||
batch.insertAll(
|
batch.insertAll(
|
||||||
_db.localAlbumAssetEntity,
|
_db.localAlbumAssetEntity,
|
||||||
albumIds.cast<String?>().nonNulls.map(
|
albumIds.cast<String?>().nonNulls.map(
|
||||||
(albumId) => LocalAlbumAssetEntityCompanion.insert(
|
(albumId) => LocalAlbumAssetEntityCompanion.insert(assetId: assetId, albumId: albumId),
|
||||||
assetId: assetId,
|
),
|
||||||
albumId: albumId,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onConflict: DoNothing(),
|
onConflict: DoNothing(),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
@ -237,18 +208,12 @@ class DriftLocalAlbumRepository extends DriftDatabaseRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<List<LocalAsset>> getAssetsToHash(String albumId) {
|
Future<List<LocalAsset>> getAssetsToHash(String albumId) {
|
||||||
final query = _db.localAlbumAssetEntity.select().join(
|
final query =
|
||||||
[
|
_db.localAlbumAssetEntity.select().join([
|
||||||
innerJoin(
|
innerJoin(_db.localAssetEntity, _db.localAlbumAssetEntity.assetId.equalsExp(_db.localAssetEntity.id)),
|
||||||
_db.localAssetEntity,
|
])
|
||||||
_db.localAlbumAssetEntity.assetId.equalsExp(_db.localAssetEntity.id),
|
..where(_db.localAlbumAssetEntity.albumId.equals(albumId) & _db.localAssetEntity.checksum.isNull())
|
||||||
),
|
..orderBy([OrderingTerm.asc(_db.localAssetEntity.id)]);
|
||||||
],
|
|
||||||
)
|
|
||||||
..where(
|
|
||||||
_db.localAlbumAssetEntity.albumId.equals(albumId) & _db.localAssetEntity.checksum.isNull(),
|
|
||||||
)
|
|
||||||
..orderBy([OrderingTerm.asc(_db.localAssetEntity.id)]);
|
|
||||||
|
|
||||||
return query.map((row) => row.readTable(_db.localAssetEntity).toDto()).get();
|
return query.map((row) => row.readTable(_db.localAssetEntity).toDto()).get();
|
||||||
}
|
}
|
||||||
|
|
@ -275,10 +240,7 @@ class DriftLocalAlbumRepository extends DriftDatabaseRepository {
|
||||||
batch.insert<$LocalAssetEntityTable, LocalAssetEntityData>(
|
batch.insert<$LocalAssetEntityTable, LocalAssetEntityData>(
|
||||||
_db.localAssetEntity,
|
_db.localAssetEntity,
|
||||||
companion,
|
companion,
|
||||||
onConflict: DoUpdate(
|
onConflict: DoUpdate((_) => companion, where: (old) => old.updatedAt.isNotValue(asset.updatedAt)),
|
||||||
(_) => companion,
|
|
||||||
where: (old) => old.updatedAt.isNotValue(asset.updatedAt),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -351,15 +313,13 @@ class DriftLocalAlbumRepository extends DriftDatabaseRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<LocalAsset?> getThumbnail(String albumId) async {
|
Future<LocalAsset?> getThumbnail(String albumId) async {
|
||||||
final query = _db.localAlbumAssetEntity.select().join([
|
final query =
|
||||||
innerJoin(
|
_db.localAlbumAssetEntity.select().join([
|
||||||
_db.localAssetEntity,
|
innerJoin(_db.localAssetEntity, _db.localAlbumAssetEntity.assetId.equalsExp(_db.localAssetEntity.id)),
|
||||||
_db.localAlbumAssetEntity.assetId.equalsExp(_db.localAssetEntity.id),
|
])
|
||||||
),
|
..where(_db.localAlbumAssetEntity.albumId.equals(albumId))
|
||||||
])
|
..orderBy([OrderingTerm.asc(_db.localAssetEntity.id)])
|
||||||
..where(_db.localAlbumAssetEntity.albumId.equals(albumId))
|
..limit(1);
|
||||||
..orderBy([OrderingTerm.asc(_db.localAssetEntity.id)])
|
|
||||||
..limit(1);
|
|
||||||
|
|
||||||
final results = await query.map((row) => row.readTable(_db.localAssetEntity).toDto()).get();
|
final results = await query.map((row) => row.readTable(_db.localAssetEntity).toDto()).get();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,14 +16,11 @@ class DriftLocalAssetRepository extends DriftDatabaseRepository {
|
||||||
_db.localAssetEntity.checksum.equalsExp(_db.remoteAssetEntity.checksum),
|
_db.localAssetEntity.checksum.equalsExp(_db.remoteAssetEntity.checksum),
|
||||||
useColumns: false,
|
useColumns: false,
|
||||||
),
|
),
|
||||||
])
|
])..where(_db.localAssetEntity.id.equals(id));
|
||||||
..where(_db.localAssetEntity.id.equals(id));
|
|
||||||
|
|
||||||
return query.map((row) {
|
return query.map((row) {
|
||||||
final asset = row.readTable(_db.localAssetEntity).toDto();
|
final asset = row.readTable(_db.localAssetEntity).toDto();
|
||||||
return asset.copyWith(
|
return asset.copyWith(remoteId: row.read(_db.remoteAssetEntity.id));
|
||||||
remoteId: row.read(_db.remoteAssetEntity.id),
|
|
||||||
);
|
|
||||||
}).watchSingleOrNull();
|
}).watchSingleOrNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,30 +13,21 @@ class DriftMemoryRepository extends DriftDatabaseRepository {
|
||||||
final now = DateTime.now();
|
final now = DateTime.now();
|
||||||
final localUtc = DateTime.utc(now.year, now.month, now.day, 0, 0, 0);
|
final localUtc = DateTime.utc(now.year, now.month, now.day, 0, 0, 0);
|
||||||
|
|
||||||
final query = _db.select(_db.memoryEntity).join([
|
final query =
|
||||||
leftOuterJoin(
|
_db.select(_db.memoryEntity).join([
|
||||||
_db.memoryAssetEntity,
|
leftOuterJoin(_db.memoryAssetEntity, _db.memoryAssetEntity.memoryId.equalsExp(_db.memoryEntity.id)),
|
||||||
_db.memoryAssetEntity.memoryId.equalsExp(_db.memoryEntity.id),
|
leftOuterJoin(
|
||||||
),
|
_db.remoteAssetEntity,
|
||||||
leftOuterJoin(
|
_db.remoteAssetEntity.id.equalsExp(_db.memoryAssetEntity.assetId) &
|
||||||
_db.remoteAssetEntity,
|
_db.remoteAssetEntity.deletedAt.isNull() &
|
||||||
_db.remoteAssetEntity.id.equalsExp(_db.memoryAssetEntity.assetId) &
|
_db.remoteAssetEntity.visibility.equalsValue(AssetVisibility.timeline),
|
||||||
_db.remoteAssetEntity.deletedAt.isNull() &
|
),
|
||||||
_db.remoteAssetEntity.visibility.equalsValue(AssetVisibility.timeline),
|
])
|
||||||
),
|
..where(_db.memoryEntity.ownerId.equals(ownerId))
|
||||||
])
|
..where(_db.memoryEntity.deletedAt.isNull())
|
||||||
..where(_db.memoryEntity.ownerId.equals(ownerId))
|
..where(_db.memoryEntity.showAt.isSmallerOrEqualValue(localUtc))
|
||||||
..where(_db.memoryEntity.deletedAt.isNull())
|
..where(_db.memoryEntity.hideAt.isBiggerOrEqualValue(localUtc))
|
||||||
..where(
|
..orderBy([OrderingTerm.desc(_db.memoryEntity.memoryAt), OrderingTerm.asc(_db.remoteAssetEntity.createdAt)]);
|
||||||
_db.memoryEntity.showAt.isSmallerOrEqualValue(localUtc),
|
|
||||||
)
|
|
||||||
..where(
|
|
||||||
_db.memoryEntity.hideAt.isBiggerOrEqualValue(localUtc),
|
|
||||||
)
|
|
||||||
..orderBy([
|
|
||||||
OrderingTerm.desc(_db.memoryEntity.memoryAt),
|
|
||||||
OrderingTerm.asc(_db.remoteAssetEntity.createdAt),
|
|
||||||
]);
|
|
||||||
|
|
||||||
final rows = await query.get();
|
final rows = await query.get();
|
||||||
|
|
||||||
|
|
@ -59,24 +50,19 @@ class DriftMemoryRepository extends DriftDatabaseRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<DriftMemory?> get(String memoryId) async {
|
Future<DriftMemory?> get(String memoryId) async {
|
||||||
final query = _db.select(_db.memoryEntity).join([
|
final query =
|
||||||
leftOuterJoin(
|
_db.select(_db.memoryEntity).join([
|
||||||
_db.memoryAssetEntity,
|
leftOuterJoin(_db.memoryAssetEntity, _db.memoryAssetEntity.memoryId.equalsExp(_db.memoryEntity.id)),
|
||||||
_db.memoryAssetEntity.memoryId.equalsExp(_db.memoryEntity.id),
|
leftOuterJoin(
|
||||||
),
|
_db.remoteAssetEntity,
|
||||||
leftOuterJoin(
|
_db.remoteAssetEntity.id.equalsExp(_db.memoryAssetEntity.assetId) &
|
||||||
_db.remoteAssetEntity,
|
_db.remoteAssetEntity.deletedAt.isNull() &
|
||||||
_db.remoteAssetEntity.id.equalsExp(_db.memoryAssetEntity.assetId) &
|
_db.remoteAssetEntity.visibility.equalsValue(AssetVisibility.timeline),
|
||||||
_db.remoteAssetEntity.deletedAt.isNull() &
|
),
|
||||||
_db.remoteAssetEntity.visibility.equalsValue(AssetVisibility.timeline),
|
])
|
||||||
),
|
..where(_db.memoryEntity.id.equals(memoryId))
|
||||||
])
|
..where(_db.memoryEntity.deletedAt.isNull())
|
||||||
..where(_db.memoryEntity.id.equals(memoryId))
|
..orderBy([OrderingTerm.desc(_db.memoryEntity.memoryAt), OrderingTerm.asc(_db.remoteAssetEntity.createdAt)]);
|
||||||
..where(_db.memoryEntity.deletedAt.isNull())
|
|
||||||
..orderBy([
|
|
||||||
OrderingTerm.desc(_db.memoryEntity.memoryAt),
|
|
||||||
OrderingTerm.asc(_db.remoteAssetEntity.createdAt),
|
|
||||||
]);
|
|
||||||
|
|
||||||
final rows = await query.get();
|
final rows = await query.get();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,24 +9,13 @@ class DriftPartnerRepository extends DriftDatabaseRepository {
|
||||||
|
|
||||||
Future<List<PartnerUserDto>> getPartners(String userId) {
|
Future<List<PartnerUserDto>> getPartners(String userId) {
|
||||||
final query = _db.select(_db.partnerEntity).join([
|
final query = _db.select(_db.partnerEntity).join([
|
||||||
innerJoin(
|
innerJoin(_db.userEntity, _db.userEntity.id.equalsExp(_db.partnerEntity.sharedById)),
|
||||||
_db.userEntity,
|
])..where(_db.partnerEntity.sharedWithId.equals(userId));
|
||||||
_db.userEntity.id.equalsExp(_db.partnerEntity.sharedById),
|
|
||||||
),
|
|
||||||
])
|
|
||||||
..where(
|
|
||||||
_db.partnerEntity.sharedWithId.equals(userId),
|
|
||||||
);
|
|
||||||
|
|
||||||
return query.map((row) {
|
return query.map((row) {
|
||||||
final user = row.readTable(_db.userEntity);
|
final user = row.readTable(_db.userEntity);
|
||||||
final partner = row.readTable(_db.partnerEntity);
|
final partner = row.readTable(_db.partnerEntity);
|
||||||
return PartnerUserDto(
|
return PartnerUserDto(id: user.id, email: user.email, name: user.name, inTimeline: partner.inTimeline);
|
||||||
id: user.id,
|
|
||||||
email: user.email,
|
|
||||||
name: user.name,
|
|
||||||
inTimeline: partner.inTimeline,
|
|
||||||
);
|
|
||||||
}).get();
|
}).get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -35,60 +24,33 @@ class DriftPartnerRepository extends DriftDatabaseRepository {
|
||||||
final query = _db.select(_db.userEntity)..where((row) => row.id.equals(currentUserId).not());
|
final query = _db.select(_db.userEntity)..where((row) => row.id.equals(currentUserId).not());
|
||||||
|
|
||||||
return query.map((user) {
|
return query.map((user) {
|
||||||
return PartnerUserDto(
|
return PartnerUserDto(id: user.id, email: user.email, name: user.name, inTimeline: false);
|
||||||
id: user.id,
|
|
||||||
email: user.email,
|
|
||||||
name: user.name,
|
|
||||||
inTimeline: false,
|
|
||||||
);
|
|
||||||
}).get();
|
}).get();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get users who are sharing their photos WITH the current user
|
// Get users who are sharing their photos WITH the current user
|
||||||
Future<List<PartnerUserDto>> getSharedWith(String partnerId) {
|
Future<List<PartnerUserDto>> getSharedWith(String partnerId) {
|
||||||
final query = _db.select(_db.partnerEntity).join([
|
final query = _db.select(_db.partnerEntity).join([
|
||||||
innerJoin(
|
innerJoin(_db.userEntity, _db.userEntity.id.equalsExp(_db.partnerEntity.sharedById)),
|
||||||
_db.userEntity,
|
])..where(_db.partnerEntity.sharedWithId.equals(partnerId));
|
||||||
_db.userEntity.id.equalsExp(_db.partnerEntity.sharedById),
|
|
||||||
),
|
|
||||||
])
|
|
||||||
..where(
|
|
||||||
_db.partnerEntity.sharedWithId.equals(partnerId),
|
|
||||||
);
|
|
||||||
|
|
||||||
return query.map((row) {
|
return query.map((row) {
|
||||||
final user = row.readTable(_db.userEntity);
|
final user = row.readTable(_db.userEntity);
|
||||||
final partner = row.readTable(_db.partnerEntity);
|
final partner = row.readTable(_db.partnerEntity);
|
||||||
return PartnerUserDto(
|
return PartnerUserDto(id: user.id, email: user.email, name: user.name, inTimeline: partner.inTimeline);
|
||||||
id: user.id,
|
|
||||||
email: user.email,
|
|
||||||
name: user.name,
|
|
||||||
inTimeline: partner.inTimeline,
|
|
||||||
);
|
|
||||||
}).get();
|
}).get();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get users who the current user is sharing their photos TO
|
// Get users who the current user is sharing their photos TO
|
||||||
Future<List<PartnerUserDto>> getSharedBy(String userId) {
|
Future<List<PartnerUserDto>> getSharedBy(String userId) {
|
||||||
final query = _db.select(_db.partnerEntity).join([
|
final query = _db.select(_db.partnerEntity).join([
|
||||||
innerJoin(
|
innerJoin(_db.userEntity, _db.userEntity.id.equalsExp(_db.partnerEntity.sharedWithId)),
|
||||||
_db.userEntity,
|
])..where(_db.partnerEntity.sharedById.equals(userId));
|
||||||
_db.userEntity.id.equalsExp(_db.partnerEntity.sharedWithId),
|
|
||||||
),
|
|
||||||
])
|
|
||||||
..where(
|
|
||||||
_db.partnerEntity.sharedById.equals(userId),
|
|
||||||
);
|
|
||||||
|
|
||||||
return query.map((row) {
|
return query.map((row) {
|
||||||
final user = row.readTable(_db.userEntity);
|
final user = row.readTable(_db.userEntity);
|
||||||
final partner = row.readTable(_db.partnerEntity);
|
final partner = row.readTable(_db.partnerEntity);
|
||||||
return PartnerUserDto(
|
return PartnerUserDto(id: user.id, email: user.email, name: user.name, inTimeline: partner.inTimeline);
|
||||||
id: user.id,
|
|
||||||
email: user.email,
|
|
||||||
name: user.name,
|
|
||||||
inTimeline: partner.inTimeline,
|
|
||||||
);
|
|
||||||
}).get();
|
}).get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -108,35 +70,24 @@ class DriftPartnerRepository extends DriftDatabaseRepository {
|
||||||
|
|
||||||
Future<PartnerUserDto?> getPartner(String partnerId, String userId) {
|
Future<PartnerUserDto?> getPartner(String partnerId, String userId) {
|
||||||
final query = _db.select(_db.partnerEntity).join([
|
final query = _db.select(_db.partnerEntity).join([
|
||||||
innerJoin(
|
innerJoin(_db.userEntity, _db.userEntity.id.equalsExp(_db.partnerEntity.sharedById)),
|
||||||
_db.userEntity,
|
])..where(_db.partnerEntity.sharedById.equals(partnerId) & _db.partnerEntity.sharedWithId.equals(userId));
|
||||||
_db.userEntity.id.equalsExp(_db.partnerEntity.sharedById),
|
|
||||||
),
|
|
||||||
])
|
|
||||||
..where(
|
|
||||||
_db.partnerEntity.sharedById.equals(partnerId) & _db.partnerEntity.sharedWithId.equals(userId),
|
|
||||||
);
|
|
||||||
|
|
||||||
return query.map((row) {
|
return query.map((row) {
|
||||||
final user = row.readTable(_db.userEntity);
|
final user = row.readTable(_db.userEntity);
|
||||||
final partner = row.readTable(_db.partnerEntity);
|
final partner = row.readTable(_db.partnerEntity);
|
||||||
return PartnerUserDto(
|
return PartnerUserDto(id: user.id, email: user.email, name: user.name, inTimeline: partner.inTimeline);
|
||||||
id: user.id,
|
|
||||||
email: user.email,
|
|
||||||
name: user.name,
|
|
||||||
inTimeline: partner.inTimeline,
|
|
||||||
);
|
|
||||||
}).getSingleOrNull();
|
}).getSingleOrNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> toggleShowInTimeline(PartnerUserDto partner, String userId) {
|
Future<bool> toggleShowInTimeline(PartnerUserDto partner, String userId) {
|
||||||
return _db.partnerEntity.update().replace(
|
return _db.partnerEntity.update().replace(
|
||||||
PartnerEntityCompanion(
|
PartnerEntityCompanion(
|
||||||
sharedById: Value(partner.id),
|
sharedById: Value(partner.id),
|
||||||
sharedWithId: Value(userId),
|
sharedWithId: Value(userId),
|
||||||
inTimeline: Value(!partner.inTimeline),
|
inTimeline: Value(!partner.inTimeline),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<int> create(String partnerId, String userId) {
|
Future<int> create(String partnerId, String userId) {
|
||||||
|
|
@ -150,8 +101,6 @@ class DriftPartnerRepository extends DriftDatabaseRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> delete(String partnerId, String userId) {
|
Future<void> delete(String partnerId, String userId) {
|
||||||
return _db.partnerEntity.deleteWhere(
|
return _db.partnerEntity.deleteWhere((t) => t.sharedById.equals(userId) & t.sharedWithId.equals(partnerId));
|
||||||
(t) => t.sharedById.equals(userId) & t.sharedWithId.equals(partnerId),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,7 @@ class DriftRemoteAlbumRepository extends DriftDatabaseRepository {
|
||||||
final Drift _db;
|
final Drift _db;
|
||||||
const DriftRemoteAlbumRepository(this._db) : super(_db);
|
const DriftRemoteAlbumRepository(this._db) : super(_db);
|
||||||
|
|
||||||
Future<List<RemoteAlbum>> getAll({
|
Future<List<RemoteAlbum>> getAll({Set<SortRemoteAlbumsBy> sortBy = const {SortRemoteAlbumsBy.updatedAt}}) {
|
||||||
Set<SortRemoteAlbumsBy> sortBy = const {SortRemoteAlbumsBy.updatedAt},
|
|
||||||
}) {
|
|
||||||
final assetCount = _db.remoteAlbumAssetEntity.assetId.count();
|
final assetCount = _db.remoteAlbumAssetEntity.assetId.count();
|
||||||
|
|
||||||
final query = _db.remoteAlbumEntity.select().join([
|
final query = _db.remoteAlbumEntity.select().join([
|
||||||
|
|
@ -32,11 +30,7 @@ class DriftRemoteAlbumRepository extends DriftDatabaseRepository {
|
||||||
_db.remoteAssetEntity.id.equalsExp(_db.remoteAlbumAssetEntity.assetId),
|
_db.remoteAssetEntity.id.equalsExp(_db.remoteAlbumAssetEntity.assetId),
|
||||||
useColumns: false,
|
useColumns: false,
|
||||||
),
|
),
|
||||||
leftOuterJoin(
|
leftOuterJoin(_db.userEntity, _db.userEntity.id.equalsExp(_db.remoteAlbumEntity.ownerId), useColumns: false),
|
||||||
_db.userEntity,
|
|
||||||
_db.userEntity.id.equalsExp(_db.remoteAlbumEntity.ownerId),
|
|
||||||
useColumns: false,
|
|
||||||
),
|
|
||||||
]);
|
]);
|
||||||
query
|
query
|
||||||
..where(_db.remoteAssetEntity.deletedAt.isNull())
|
..where(_db.remoteAssetEntity.deletedAt.isNull())
|
||||||
|
|
@ -47,22 +41,19 @@ class DriftRemoteAlbumRepository extends DriftDatabaseRepository {
|
||||||
if (sortBy.isNotEmpty) {
|
if (sortBy.isNotEmpty) {
|
||||||
final orderings = <OrderingTerm>[];
|
final orderings = <OrderingTerm>[];
|
||||||
for (final sort in sortBy) {
|
for (final sort in sortBy) {
|
||||||
orderings.add(
|
orderings.add(switch (sort) {
|
||||||
switch (sort) {
|
SortRemoteAlbumsBy.id => OrderingTerm.asc(_db.remoteAlbumEntity.id),
|
||||||
SortRemoteAlbumsBy.id => OrderingTerm.asc(_db.remoteAlbumEntity.id),
|
SortRemoteAlbumsBy.updatedAt => OrderingTerm.desc(_db.remoteAlbumEntity.updatedAt),
|
||||||
SortRemoteAlbumsBy.updatedAt => OrderingTerm.desc(_db.remoteAlbumEntity.updatedAt),
|
});
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
query.orderBy(orderings);
|
query.orderBy(orderings);
|
||||||
}
|
}
|
||||||
|
|
||||||
return query
|
return query
|
||||||
.map(
|
.map(
|
||||||
(row) => row.readTable(_db.remoteAlbumEntity).toDto(
|
(row) => row
|
||||||
assetCount: row.read(assetCount) ?? 0,
|
.readTable(_db.remoteAlbumEntity)
|
||||||
ownerName: row.read(_db.userEntity.name)!,
|
.toDto(assetCount: row.read(assetCount) ?? 0, ownerName: row.read(_db.userEntity.name)!),
|
||||||
),
|
|
||||||
)
|
)
|
||||||
.get();
|
.get();
|
||||||
}
|
}
|
||||||
|
|
@ -70,42 +61,39 @@ class DriftRemoteAlbumRepository extends DriftDatabaseRepository {
|
||||||
Future<RemoteAlbum?> get(String albumId) {
|
Future<RemoteAlbum?> get(String albumId) {
|
||||||
final assetCount = _db.remoteAlbumAssetEntity.assetId.count();
|
final assetCount = _db.remoteAlbumAssetEntity.assetId.count();
|
||||||
|
|
||||||
final query = _db.remoteAlbumEntity.select().join([
|
final query =
|
||||||
leftOuterJoin(
|
_db.remoteAlbumEntity.select().join([
|
||||||
_db.remoteAlbumAssetEntity,
|
leftOuterJoin(
|
||||||
_db.remoteAlbumAssetEntity.albumId.equalsExp(_db.remoteAlbumEntity.id),
|
_db.remoteAlbumAssetEntity,
|
||||||
useColumns: false,
|
_db.remoteAlbumAssetEntity.albumId.equalsExp(_db.remoteAlbumEntity.id),
|
||||||
),
|
useColumns: false,
|
||||||
leftOuterJoin(
|
),
|
||||||
_db.remoteAssetEntity,
|
leftOuterJoin(
|
||||||
_db.remoteAssetEntity.id.equalsExp(_db.remoteAlbumAssetEntity.assetId),
|
_db.remoteAssetEntity,
|
||||||
useColumns: false,
|
_db.remoteAssetEntity.id.equalsExp(_db.remoteAlbumAssetEntity.assetId),
|
||||||
),
|
useColumns: false,
|
||||||
leftOuterJoin(
|
),
|
||||||
_db.userEntity,
|
leftOuterJoin(
|
||||||
_db.userEntity.id.equalsExp(_db.remoteAlbumEntity.ownerId),
|
_db.userEntity,
|
||||||
useColumns: false,
|
_db.userEntity.id.equalsExp(_db.remoteAlbumEntity.ownerId),
|
||||||
),
|
useColumns: false,
|
||||||
])
|
),
|
||||||
..where(_db.remoteAlbumEntity.id.equals(albumId) & _db.remoteAssetEntity.deletedAt.isNull())
|
])
|
||||||
..addColumns([assetCount])
|
..where(_db.remoteAlbumEntity.id.equals(albumId) & _db.remoteAssetEntity.deletedAt.isNull())
|
||||||
..addColumns([_db.userEntity.name])
|
..addColumns([assetCount])
|
||||||
..groupBy([_db.remoteAlbumEntity.id]);
|
..addColumns([_db.userEntity.name])
|
||||||
|
..groupBy([_db.remoteAlbumEntity.id]);
|
||||||
|
|
||||||
return query
|
return query
|
||||||
.map(
|
.map(
|
||||||
(row) => row.readTable(_db.remoteAlbumEntity).toDto(
|
(row) => row
|
||||||
assetCount: row.read(assetCount) ?? 0,
|
.readTable(_db.remoteAlbumEntity)
|
||||||
ownerName: row.read(_db.userEntity.name)!,
|
.toDto(assetCount: row.read(assetCount) ?? 0, ownerName: row.read(_db.userEntity.name)!),
|
||||||
),
|
|
||||||
)
|
)
|
||||||
.getSingleOrNull();
|
.getSingleOrNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> create(
|
Future<void> create(RemoteAlbum album, List<String> assetIds) async {
|
||||||
RemoteAlbum album,
|
|
||||||
List<String> assetIds,
|
|
||||||
) async {
|
|
||||||
await _db.transaction(() async {
|
await _db.transaction(() async {
|
||||||
final entity = RemoteAlbumEntityCompanion(
|
final entity = RemoteAlbumEntityCompanion(
|
||||||
id: Value(album.id),
|
id: Value(album.id),
|
||||||
|
|
@ -123,17 +111,11 @@ class DriftRemoteAlbumRepository extends DriftDatabaseRepository {
|
||||||
|
|
||||||
if (assetIds.isNotEmpty) {
|
if (assetIds.isNotEmpty) {
|
||||||
final albumAssets = assetIds.map(
|
final albumAssets = assetIds.map(
|
||||||
(assetId) => RemoteAlbumAssetEntityCompanion(
|
(assetId) => RemoteAlbumAssetEntityCompanion(albumId: Value(album.id), assetId: Value(assetId)),
|
||||||
albumId: Value(album.id),
|
|
||||||
assetId: Value(assetId),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
await _db.batch((batch) {
|
await _db.batch((batch) {
|
||||||
batch.insertAll(
|
batch.insertAll(_db.remoteAlbumAssetEntity, albumAssets);
|
||||||
_db.remoteAlbumAssetEntity,
|
|
||||||
albumAssets,
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -141,38 +123,30 @@ class DriftRemoteAlbumRepository extends DriftDatabaseRepository {
|
||||||
|
|
||||||
Future<void> update(RemoteAlbum album) async {
|
Future<void> update(RemoteAlbum album) async {
|
||||||
await _db.remoteAlbumEntity.update().replace(
|
await _db.remoteAlbumEntity.update().replace(
|
||||||
RemoteAlbumEntityCompanion(
|
RemoteAlbumEntityCompanion(
|
||||||
id: Value(album.id),
|
id: Value(album.id),
|
||||||
name: Value(album.name),
|
name: Value(album.name),
|
||||||
ownerId: Value(album.ownerId),
|
ownerId: Value(album.ownerId),
|
||||||
createdAt: Value(album.createdAt),
|
createdAt: Value(album.createdAt),
|
||||||
updatedAt: Value(album.updatedAt),
|
updatedAt: Value(album.updatedAt),
|
||||||
description: Value(album.description),
|
description: Value(album.description),
|
||||||
thumbnailAssetId: Value(album.thumbnailAssetId),
|
thumbnailAssetId: Value(album.thumbnailAssetId),
|
||||||
isActivityEnabled: Value(album.isActivityEnabled),
|
isActivityEnabled: Value(album.isActivityEnabled),
|
||||||
order: Value(album.order),
|
order: Value(album.order),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<int> removeAssets(String albumId, List<String> assetIds) {
|
Future<int> removeAssets(String albumId, List<String> assetIds) {
|
||||||
return _db.remoteAlbumAssetEntity.deleteWhere(
|
return _db.remoteAlbumAssetEntity.deleteWhere((tbl) => tbl.albumId.equals(albumId) & tbl.assetId.isIn(assetIds));
|
||||||
(tbl) => tbl.albumId.equals(albumId) & tbl.assetId.isIn(assetIds),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FutureOr<(DateTime, DateTime)> getDateRange(String albumId) {
|
FutureOr<(DateTime, DateTime)> getDateRange(String albumId) {
|
||||||
final query = _db.remoteAlbumAssetEntity.selectOnly()
|
final query = _db.remoteAlbumAssetEntity.selectOnly()
|
||||||
..where(_db.remoteAlbumAssetEntity.albumId.equals(albumId))
|
..where(_db.remoteAlbumAssetEntity.albumId.equals(albumId))
|
||||||
..addColumns([
|
..addColumns([_db.remoteAssetEntity.createdAt.min(), _db.remoteAssetEntity.createdAt.max()])
|
||||||
_db.remoteAssetEntity.createdAt.min(),
|
|
||||||
_db.remoteAssetEntity.createdAt.max(),
|
|
||||||
])
|
|
||||||
..join([
|
..join([
|
||||||
innerJoin(
|
innerJoin(_db.remoteAssetEntity, _db.remoteAssetEntity.id.equalsExp(_db.remoteAlbumAssetEntity.assetId)),
|
||||||
_db.remoteAssetEntity,
|
|
||||||
_db.remoteAssetEntity.id.equalsExp(_db.remoteAlbumAssetEntity.assetId),
|
|
||||||
),
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return query.map((row) {
|
return query.map((row) {
|
||||||
|
|
@ -183,8 +157,9 @@ class DriftRemoteAlbumRepository extends DriftDatabaseRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<List<UserDto>> getSharedUsers(String albumId) async {
|
Future<List<UserDto>> getSharedUsers(String albumId) async {
|
||||||
final albumUserRows =
|
final albumUserRows = await (_db.select(
|
||||||
await (_db.select(_db.remoteAlbumUserEntity)..where((row) => row.albumId.equals(albumId))).get();
|
_db.remoteAlbumUserEntity,
|
||||||
|
)..where((row) => row.albumId.equals(albumId))).get();
|
||||||
|
|
||||||
if (albumUserRows.isEmpty) {
|
if (albumUserRows.isEmpty) {
|
||||||
return [];
|
return [];
|
||||||
|
|
@ -214,29 +189,19 @@ class DriftRemoteAlbumRepository extends DriftDatabaseRepository {
|
||||||
|
|
||||||
Future<List<RemoteAsset>> getAssets(String albumId) {
|
Future<List<RemoteAsset>> getAssets(String albumId) {
|
||||||
final query = _db.remoteAlbumAssetEntity.select().join([
|
final query = _db.remoteAlbumAssetEntity.select().join([
|
||||||
innerJoin(
|
innerJoin(_db.remoteAssetEntity, _db.remoteAssetEntity.id.equalsExp(_db.remoteAlbumAssetEntity.assetId)),
|
||||||
_db.remoteAssetEntity,
|
])..where(_db.remoteAlbumAssetEntity.albumId.equals(albumId));
|
||||||
_db.remoteAssetEntity.id.equalsExp(_db.remoteAlbumAssetEntity.assetId),
|
|
||||||
),
|
|
||||||
])
|
|
||||||
..where(_db.remoteAlbumAssetEntity.albumId.equals(albumId));
|
|
||||||
|
|
||||||
return query.map((row) => row.readTable(_db.remoteAssetEntity).toDto()).get();
|
return query.map((row) => row.readTable(_db.remoteAssetEntity).toDto()).get();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<int> addAssets(String albumId, List<String> assetIds) async {
|
Future<int> addAssets(String albumId, List<String> assetIds) async {
|
||||||
final albumAssets = assetIds.map(
|
final albumAssets = assetIds.map(
|
||||||
(assetId) => RemoteAlbumAssetEntityCompanion(
|
(assetId) => RemoteAlbumAssetEntityCompanion(albumId: Value(albumId), assetId: Value(assetId)),
|
||||||
albumId: Value(albumId),
|
|
||||||
assetId: Value(assetId),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
await _db.batch((batch) {
|
await _db.batch((batch) {
|
||||||
batch.insertAll(
|
batch.insertAll(_db.remoteAlbumAssetEntity, albumAssets);
|
||||||
_db.remoteAlbumAssetEntity,
|
|
||||||
albumAssets,
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return assetIds.length;
|
return assetIds.length;
|
||||||
|
|
@ -252,47 +217,41 @@ class DriftRemoteAlbumRepository extends DriftDatabaseRepository {
|
||||||
);
|
);
|
||||||
|
|
||||||
return _db.batch((batch) {
|
return _db.batch((batch) {
|
||||||
batch.insertAll(
|
batch.insertAll(_db.remoteAlbumUserEntity, albumUsers);
|
||||||
_db.remoteAlbumUserEntity,
|
|
||||||
albumUsers,
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> deleteAlbum(String albumId) async {
|
Future<void> deleteAlbum(String albumId) async {
|
||||||
return _db.transaction(() async {
|
return _db.transaction(() async {
|
||||||
await _db.remoteAlbumEntity.deleteWhere(
|
await _db.remoteAlbumEntity.deleteWhere((table) => table.id.equals(albumId));
|
||||||
(table) => table.id.equals(albumId),
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Stream<RemoteAlbum?> watchAlbum(String albumId) {
|
Stream<RemoteAlbum?> watchAlbum(String albumId) {
|
||||||
final query = _db.remoteAlbumEntity.select().join([
|
final query =
|
||||||
leftOuterJoin(
|
_db.remoteAlbumEntity.select().join([
|
||||||
_db.remoteAlbumAssetEntity,
|
leftOuterJoin(
|
||||||
_db.remoteAlbumAssetEntity.albumId.equalsExp(_db.remoteAlbumEntity.id),
|
_db.remoteAlbumAssetEntity,
|
||||||
useColumns: false,
|
_db.remoteAlbumAssetEntity.albumId.equalsExp(_db.remoteAlbumEntity.id),
|
||||||
),
|
useColumns: false,
|
||||||
leftOuterJoin(
|
),
|
||||||
_db.remoteAssetEntity,
|
leftOuterJoin(
|
||||||
_db.remoteAssetEntity.id.equalsExp(_db.remoteAlbumAssetEntity.assetId),
|
_db.remoteAssetEntity,
|
||||||
useColumns: false,
|
_db.remoteAssetEntity.id.equalsExp(_db.remoteAlbumAssetEntity.assetId),
|
||||||
),
|
useColumns: false,
|
||||||
leftOuterJoin(
|
),
|
||||||
_db.userEntity,
|
leftOuterJoin(
|
||||||
_db.userEntity.id.equalsExp(_db.remoteAlbumEntity.ownerId),
|
_db.userEntity,
|
||||||
useColumns: false,
|
_db.userEntity.id.equalsExp(_db.remoteAlbumEntity.ownerId),
|
||||||
),
|
useColumns: false,
|
||||||
])
|
),
|
||||||
..where(_db.remoteAlbumEntity.id.equals(albumId))
|
])
|
||||||
..addColumns([_db.userEntity.name])
|
..where(_db.remoteAlbumEntity.id.equals(albumId))
|
||||||
..groupBy([_db.remoteAlbumEntity.id]);
|
..addColumns([_db.userEntity.name])
|
||||||
|
..groupBy([_db.remoteAlbumEntity.id]);
|
||||||
|
|
||||||
return query.map((row) {
|
return query.map((row) {
|
||||||
final album = row.readTable(_db.remoteAlbumEntity).toDto(
|
final album = row.readTable(_db.remoteAlbumEntity).toDto(ownerName: row.read(_db.userEntity.name)!);
|
||||||
ownerName: row.read(_db.userEntity.name)!,
|
|
||||||
);
|
|
||||||
return album;
|
return album;
|
||||||
}).watchSingleOrNull();
|
}).watchSingleOrNull();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,17 +30,16 @@ class RemoteAssetRepository extends DriftDatabaseRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
SingleOrNullSelectable<RemoteAsset?> _assetSelectable(String id) {
|
SingleOrNullSelectable<RemoteAsset?> _assetSelectable(String id) {
|
||||||
final query = _db.remoteAssetEntity.select().addColumns([
|
final query =
|
||||||
_db.localAssetEntity.id,
|
_db.remoteAssetEntity.select().addColumns([_db.localAssetEntity.id]).join([
|
||||||
]).join([
|
leftOuterJoin(
|
||||||
leftOuterJoin(
|
_db.localAssetEntity,
|
||||||
_db.localAssetEntity,
|
_db.remoteAssetEntity.checksum.equalsExp(_db.localAssetEntity.checksum),
|
||||||
_db.remoteAssetEntity.checksum.equalsExp(_db.localAssetEntity.checksum),
|
useColumns: false,
|
||||||
useColumns: false,
|
),
|
||||||
),
|
])
|
||||||
])
|
..where(_db.remoteAssetEntity.id.equals(id))
|
||||||
..where(_db.remoteAssetEntity.id.equals(id))
|
..limit(1);
|
||||||
..limit(1);
|
|
||||||
|
|
||||||
return query.map((row) {
|
return query.map((row) {
|
||||||
final asset = row.readTable(_db.remoteAssetEntity).toDto();
|
final asset = row.readTable(_db.remoteAssetEntity).toDto();
|
||||||
|
|
@ -57,17 +56,16 @@ class RemoteAssetRepository extends DriftDatabaseRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
Stream<RemoteAsset?> watchAsset(String id) {
|
Stream<RemoteAsset?> watchAsset(String id) {
|
||||||
final query = _db.remoteAssetEntity.select().addColumns([
|
final query =
|
||||||
_db.localAssetEntity.id,
|
_db.remoteAssetEntity.select().addColumns([_db.localAssetEntity.id]).join([
|
||||||
]).join([
|
leftOuterJoin(
|
||||||
leftOuterJoin(
|
_db.localAssetEntity,
|
||||||
_db.localAssetEntity,
|
_db.remoteAssetEntity.checksum.equalsExp(_db.localAssetEntity.checksum),
|
||||||
_db.remoteAssetEntity.checksum.equalsExp(_db.localAssetEntity.checksum),
|
useColumns: false,
|
||||||
useColumns: false,
|
),
|
||||||
),
|
])
|
||||||
])
|
..where(_db.remoteAssetEntity.id.equals(id))
|
||||||
..where(_db.remoteAssetEntity.id.equals(id))
|
..limit(1);
|
||||||
..limit(1);
|
|
||||||
|
|
||||||
return query.map((row) {
|
return query.map((row) {
|
||||||
final asset = row.readTable(_db.remoteAssetEntity).toDto();
|
final asset = row.readTable(_db.remoteAssetEntity).toDto();
|
||||||
|
|
@ -81,9 +79,7 @@ class RemoteAssetRepository extends DriftDatabaseRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
final query = _db.remoteAssetEntity.select()
|
final query = _db.remoteAssetEntity.select()
|
||||||
..where(
|
..where((row) => row.stackId.equals(asset.stackId!) & row.id.equals(asset.id).not())
|
||||||
(row) => row.stackId.equals(asset.stackId!) & row.id.equals(asset.id).not(),
|
|
||||||
)
|
|
||||||
..orderBy([(row) => OrderingTerm.desc(row.createdAt)]);
|
..orderBy([(row) => OrderingTerm.desc(row.createdAt)]);
|
||||||
|
|
||||||
return query.map((row) => row.toDto()).get();
|
return query.map((row) => row.toDto()).get();
|
||||||
|
|
@ -102,24 +98,22 @@ class RemoteAssetRepository extends DriftDatabaseRepository {
|
||||||
"asset",
|
"asset",
|
||||||
);
|
);
|
||||||
|
|
||||||
final query = asset.selectOnly().join([
|
final query =
|
||||||
innerJoin(
|
asset.selectOnly().join([
|
||||||
_db.remoteExifEntity,
|
innerJoin(
|
||||||
_db.remoteExifEntity.assetId.equalsExp(asset.ref(_db.remoteAssetEntity.id)),
|
_db.remoteExifEntity,
|
||||||
useColumns: false,
|
_db.remoteExifEntity.assetId.equalsExp(asset.ref(_db.remoteAssetEntity.id)),
|
||||||
),
|
useColumns: false,
|
||||||
])
|
),
|
||||||
..addColumns([
|
])
|
||||||
_db.remoteExifEntity.city,
|
..addColumns([_db.remoteExifEntity.city, _db.remoteExifEntity.assetId])
|
||||||
_db.remoteExifEntity.assetId,
|
..where(
|
||||||
])
|
_db.remoteExifEntity.city.isNotNull() &
|
||||||
..where(
|
asset.ref(_db.remoteAssetEntity.deletedAt).isNull() &
|
||||||
_db.remoteExifEntity.city.isNotNull() &
|
asset.ref(_db.remoteAssetEntity.visibility).equals(AssetVisibility.timeline.index),
|
||||||
asset.ref(_db.remoteAssetEntity.deletedAt).isNull() &
|
)
|
||||||
asset.ref(_db.remoteAssetEntity.visibility).equals(AssetVisibility.timeline.index),
|
..groupBy([_db.remoteExifEntity.city])
|
||||||
)
|
..orderBy([OrderingTerm.asc(_db.remoteExifEntity.city)]);
|
||||||
..groupBy([_db.remoteExifEntity.city])
|
|
||||||
..orderBy([OrderingTerm.asc(_db.remoteExifEntity.city)]);
|
|
||||||
|
|
||||||
return query.map((row) {
|
return query.map((row) {
|
||||||
final assetId = row.read(_db.remoteExifEntity.assetId);
|
final assetId = row.read(_db.remoteExifEntity.assetId);
|
||||||
|
|
@ -185,10 +179,7 @@ class RemoteAssetRepository extends DriftDatabaseRepository {
|
||||||
for (final id in ids) {
|
for (final id in ids) {
|
||||||
batch.update(
|
batch.update(
|
||||||
_db.remoteExifEntity,
|
_db.remoteExifEntity,
|
||||||
RemoteExifEntityCompanion(
|
RemoteExifEntityCompanion(latitude: Value(location.latitude), longitude: Value(location.longitude)),
|
||||||
latitude: Value(location.latitude),
|
|
||||||
longitude: Value(location.longitude),
|
|
||||||
),
|
|
||||||
where: (e) => e.assetId.equals(id),
|
where: (e) => e.assetId.equals(id),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -205,23 +196,14 @@ class RemoteAssetRepository extends DriftDatabaseRepository {
|
||||||
await _db.stackEntity.deleteWhere((row) => row.id.isIn(stackIds));
|
await _db.stackEntity.deleteWhere((row) => row.id.isIn(stackIds));
|
||||||
|
|
||||||
await _db.batch((batch) {
|
await _db.batch((batch) {
|
||||||
final companion = StackEntityCompanion(
|
final companion = StackEntityCompanion(ownerId: Value(userId), primaryAssetId: Value(stack.primaryAssetId));
|
||||||
ownerId: Value(userId),
|
|
||||||
primaryAssetId: Value(stack.primaryAssetId),
|
|
||||||
);
|
|
||||||
|
|
||||||
batch.insert(
|
batch.insert(_db.stackEntity, companion.copyWith(id: Value(stack.id)), onConflict: DoUpdate((_) => companion));
|
||||||
_db.stackEntity,
|
|
||||||
companion.copyWith(id: Value(stack.id)),
|
|
||||||
onConflict: DoUpdate((_) => companion),
|
|
||||||
);
|
|
||||||
|
|
||||||
for (final assetId in stack.assetIds) {
|
for (final assetId in stack.assetIds) {
|
||||||
batch.update(
|
batch.update(
|
||||||
_db.remoteAssetEntity,
|
_db.remoteAssetEntity,
|
||||||
RemoteAssetEntityCompanion(
|
RemoteAssetEntityCompanion(stackId: Value(stack.id)),
|
||||||
stackId: Value(stack.id),
|
|
||||||
),
|
|
||||||
where: (e) => e.id.equals(assetId),
|
where: (e) => e.id.equals(assetId),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,12 +66,5 @@ class SearchApiRepository extends ApiRepository {
|
||||||
String? state,
|
String? state,
|
||||||
String? make,
|
String? make,
|
||||||
String? model,
|
String? model,
|
||||||
}) =>
|
}) => _api.getSearchSuggestions(type, country: country, state: state, make: make, model: model);
|
||||||
_api.getSearchSuggestions(
|
|
||||||
type,
|
|
||||||
country: country,
|
|
||||||
state: state,
|
|
||||||
make: make,
|
|
||||||
model: model,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,12 +18,6 @@ class DriftStackRepository extends DriftDatabaseRepository {
|
||||||
|
|
||||||
extension on StackEntityData {
|
extension on StackEntityData {
|
||||||
Stack toDto() {
|
Stack toDto() {
|
||||||
return Stack(
|
return Stack(id: id, createdAt: createdAt, updatedAt: updatedAt, ownerId: ownerId, primaryAssetId: primaryAssetId);
|
||||||
id: id,
|
|
||||||
createdAt: createdAt,
|
|
||||||
updatedAt: updatedAt,
|
|
||||||
ownerId: ownerId,
|
|
||||||
primaryAssetId: primaryAssetId,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,11 +23,7 @@ class IsarStoreRepository extends IsarDatabaseRepository {
|
||||||
.filter()
|
.filter()
|
||||||
.anyOf(validStoreKeys, (query, id) => query.idEqualTo(id))
|
.anyOf(validStoreKeys, (query, id) => query.idEqualTo(id))
|
||||||
.watch(fireImmediately: true)
|
.watch(fireImmediately: true)
|
||||||
.asyncExpand(
|
.asyncExpand((entities) => Stream.fromFutures(entities.map((e) async => _toUpdateEvent(e))));
|
||||||
(entities) => Stream.fromFutures(
|
|
||||||
entities.map((e) async => _toUpdateEvent(e)),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> delete<T>(StoreKey<T> key) async {
|
Future<void> delete<T>(StoreKey<T> key) async {
|
||||||
|
|
@ -68,14 +64,17 @@ class IsarStoreRepository extends IsarDatabaseRepository {
|
||||||
return StoreDto(key, value);
|
return StoreDto(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<T?> _toValue<T>(StoreKey<T> key, StoreValue entity) async => switch (key.type) {
|
Future<T?> _toValue<T>(StoreKey<T> key, StoreValue entity) async =>
|
||||||
const (int) => entity.intValue,
|
switch (key.type) {
|
||||||
const (String) => entity.strValue,
|
const (int) => entity.intValue,
|
||||||
const (bool) => entity.intValue == 1,
|
const (String) => entity.strValue,
|
||||||
const (DateTime) => entity.intValue == null ? null : DateTime.fromMillisecondsSinceEpoch(entity.intValue!),
|
const (bool) => entity.intValue == 1,
|
||||||
const (UserDto) => entity.strValue == null ? null : await IsarUserRepository(_db).getByUserId(entity.strValue!),
|
const (DateTime) => entity.intValue == null ? null : DateTime.fromMillisecondsSinceEpoch(entity.intValue!),
|
||||||
_ => null,
|
const (UserDto) =>
|
||||||
} as T?;
|
entity.strValue == null ? null : await IsarUserRepository(_db).getByUserId(entity.strValue!),
|
||||||
|
_ => null,
|
||||||
|
}
|
||||||
|
as T?;
|
||||||
|
|
||||||
Future<StoreValue> _fromValue<T>(StoreKey<T> key, T value) async {
|
Future<StoreValue> _fromValue<T>(StoreKey<T> key, T value) async {
|
||||||
final (int? intValue, String? strValue) = switch (key.type) {
|
final (int? intValue, String? strValue) = switch (key.type) {
|
||||||
|
|
@ -83,13 +82,8 @@ class IsarStoreRepository extends IsarDatabaseRepository {
|
||||||
const (String) => (null, value as String),
|
const (String) => (null, value as String),
|
||||||
const (bool) => ((value as bool) ? 1 : 0, null),
|
const (bool) => ((value as bool) ? 1 : 0, null),
|
||||||
const (DateTime) => ((value as DateTime).millisecondsSinceEpoch, null),
|
const (DateTime) => ((value as DateTime).millisecondsSinceEpoch, null),
|
||||||
const (UserDto) => (
|
const (UserDto) => (null, (await IsarUserRepository(_db).update(value as UserDto)).id),
|
||||||
null,
|
_ => throw UnsupportedError("Unsupported primitive type: ${key.type} for key: ${key.name}"),
|
||||||
(await IsarUserRepository(_db).update(value as UserDto)).id,
|
|
||||||
),
|
|
||||||
_ => throw UnsupportedError(
|
|
||||||
"Unsupported primitive type: ${key.type} for key: ${key.name}",
|
|
||||||
),
|
|
||||||
};
|
};
|
||||||
return StoreValue(key.id, intValue: intValue, strValue: strValue);
|
return StoreValue(key.id, intValue: intValue, strValue: strValue);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,10 +27,7 @@ class SyncApiRepository {
|
||||||
final client = httpClient ?? http.Client();
|
final client = httpClient ?? http.Client();
|
||||||
final endpoint = "${_api.apiClient.basePath}/sync/stream";
|
final endpoint = "${_api.apiClient.basePath}/sync/stream";
|
||||||
|
|
||||||
final headers = {
|
final headers = {'Content-Type': 'application/json', 'Accept': 'application/jsonlines+json'};
|
||||||
'Content-Type': 'application/json',
|
|
||||||
'Accept': 'application/jsonlines+json',
|
|
||||||
};
|
|
||||||
|
|
||||||
final headerParams = <String, String>{};
|
final headerParams = <String, String>{};
|
||||||
await _api.applyToParams([], headerParams);
|
await _api.applyToParams([], headerParams);
|
||||||
|
|
@ -78,10 +75,7 @@ class SyncApiRepository {
|
||||||
|
|
||||||
if (response.statusCode != 200) {
|
if (response.statusCode != 200) {
|
||||||
final errorBody = await response.stream.bytesToString();
|
final errorBody = await response.stream.bytesToString();
|
||||||
throw ApiException(
|
throw ApiException(response.statusCode, 'Failed to get sync stream: $errorBody');
|
||||||
response.statusCode,
|
|
||||||
'Failed to get sync stream: $errorBody',
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await for (final chunk in response.stream.transform(utf8.decoder)) {
|
await for (final chunk in response.stream.transform(utf8.decoder)) {
|
||||||
|
|
|
||||||
|
|
@ -42,16 +42,9 @@ class SyncStreamRepository extends DriftDatabaseRepository {
|
||||||
try {
|
try {
|
||||||
await _db.batch((batch) {
|
await _db.batch((batch) {
|
||||||
for (final user in data) {
|
for (final user in data) {
|
||||||
final companion = UserEntityCompanion(
|
final companion = UserEntityCompanion(name: Value(user.name), email: Value(user.email));
|
||||||
name: Value(user.name),
|
|
||||||
email: Value(user.email),
|
|
||||||
);
|
|
||||||
|
|
||||||
batch.insert(
|
batch.insert(_db.userEntity, companion.copyWith(id: Value(user.id)), onConflict: DoUpdate((_) => companion));
|
||||||
_db.userEntity,
|
|
||||||
companion.copyWith(id: Value(user.id)),
|
|
||||||
onConflict: DoUpdate((_) => companion),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (error, stack) {
|
} catch (error, stack) {
|
||||||
|
|
@ -66,10 +59,7 @@ class SyncStreamRepository extends DriftDatabaseRepository {
|
||||||
for (final partner in data) {
|
for (final partner in data) {
|
||||||
batch.delete(
|
batch.delete(
|
||||||
_db.partnerEntity,
|
_db.partnerEntity,
|
||||||
PartnerEntityCompanion(
|
PartnerEntityCompanion(sharedById: Value(partner.sharedById), sharedWithId: Value(partner.sharedWithId)),
|
||||||
sharedById: Value(partner.sharedById),
|
|
||||||
sharedWithId: Value(partner.sharedWithId),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -87,10 +77,7 @@ class SyncStreamRepository extends DriftDatabaseRepository {
|
||||||
|
|
||||||
batch.insert(
|
batch.insert(
|
||||||
_db.partnerEntity,
|
_db.partnerEntity,
|
||||||
companion.copyWith(
|
companion.copyWith(sharedById: Value(partner.sharedById), sharedWithId: Value(partner.sharedWithId)),
|
||||||
sharedById: Value(partner.sharedById),
|
|
||||||
sharedWithId: Value(partner.sharedWithId),
|
|
||||||
),
|
|
||||||
onConflict: DoUpdate((_) => companion),
|
onConflict: DoUpdate((_) => companion),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -101,24 +88,16 @@ class SyncStreamRepository extends DriftDatabaseRepository {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> deleteAssetsV1(
|
Future<void> deleteAssetsV1(Iterable<SyncAssetDeleteV1> data, {String debugLabel = 'user'}) async {
|
||||||
Iterable<SyncAssetDeleteV1> data, {
|
|
||||||
String debugLabel = 'user',
|
|
||||||
}) async {
|
|
||||||
try {
|
try {
|
||||||
await _db.remoteAssetEntity.deleteWhere(
|
await _db.remoteAssetEntity.deleteWhere((row) => row.id.isIn(data.map((e) => e.assetId)));
|
||||||
(row) => row.id.isIn(data.map((e) => e.assetId)),
|
|
||||||
);
|
|
||||||
} catch (error, stack) {
|
} catch (error, stack) {
|
||||||
_logger.severe('Error: deleteAssetsV1 - $debugLabel', error, stack);
|
_logger.severe('Error: deleteAssetsV1 - $debugLabel', error, stack);
|
||||||
rethrow;
|
rethrow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> updateAssetsV1(
|
Future<void> updateAssetsV1(Iterable<SyncAssetV1> data, {String debugLabel = 'user'}) async {
|
||||||
Iterable<SyncAssetV1> data, {
|
|
||||||
String debugLabel = 'user',
|
|
||||||
}) async {
|
|
||||||
try {
|
try {
|
||||||
await _db.batch((batch) {
|
await _db.batch((batch) {
|
||||||
for (final asset in data) {
|
for (final asset in data) {
|
||||||
|
|
@ -152,10 +131,7 @@ class SyncStreamRepository extends DriftDatabaseRepository {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> updateAssetsExifV1(
|
Future<void> updateAssetsExifV1(Iterable<SyncAssetExifV1> data, {String debugLabel = 'user'}) async {
|
||||||
Iterable<SyncAssetExifV1> data, {
|
|
||||||
String debugLabel = 'user',
|
|
||||||
}) async {
|
|
||||||
try {
|
try {
|
||||||
await _db.batch((batch) {
|
await _db.batch((batch) {
|
||||||
for (final exif in data) {
|
for (final exif in data) {
|
||||||
|
|
@ -191,20 +167,14 @@ class SyncStreamRepository extends DriftDatabaseRepository {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (error, stack) {
|
} catch (error, stack) {
|
||||||
_logger.severe(
|
_logger.severe('Error: updateAssetsExifV1 - $debugLabel', error, stack);
|
||||||
'Error: updateAssetsExifV1 - $debugLabel',
|
|
||||||
error,
|
|
||||||
stack,
|
|
||||||
);
|
|
||||||
rethrow;
|
rethrow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> deleteAlbumsV1(Iterable<SyncAlbumDeleteV1> data) async {
|
Future<void> deleteAlbumsV1(Iterable<SyncAlbumDeleteV1> data) async {
|
||||||
try {
|
try {
|
||||||
await _db.remoteAlbumEntity.deleteWhere(
|
await _db.remoteAlbumEntity.deleteWhere((row) => row.id.isIn(data.map((e) => e.albumId)));
|
||||||
(row) => row.id.isIn(data.map((e) => e.albumId)),
|
|
||||||
);
|
|
||||||
} catch (error, stack) {
|
} catch (error, stack) {
|
||||||
_logger.severe('Error: deleteAlbumsV1', error, stack);
|
_logger.severe('Error: deleteAlbumsV1', error, stack);
|
||||||
rethrow;
|
rethrow;
|
||||||
|
|
@ -245,10 +215,7 @@ class SyncStreamRepository extends DriftDatabaseRepository {
|
||||||
for (final album in data) {
|
for (final album in data) {
|
||||||
batch.delete(
|
batch.delete(
|
||||||
_db.remoteAlbumUserEntity,
|
_db.remoteAlbumUserEntity,
|
||||||
RemoteAlbumUserEntityCompanion(
|
RemoteAlbumUserEntityCompanion(albumId: Value(album.albumId), userId: Value(album.userId)),
|
||||||
albumId: Value(album.albumId),
|
|
||||||
userId: Value(album.userId),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -258,49 +225,32 @@ class SyncStreamRepository extends DriftDatabaseRepository {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> updateAlbumUsersV1(
|
Future<void> updateAlbumUsersV1(Iterable<SyncAlbumUserV1> data, {String debugLabel = 'user'}) async {
|
||||||
Iterable<SyncAlbumUserV1> data, {
|
|
||||||
String debugLabel = 'user',
|
|
||||||
}) async {
|
|
||||||
try {
|
try {
|
||||||
await _db.batch((batch) {
|
await _db.batch((batch) {
|
||||||
for (final album in data) {
|
for (final album in data) {
|
||||||
final companion = RemoteAlbumUserEntityCompanion(
|
final companion = RemoteAlbumUserEntityCompanion(role: Value(album.role.toAlbumUserRole()));
|
||||||
role: Value(album.role.toAlbumUserRole()),
|
|
||||||
);
|
|
||||||
|
|
||||||
batch.insert(
|
batch.insert(
|
||||||
_db.remoteAlbumUserEntity,
|
_db.remoteAlbumUserEntity,
|
||||||
companion.copyWith(
|
companion.copyWith(albumId: Value(album.albumId), userId: Value(album.userId)),
|
||||||
albumId: Value(album.albumId),
|
|
||||||
userId: Value(album.userId),
|
|
||||||
),
|
|
||||||
onConflict: DoUpdate((_) => companion),
|
onConflict: DoUpdate((_) => companion),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (error, stack) {
|
} catch (error, stack) {
|
||||||
_logger.severe(
|
_logger.severe('Error: updateAlbumUsersV1 - $debugLabel', error, stack);
|
||||||
'Error: updateAlbumUsersV1 - $debugLabel',
|
|
||||||
error,
|
|
||||||
stack,
|
|
||||||
);
|
|
||||||
rethrow;
|
rethrow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> deleteAlbumToAssetsV1(
|
Future<void> deleteAlbumToAssetsV1(Iterable<SyncAlbumToAssetDeleteV1> data) async {
|
||||||
Iterable<SyncAlbumToAssetDeleteV1> data,
|
|
||||||
) async {
|
|
||||||
try {
|
try {
|
||||||
await _db.batch((batch) {
|
await _db.batch((batch) {
|
||||||
for (final album in data) {
|
for (final album in data) {
|
||||||
batch.delete(
|
batch.delete(
|
||||||
_db.remoteAlbumAssetEntity,
|
_db.remoteAlbumAssetEntity,
|
||||||
RemoteAlbumAssetEntityCompanion(
|
RemoteAlbumAssetEntityCompanion(albumId: Value(album.albumId), assetId: Value(album.assetId)),
|
||||||
albumId: Value(album.albumId),
|
|
||||||
assetId: Value(album.assetId),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -310,10 +260,7 @@ class SyncStreamRepository extends DriftDatabaseRepository {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> updateAlbumToAssetsV1(
|
Future<void> updateAlbumToAssetsV1(Iterable<SyncAlbumToAssetV1> data, {String debugLabel = 'user'}) async {
|
||||||
Iterable<SyncAlbumToAssetV1> data, {
|
|
||||||
String debugLabel = 'user',
|
|
||||||
}) async {
|
|
||||||
try {
|
try {
|
||||||
await _db.batch((batch) {
|
await _db.batch((batch) {
|
||||||
for (final album in data) {
|
for (final album in data) {
|
||||||
|
|
@ -322,19 +269,11 @@ class SyncStreamRepository extends DriftDatabaseRepository {
|
||||||
assetId: Value(album.assetId),
|
assetId: Value(album.assetId),
|
||||||
);
|
);
|
||||||
|
|
||||||
batch.insert(
|
batch.insert(_db.remoteAlbumAssetEntity, companion, onConflict: DoNothing());
|
||||||
_db.remoteAlbumAssetEntity,
|
|
||||||
companion,
|
|
||||||
onConflict: DoNothing(),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (error, stack) {
|
} catch (error, stack) {
|
||||||
_logger.severe(
|
_logger.severe('Error: updateAlbumToAssetsV1 - $debugLabel', error, stack);
|
||||||
'Error: updateAlbumToAssetsV1 - $debugLabel',
|
|
||||||
error,
|
|
||||||
stack,
|
|
||||||
);
|
|
||||||
rethrow;
|
rethrow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -371,9 +310,7 @@ class SyncStreamRepository extends DriftDatabaseRepository {
|
||||||
|
|
||||||
Future<void> deleteMemoriesV1(Iterable<SyncMemoryDeleteV1> data) async {
|
Future<void> deleteMemoriesV1(Iterable<SyncMemoryDeleteV1> data) async {
|
||||||
try {
|
try {
|
||||||
await _db.memoryEntity.deleteWhere(
|
await _db.memoryEntity.deleteWhere((row) => row.id.isIn(data.map((e) => e.memoryId)));
|
||||||
(row) => row.id.isIn(data.map((e) => e.memoryId)),
|
|
||||||
);
|
|
||||||
} catch (error, stack) {
|
} catch (error, stack) {
|
||||||
_logger.severe('Error: deleteMemoriesV1', error, stack);
|
_logger.severe('Error: deleteMemoriesV1', error, stack);
|
||||||
rethrow;
|
rethrow;
|
||||||
|
|
@ -384,16 +321,9 @@ class SyncStreamRepository extends DriftDatabaseRepository {
|
||||||
try {
|
try {
|
||||||
await _db.batch((batch) {
|
await _db.batch((batch) {
|
||||||
for (final asset in data) {
|
for (final asset in data) {
|
||||||
final companion = MemoryAssetEntityCompanion(
|
final companion = MemoryAssetEntityCompanion(memoryId: Value(asset.memoryId), assetId: Value(asset.assetId));
|
||||||
memoryId: Value(asset.memoryId),
|
|
||||||
assetId: Value(asset.assetId),
|
|
||||||
);
|
|
||||||
|
|
||||||
batch.insert(
|
batch.insert(_db.memoryAssetEntity, companion, onConflict: DoNothing());
|
||||||
_db.memoryAssetEntity,
|
|
||||||
companion,
|
|
||||||
onConflict: DoNothing(),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (error, stack) {
|
} catch (error, stack) {
|
||||||
|
|
@ -402,18 +332,13 @@ class SyncStreamRepository extends DriftDatabaseRepository {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> deleteMemoryAssetsV1(
|
Future<void> deleteMemoryAssetsV1(Iterable<SyncMemoryAssetDeleteV1> data) async {
|
||||||
Iterable<SyncMemoryAssetDeleteV1> data,
|
|
||||||
) async {
|
|
||||||
try {
|
try {
|
||||||
await _db.batch((batch) {
|
await _db.batch((batch) {
|
||||||
for (final asset in data) {
|
for (final asset in data) {
|
||||||
batch.delete(
|
batch.delete(
|
||||||
_db.memoryAssetEntity,
|
_db.memoryAssetEntity,
|
||||||
MemoryAssetEntityCompanion(
|
MemoryAssetEntityCompanion(memoryId: Value(asset.memoryId), assetId: Value(asset.assetId)),
|
||||||
memoryId: Value(asset.memoryId),
|
|
||||||
assetId: Value(asset.assetId),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -423,10 +348,7 @@ class SyncStreamRepository extends DriftDatabaseRepository {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> updateStacksV1(
|
Future<void> updateStacksV1(Iterable<SyncStackV1> data, {String debugLabel = 'user'}) async {
|
||||||
Iterable<SyncStackV1> data, {
|
|
||||||
String debugLabel = 'user',
|
|
||||||
}) async {
|
|
||||||
try {
|
try {
|
||||||
await _db.batch((batch) {
|
await _db.batch((batch) {
|
||||||
for (final stack in data) {
|
for (final stack in data) {
|
||||||
|
|
@ -450,36 +372,24 @@ class SyncStreamRepository extends DriftDatabaseRepository {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> deleteStacksV1(
|
Future<void> deleteStacksV1(Iterable<SyncStackDeleteV1> data, {String debugLabel = 'user'}) async {
|
||||||
Iterable<SyncStackDeleteV1> data, {
|
|
||||||
String debugLabel = 'user',
|
|
||||||
}) async {
|
|
||||||
try {
|
try {
|
||||||
await _db.stackEntity.deleteWhere(
|
await _db.stackEntity.deleteWhere((row) => row.id.isIn(data.map((e) => e.stackId)));
|
||||||
(row) => row.id.isIn(data.map((e) => e.stackId)),
|
|
||||||
);
|
|
||||||
} catch (error, stack) {
|
} catch (error, stack) {
|
||||||
_logger.severe('Error: deleteStacksV1 - $debugLabel', error, stack);
|
_logger.severe('Error: deleteStacksV1 - $debugLabel', error, stack);
|
||||||
rethrow;
|
rethrow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> updateUserMetadatasV1(
|
Future<void> updateUserMetadatasV1(Iterable<SyncUserMetadataV1> data) async {
|
||||||
Iterable<SyncUserMetadataV1> data,
|
|
||||||
) async {
|
|
||||||
try {
|
try {
|
||||||
await _db.batch((batch) {
|
await _db.batch((batch) {
|
||||||
for (final userMetadata in data) {
|
for (final userMetadata in data) {
|
||||||
final companion = UserMetadataEntityCompanion(
|
final companion = UserMetadataEntityCompanion(value: Value(userMetadata.value as Map<String, Object?>));
|
||||||
value: Value(userMetadata.value as Map<String, Object?>),
|
|
||||||
);
|
|
||||||
|
|
||||||
batch.insert(
|
batch.insert(
|
||||||
_db.userMetadataEntity,
|
_db.userMetadataEntity,
|
||||||
companion.copyWith(
|
companion.copyWith(userId: Value(userMetadata.userId), key: Value(userMetadata.key.toUserMetadataKey())),
|
||||||
userId: Value(userMetadata.userId),
|
|
||||||
key: Value(userMetadata.key.toUserMetadataKey()),
|
|
||||||
),
|
|
||||||
onConflict: DoUpdate((_) => companion),
|
onConflict: DoUpdate((_) => companion),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -490,9 +400,7 @@ class SyncStreamRepository extends DriftDatabaseRepository {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> deleteUserMetadatasV1(
|
Future<void> deleteUserMetadatasV1(Iterable<SyncUserMetadataDeleteV1> data) async {
|
||||||
Iterable<SyncUserMetadataDeleteV1> data,
|
|
||||||
) async {
|
|
||||||
try {
|
try {
|
||||||
await _db.batch((batch) {
|
await _db.batch((batch) {
|
||||||
for (final userMetadata in data) {
|
for (final userMetadata in data) {
|
||||||
|
|
@ -540,16 +448,11 @@ class SyncStreamRepository extends DriftDatabaseRepository {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> deletePeopleV1(
|
Future<void> deletePeopleV1(Iterable<SyncPersonDeleteV1> data) async {
|
||||||
Iterable<SyncPersonDeleteV1> data,
|
|
||||||
) async {
|
|
||||||
try {
|
try {
|
||||||
await _db.batch((batch) {
|
await _db.batch((batch) {
|
||||||
for (final person in data) {
|
for (final person in data) {
|
||||||
batch.deleteWhere(
|
batch.deleteWhere(_db.personEntity, (row) => row.id.equals(person.personId));
|
||||||
_db.personEntity,
|
|
||||||
(row) => row.id.equals(person.personId),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (error, stack) {
|
} catch (error, stack) {
|
||||||
|
|
@ -591,10 +494,7 @@ class SyncStreamRepository extends DriftDatabaseRepository {
|
||||||
try {
|
try {
|
||||||
await _db.batch((batch) {
|
await _db.batch((batch) {
|
||||||
for (final assetFace in data) {
|
for (final assetFace in data) {
|
||||||
batch.deleteWhere(
|
batch.deleteWhere(_db.assetFaceEntity, (row) => row.id.equals(assetFace.assetFaceId));
|
||||||
_db.assetFaceEntity,
|
|
||||||
(row) => row.id.equals(assetFace.assetFaceId),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (error, stack) {
|
} catch (error, stack) {
|
||||||
|
|
@ -606,54 +506,54 @@ class SyncStreamRepository extends DriftDatabaseRepository {
|
||||||
|
|
||||||
extension on AssetTypeEnum {
|
extension on AssetTypeEnum {
|
||||||
AssetType toAssetType() => switch (this) {
|
AssetType toAssetType() => switch (this) {
|
||||||
AssetTypeEnum.IMAGE => AssetType.image,
|
AssetTypeEnum.IMAGE => AssetType.image,
|
||||||
AssetTypeEnum.VIDEO => AssetType.video,
|
AssetTypeEnum.VIDEO => AssetType.video,
|
||||||
AssetTypeEnum.AUDIO => AssetType.audio,
|
AssetTypeEnum.AUDIO => AssetType.audio,
|
||||||
AssetTypeEnum.OTHER => AssetType.other,
|
AssetTypeEnum.OTHER => AssetType.other,
|
||||||
_ => throw Exception('Unknown AssetType value: $this'),
|
_ => throw Exception('Unknown AssetType value: $this'),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
extension on AssetOrder {
|
extension on AssetOrder {
|
||||||
AlbumAssetOrder toAlbumAssetOrder() => switch (this) {
|
AlbumAssetOrder toAlbumAssetOrder() => switch (this) {
|
||||||
AssetOrder.asc => AlbumAssetOrder.asc,
|
AssetOrder.asc => AlbumAssetOrder.asc,
|
||||||
AssetOrder.desc => AlbumAssetOrder.desc,
|
AssetOrder.desc => AlbumAssetOrder.desc,
|
||||||
_ => throw Exception('Unknown AssetOrder value: $this'),
|
_ => throw Exception('Unknown AssetOrder value: $this'),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
extension on MemoryType {
|
extension on MemoryType {
|
||||||
MemoryTypeEnum toMemoryType() => switch (this) {
|
MemoryTypeEnum toMemoryType() => switch (this) {
|
||||||
MemoryType.onThisDay => MemoryTypeEnum.onThisDay,
|
MemoryType.onThisDay => MemoryTypeEnum.onThisDay,
|
||||||
_ => throw Exception('Unknown MemoryType value: $this'),
|
_ => throw Exception('Unknown MemoryType value: $this'),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
extension on api.AlbumUserRole {
|
extension on api.AlbumUserRole {
|
||||||
AlbumUserRole toAlbumUserRole() => switch (this) {
|
AlbumUserRole toAlbumUserRole() => switch (this) {
|
||||||
api.AlbumUserRole.editor => AlbumUserRole.editor,
|
api.AlbumUserRole.editor => AlbumUserRole.editor,
|
||||||
api.AlbumUserRole.viewer => AlbumUserRole.viewer,
|
api.AlbumUserRole.viewer => AlbumUserRole.viewer,
|
||||||
_ => throw Exception('Unknown AlbumUserRole value: $this'),
|
_ => throw Exception('Unknown AlbumUserRole value: $this'),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
extension on api.AssetVisibility {
|
extension on api.AssetVisibility {
|
||||||
AssetVisibility toAssetVisibility() => switch (this) {
|
AssetVisibility toAssetVisibility() => switch (this) {
|
||||||
api.AssetVisibility.timeline => AssetVisibility.timeline,
|
api.AssetVisibility.timeline => AssetVisibility.timeline,
|
||||||
api.AssetVisibility.hidden => AssetVisibility.hidden,
|
api.AssetVisibility.hidden => AssetVisibility.hidden,
|
||||||
api.AssetVisibility.archive => AssetVisibility.archive,
|
api.AssetVisibility.archive => AssetVisibility.archive,
|
||||||
api.AssetVisibility.locked => AssetVisibility.locked,
|
api.AssetVisibility.locked => AssetVisibility.locked,
|
||||||
_ => throw Exception('Unknown AssetVisibility value: $this'),
|
_ => throw Exception('Unknown AssetVisibility value: $this'),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
extension on api.UserMetadataKey {
|
extension on api.UserMetadataKey {
|
||||||
UserMetadataKey toUserMetadataKey() => switch (this) {
|
UserMetadataKey toUserMetadataKey() => switch (this) {
|
||||||
api.UserMetadataKey.onboarding => UserMetadataKey.onboarding,
|
api.UserMetadataKey.onboarding => UserMetadataKey.onboarding,
|
||||||
api.UserMetadataKey.preferences => UserMetadataKey.preferences,
|
api.UserMetadataKey.preferences => UserMetadataKey.preferences,
|
||||||
api.UserMetadataKey.license => UserMetadataKey.license,
|
api.UserMetadataKey.license => UserMetadataKey.license,
|
||||||
_ => throw Exception('Unknown UserMetadataKey value: $this'),
|
_ => throw Exception('Unknown UserMetadataKey value: $this'),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
extension on String {
|
extension on String {
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,7 @@ class DriftTimelineRepository extends DriftDatabaseRepository {
|
||||||
Stream<List<String>> watchTimelineUserIds(String userId) {
|
Stream<List<String>> watchTimelineUserIds(String userId) {
|
||||||
final query = _db.partnerEntity.selectOnly()
|
final query = _db.partnerEntity.selectOnly()
|
||||||
..addColumns([_db.partnerEntity.sharedById])
|
..addColumns([_db.partnerEntity.sharedById])
|
||||||
..where(
|
..where(_db.partnerEntity.inTimeline.equals(true) & _db.partnerEntity.sharedWithId.equals(userId));
|
||||||
_db.partnerEntity.inTimeline.equals(true) & _db.partnerEntity.sharedWithId.equals(userId),
|
|
||||||
);
|
|
||||||
|
|
||||||
return query
|
return query
|
||||||
.map((row) => row.read(_db.partnerEntity.sharedById)!)
|
.map((row) => row.read(_db.partnerEntity.sharedById)!)
|
||||||
|
|
@ -33,25 +31,13 @@ class DriftTimelineRepository extends DriftDatabaseRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
TimelineQuery main(List<String> userIds, GroupAssetsBy groupBy) => (
|
TimelineQuery main(List<String> userIds, GroupAssetsBy groupBy) => (
|
||||||
bucketSource: () => _watchMainBucket(
|
bucketSource: () => _watchMainBucket(userIds, groupBy: groupBy),
|
||||||
userIds,
|
assetSource: (offset, count) => _getMainBucketAssets(userIds, offset: offset, count: count),
|
||||||
groupBy: groupBy,
|
);
|
||||||
),
|
|
||||||
assetSource: (offset, count) => _getMainBucketAssets(
|
|
||||||
userIds,
|
|
||||||
offset: offset,
|
|
||||||
count: count,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
Stream<List<Bucket>> _watchMainBucket(
|
Stream<List<Bucket>> _watchMainBucket(List<String> userIds, {GroupAssetsBy groupBy = GroupAssetsBy.day}) {
|
||||||
List<String> userIds, {
|
|
||||||
GroupAssetsBy groupBy = GroupAssetsBy.day,
|
|
||||||
}) {
|
|
||||||
if (groupBy == GroupAssetsBy.none) {
|
if (groupBy == GroupAssetsBy.none) {
|
||||||
throw UnsupportedError(
|
throw UnsupportedError("GroupAssetsBy.none is not supported for watchMainBucket");
|
||||||
"GroupAssetsBy.none is not supported for watchMainBucket",
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return _db.mergedAssetDrift
|
return _db.mergedAssetDrift
|
||||||
|
|
@ -64,11 +50,7 @@ class DriftTimelineRepository extends DriftDatabaseRepository {
|
||||||
.throttle(const Duration(seconds: 3), trailing: true);
|
.throttle(const Duration(seconds: 3), trailing: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<List<BaseAsset>> _getMainBucketAssets(
|
Future<List<BaseAsset>> _getMainBucketAssets(List<String> userIds, {required int offset, required int count}) {
|
||||||
List<String> userIds, {
|
|
||||||
required int offset,
|
|
||||||
required int count,
|
|
||||||
}) {
|
|
||||||
return _db.mergedAssetDrift
|
return _db.mergedAssetDrift
|
||||||
.mergedAsset(userIds, limit: (_) => Limit(count, offset))
|
.mergedAsset(userIds, limit: (_) => Limit(count, offset))
|
||||||
.map(
|
.map(
|
||||||
|
|
@ -109,21 +91,11 @@ class DriftTimelineRepository extends DriftDatabaseRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
TimelineQuery localAlbum(String albumId, GroupAssetsBy groupBy) => (
|
TimelineQuery localAlbum(String albumId, GroupAssetsBy groupBy) => (
|
||||||
bucketSource: () => _watchLocalAlbumBucket(
|
bucketSource: () => _watchLocalAlbumBucket(albumId, groupBy: groupBy),
|
||||||
albumId,
|
assetSource: (offset, count) => _getLocalAlbumBucketAssets(albumId, offset: offset, count: count),
|
||||||
groupBy: groupBy,
|
);
|
||||||
),
|
|
||||||
assetSource: (offset, count) => _getLocalAlbumBucketAssets(
|
|
||||||
albumId,
|
|
||||||
offset: offset,
|
|
||||||
count: count,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
Stream<List<Bucket>> _watchLocalAlbumBucket(
|
Stream<List<Bucket>> _watchLocalAlbumBucket(String albumId, {GroupAssetsBy groupBy = GroupAssetsBy.day}) {
|
||||||
String albumId, {
|
|
||||||
GroupAssetsBy groupBy = GroupAssetsBy.day,
|
|
||||||
}) {
|
|
||||||
if (groupBy == GroupAssetsBy.none) {
|
if (groupBy == GroupAssetsBy.none) {
|
||||||
return _db.localAlbumAssetEntity
|
return _db.localAlbumAssetEntity
|
||||||
.count(where: (row) => row.albumId.equals(albumId))
|
.count(where: (row) => row.albumId.equals(albumId))
|
||||||
|
|
@ -134,22 +106,23 @@ class DriftTimelineRepository extends DriftDatabaseRepository {
|
||||||
final assetCountExp = _db.localAssetEntity.id.count();
|
final assetCountExp = _db.localAssetEntity.id.count();
|
||||||
final dateExp = _db.localAssetEntity.createdAt.dateFmt(groupBy);
|
final dateExp = _db.localAssetEntity.createdAt.dateFmt(groupBy);
|
||||||
|
|
||||||
final query = _db.localAssetEntity.selectOnly().join([
|
final query =
|
||||||
innerJoin(
|
_db.localAssetEntity.selectOnly().join([
|
||||||
_db.localAlbumAssetEntity,
|
innerJoin(
|
||||||
_db.localAlbumAssetEntity.assetId.equalsExp(_db.localAssetEntity.id),
|
_db.localAlbumAssetEntity,
|
||||||
useColumns: false,
|
_db.localAlbumAssetEntity.assetId.equalsExp(_db.localAssetEntity.id),
|
||||||
),
|
useColumns: false,
|
||||||
leftOuterJoin(
|
),
|
||||||
_db.remoteAssetEntity,
|
leftOuterJoin(
|
||||||
_db.localAssetEntity.checksum.equalsExp(_db.remoteAssetEntity.checksum),
|
_db.remoteAssetEntity,
|
||||||
useColumns: false,
|
_db.localAssetEntity.checksum.equalsExp(_db.remoteAssetEntity.checksum),
|
||||||
),
|
useColumns: false,
|
||||||
])
|
),
|
||||||
..addColumns([assetCountExp, dateExp])
|
])
|
||||||
..where(_db.localAlbumAssetEntity.albumId.equals(albumId))
|
..addColumns([assetCountExp, dateExp])
|
||||||
..groupBy([dateExp])
|
..where(_db.localAlbumAssetEntity.albumId.equals(albumId))
|
||||||
..orderBy([OrderingTerm.desc(dateExp)]);
|
..groupBy([dateExp])
|
||||||
|
..orderBy([OrderingTerm.desc(dateExp)]);
|
||||||
|
|
||||||
return query.map((row) {
|
return query.map((row) {
|
||||||
final timeline = row.read(dateExp)!.dateFmt(groupBy);
|
final timeline = row.read(dateExp)!.dateFmt(groupBy);
|
||||||
|
|
@ -158,54 +131,37 @@ class DriftTimelineRepository extends DriftDatabaseRepository {
|
||||||
}).watch();
|
}).watch();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<List<BaseAsset>> _getLocalAlbumBucketAssets(
|
Future<List<BaseAsset>> _getLocalAlbumBucketAssets(String albumId, {required int offset, required int count}) {
|
||||||
String albumId, {
|
final query =
|
||||||
required int offset,
|
_db.localAssetEntity.select().join([
|
||||||
required int count,
|
innerJoin(
|
||||||
}) {
|
_db.localAlbumAssetEntity,
|
||||||
final query = _db.localAssetEntity.select().join(
|
_db.localAlbumAssetEntity.assetId.equalsExp(_db.localAssetEntity.id),
|
||||||
[
|
useColumns: false,
|
||||||
innerJoin(
|
),
|
||||||
_db.localAlbumAssetEntity,
|
leftOuterJoin(
|
||||||
_db.localAlbumAssetEntity.assetId.equalsExp(_db.localAssetEntity.id),
|
_db.remoteAssetEntity,
|
||||||
useColumns: false,
|
_db.localAssetEntity.checksum.equalsExp(_db.remoteAssetEntity.checksum),
|
||||||
),
|
useColumns: false,
|
||||||
leftOuterJoin(
|
),
|
||||||
_db.remoteAssetEntity,
|
])
|
||||||
_db.localAssetEntity.checksum.equalsExp(_db.remoteAssetEntity.checksum),
|
..addColumns([_db.remoteAssetEntity.id])
|
||||||
useColumns: false,
|
..where(_db.localAlbumAssetEntity.albumId.equals(albumId))
|
||||||
),
|
..orderBy([OrderingTerm.desc(_db.localAssetEntity.createdAt)])
|
||||||
],
|
..limit(count, offset: offset);
|
||||||
)
|
|
||||||
..addColumns([_db.remoteAssetEntity.id])
|
|
||||||
..where(_db.localAlbumAssetEntity.albumId.equals(albumId))
|
|
||||||
..orderBy([OrderingTerm.desc(_db.localAssetEntity.createdAt)])
|
|
||||||
..limit(count, offset: offset);
|
|
||||||
|
|
||||||
return query.map((row) {
|
return query.map((row) {
|
||||||
final asset = row.readTable(_db.localAssetEntity).toDto();
|
final asset = row.readTable(_db.localAssetEntity).toDto();
|
||||||
return asset.copyWith(
|
return asset.copyWith(remoteId: row.read(_db.remoteAssetEntity.id));
|
||||||
remoteId: row.read(_db.remoteAssetEntity.id),
|
|
||||||
);
|
|
||||||
}).get();
|
}).get();
|
||||||
}
|
}
|
||||||
|
|
||||||
TimelineQuery remoteAlbum(String albumId, GroupAssetsBy groupBy) => (
|
TimelineQuery remoteAlbum(String albumId, GroupAssetsBy groupBy) => (
|
||||||
bucketSource: () => _watchRemoteAlbumBucket(
|
bucketSource: () => _watchRemoteAlbumBucket(albumId, groupBy: groupBy),
|
||||||
albumId,
|
assetSource: (offset, count) => _getRemoteAlbumBucketAssets(albumId, offset: offset, count: count),
|
||||||
groupBy: groupBy,
|
);
|
||||||
),
|
|
||||||
assetSource: (offset, count) => _getRemoteAlbumBucketAssets(
|
|
||||||
albumId,
|
|
||||||
offset: offset,
|
|
||||||
count: count,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
Stream<List<Bucket>> _watchRemoteAlbumBucket(
|
Stream<List<Bucket>> _watchRemoteAlbumBucket(String albumId, {GroupAssetsBy groupBy = GroupAssetsBy.day}) {
|
||||||
String albumId, {
|
|
||||||
GroupAssetsBy groupBy = GroupAssetsBy.day,
|
|
||||||
}) {
|
|
||||||
if (groupBy == GroupAssetsBy.none) {
|
if (groupBy == GroupAssetsBy.none) {
|
||||||
return _db.remoteAlbumAssetEntity
|
return _db.remoteAlbumAssetEntity
|
||||||
.count(where: (row) => row.albumId.equals(albumId))
|
.count(where: (row) => row.albumId.equals(albumId))
|
||||||
|
|
@ -213,56 +169,53 @@ class DriftTimelineRepository extends DriftDatabaseRepository {
|
||||||
.watch()
|
.watch()
|
||||||
.map((results) => results.isNotEmpty ? results.first : <Bucket>[])
|
.map((results) => results.isNotEmpty ? results.first : <Bucket>[])
|
||||||
.handleError((error) {
|
.handleError((error) {
|
||||||
return [];
|
return [];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return (_db.remoteAlbumEntity.select()..where((row) => row.id.equals(albumId))).watch().switchMap((albums) {
|
return (_db.remoteAlbumEntity.select()..where((row) => row.id.equals(albumId)))
|
||||||
if (albums.isEmpty) {
|
.watch()
|
||||||
return Stream.value(<Bucket>[]);
|
.switchMap((albums) {
|
||||||
}
|
if (albums.isEmpty) {
|
||||||
|
return Stream.value(<Bucket>[]);
|
||||||
|
}
|
||||||
|
|
||||||
final album = albums.first;
|
final album = albums.first;
|
||||||
final isAscending = album.order == AlbumAssetOrder.asc;
|
final isAscending = album.order == AlbumAssetOrder.asc;
|
||||||
final assetCountExp = _db.remoteAssetEntity.id.count();
|
final assetCountExp = _db.remoteAssetEntity.id.count();
|
||||||
final dateExp = _db.remoteAssetEntity.createdAt.dateFmt(groupBy);
|
final dateExp = _db.remoteAssetEntity.createdAt.dateFmt(groupBy);
|
||||||
|
|
||||||
final query = _db.remoteAssetEntity.selectOnly()
|
final query = _db.remoteAssetEntity.selectOnly()
|
||||||
..addColumns([assetCountExp, dateExp])
|
..addColumns([assetCountExp, dateExp])
|
||||||
..join([
|
..join([
|
||||||
innerJoin(
|
innerJoin(
|
||||||
_db.remoteAlbumAssetEntity,
|
_db.remoteAlbumAssetEntity,
|
||||||
_db.remoteAlbumAssetEntity.assetId.equalsExp(_db.remoteAssetEntity.id),
|
_db.remoteAlbumAssetEntity.assetId.equalsExp(_db.remoteAssetEntity.id),
|
||||||
useColumns: false,
|
useColumns: false,
|
||||||
),
|
),
|
||||||
])
|
])
|
||||||
..where(
|
..where(_db.remoteAssetEntity.deletedAt.isNull() & _db.remoteAlbumAssetEntity.albumId.equals(albumId))
|
||||||
_db.remoteAssetEntity.deletedAt.isNull() & _db.remoteAlbumAssetEntity.albumId.equals(albumId),
|
..groupBy([dateExp]);
|
||||||
)
|
|
||||||
..groupBy([dateExp]);
|
|
||||||
|
|
||||||
if (isAscending) {
|
if (isAscending) {
|
||||||
query.orderBy([OrderingTerm.asc(dateExp)]);
|
query.orderBy([OrderingTerm.asc(dateExp)]);
|
||||||
} else {
|
} else {
|
||||||
query.orderBy([OrderingTerm.desc(dateExp)]);
|
query.orderBy([OrderingTerm.desc(dateExp)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return query.map((row) {
|
return query.map((row) {
|
||||||
final timeline = row.read(dateExp)!.dateFmt(groupBy);
|
final timeline = row.read(dateExp)!.dateFmt(groupBy);
|
||||||
final assetCount = row.read(assetCountExp)!;
|
final assetCount = row.read(assetCountExp)!;
|
||||||
return TimeBucket(date: timeline, assetCount: assetCount);
|
return TimeBucket(date: timeline, assetCount: assetCount);
|
||||||
}).watch();
|
}).watch();
|
||||||
}).handleError((error) {
|
})
|
||||||
// If there's an error (e.g., album was deleted), return empty buckets
|
.handleError((error) {
|
||||||
return <Bucket>[];
|
// If there's an error (e.g., album was deleted), return empty buckets
|
||||||
});
|
return <Bucket>[];
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<List<BaseAsset>> _getRemoteAlbumBucketAssets(
|
Future<List<BaseAsset>> _getRemoteAlbumBucketAssets(String albumId, {required int offset, required int count}) async {
|
||||||
String albumId, {
|
|
||||||
required int offset,
|
|
||||||
required int count,
|
|
||||||
}) async {
|
|
||||||
final albumData = await (_db.remoteAlbumEntity.select()..where((row) => row.id.equals(albumId))).getSingleOrNull();
|
final albumData = await (_db.remoteAlbumEntity.select()..where((row) => row.id.equals(albumId))).getSingleOrNull();
|
||||||
|
|
||||||
// If album doesn't exist (was deleted), return empty list
|
// If album doesn't exist (was deleted), return empty list
|
||||||
|
|
@ -272,17 +225,13 @@ class DriftTimelineRepository extends DriftDatabaseRepository {
|
||||||
|
|
||||||
final isAscending = albumData.order == AlbumAssetOrder.asc;
|
final isAscending = albumData.order == AlbumAssetOrder.asc;
|
||||||
|
|
||||||
final query = _db.remoteAssetEntity.select().join(
|
final query = _db.remoteAssetEntity.select().join([
|
||||||
[
|
innerJoin(
|
||||||
innerJoin(
|
_db.remoteAlbumAssetEntity,
|
||||||
_db.remoteAlbumAssetEntity,
|
_db.remoteAlbumAssetEntity.assetId.equalsExp(_db.remoteAssetEntity.id),
|
||||||
_db.remoteAlbumAssetEntity.assetId.equalsExp(_db.remoteAssetEntity.id),
|
useColumns: false,
|
||||||
useColumns: false,
|
),
|
||||||
),
|
])..where(_db.remoteAssetEntity.deletedAt.isNull() & _db.remoteAlbumAssetEntity.albumId.equals(albumId));
|
||||||
],
|
|
||||||
)..where(
|
|
||||||
_db.remoteAssetEntity.deletedAt.isNull() & _db.remoteAlbumAssetEntity.albumId.equals(albumId),
|
|
||||||
);
|
|
||||||
|
|
||||||
if (isAscending) {
|
if (isAscending) {
|
||||||
query.orderBy([OrderingTerm.asc(_db.remoteAssetEntity.createdAt)]);
|
query.orderBy([OrderingTerm.asc(_db.remoteAssetEntity.createdAt)]);
|
||||||
|
|
@ -296,69 +245,57 @@ class DriftTimelineRepository extends DriftDatabaseRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
TimelineQuery fromAssets(List<BaseAsset> assets) => (
|
TimelineQuery fromAssets(List<BaseAsset> assets) => (
|
||||||
bucketSource: () => Stream.value(_generateBuckets(assets.length)),
|
bucketSource: () => Stream.value(_generateBuckets(assets.length)),
|
||||||
assetSource: (offset, count) => Future.value(assets.skip(offset).take(count).toList()),
|
assetSource: (offset, count) => Future.value(assets.skip(offset).take(count).toList()),
|
||||||
);
|
);
|
||||||
|
|
||||||
TimelineQuery remote(String ownerId, GroupAssetsBy groupBy) => _remoteQueryBuilder(
|
TimelineQuery remote(String ownerId, GroupAssetsBy groupBy) => _remoteQueryBuilder(
|
||||||
filter: (row) =>
|
filter: (row) =>
|
||||||
row.deletedAt.isNull() & row.visibility.equalsValue(AssetVisibility.timeline) & row.ownerId.equals(ownerId),
|
row.deletedAt.isNull() & row.visibility.equalsValue(AssetVisibility.timeline) & row.ownerId.equals(ownerId),
|
||||||
groupBy: groupBy,
|
groupBy: groupBy,
|
||||||
);
|
);
|
||||||
|
|
||||||
TimelineQuery favorite(String userId, GroupAssetsBy groupBy) => _remoteQueryBuilder(
|
TimelineQuery favorite(String userId, GroupAssetsBy groupBy) => _remoteQueryBuilder(
|
||||||
filter: (row) => row.deletedAt.isNull() & row.isFavorite.equals(true) & row.ownerId.equals(userId),
|
filter: (row) => row.deletedAt.isNull() & row.isFavorite.equals(true) & row.ownerId.equals(userId),
|
||||||
groupBy: groupBy,
|
groupBy: groupBy,
|
||||||
);
|
);
|
||||||
|
|
||||||
TimelineQuery trash(String userId, GroupAssetsBy groupBy) => _remoteQueryBuilder(
|
TimelineQuery trash(String userId, GroupAssetsBy groupBy) => _remoteQueryBuilder(
|
||||||
filter: (row) => row.deletedAt.isNotNull() & row.ownerId.equals(userId),
|
filter: (row) => row.deletedAt.isNotNull() & row.ownerId.equals(userId),
|
||||||
groupBy: groupBy,
|
groupBy: groupBy,
|
||||||
joinLocal: true,
|
joinLocal: true,
|
||||||
);
|
);
|
||||||
|
|
||||||
TimelineQuery archived(String userId, GroupAssetsBy groupBy) => _remoteQueryBuilder(
|
TimelineQuery archived(String userId, GroupAssetsBy groupBy) => _remoteQueryBuilder(
|
||||||
filter: (row) =>
|
filter: (row) =>
|
||||||
row.deletedAt.isNull() & row.ownerId.equals(userId) & row.visibility.equalsValue(AssetVisibility.archive),
|
row.deletedAt.isNull() & row.ownerId.equals(userId) & row.visibility.equalsValue(AssetVisibility.archive),
|
||||||
groupBy: groupBy,
|
groupBy: groupBy,
|
||||||
);
|
);
|
||||||
|
|
||||||
TimelineQuery locked(String userId, GroupAssetsBy groupBy) => _remoteQueryBuilder(
|
TimelineQuery locked(String userId, GroupAssetsBy groupBy) => _remoteQueryBuilder(
|
||||||
filter: (row) =>
|
filter: (row) =>
|
||||||
row.deletedAt.isNull() & row.visibility.equalsValue(AssetVisibility.locked) & row.ownerId.equals(userId),
|
row.deletedAt.isNull() & row.visibility.equalsValue(AssetVisibility.locked) & row.ownerId.equals(userId),
|
||||||
groupBy: groupBy,
|
groupBy: groupBy,
|
||||||
);
|
);
|
||||||
|
|
||||||
TimelineQuery video(String userId, GroupAssetsBy groupBy) => _remoteQueryBuilder(
|
TimelineQuery video(String userId, GroupAssetsBy groupBy) => _remoteQueryBuilder(
|
||||||
filter: (row) =>
|
filter: (row) =>
|
||||||
row.deletedAt.isNull() &
|
row.deletedAt.isNull() &
|
||||||
row.type.equalsValue(AssetType.video) &
|
row.type.equalsValue(AssetType.video) &
|
||||||
row.visibility.equalsValue(AssetVisibility.timeline) &
|
row.visibility.equalsValue(AssetVisibility.timeline) &
|
||||||
row.ownerId.equals(userId),
|
row.ownerId.equals(userId),
|
||||||
groupBy: groupBy,
|
groupBy: groupBy,
|
||||||
);
|
);
|
||||||
|
|
||||||
TimelineQuery place(String place, GroupAssetsBy groupBy) => (
|
TimelineQuery place(String place, GroupAssetsBy groupBy) => (
|
||||||
bucketSource: () => _watchPlaceBucket(
|
bucketSource: () => _watchPlaceBucket(place, groupBy: groupBy),
|
||||||
place,
|
assetSource: (offset, count) => _getPlaceBucketAssets(place, offset: offset, count: count),
|
||||||
groupBy: groupBy,
|
);
|
||||||
),
|
|
||||||
assetSource: (offset, count) => _getPlaceBucketAssets(
|
|
||||||
place,
|
|
||||||
offset: offset,
|
|
||||||
count: count,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
Stream<List<Bucket>> _watchPlaceBucket(
|
Stream<List<Bucket>> _watchPlaceBucket(String place, {GroupAssetsBy groupBy = GroupAssetsBy.day}) {
|
||||||
String place, {
|
|
||||||
GroupAssetsBy groupBy = GroupAssetsBy.day,
|
|
||||||
}) {
|
|
||||||
if (groupBy == GroupAssetsBy.none) {
|
if (groupBy == GroupAssetsBy.none) {
|
||||||
// TODO: implement GroupAssetBy for place
|
// TODO: implement GroupAssetBy for place
|
||||||
throw UnsupportedError(
|
throw UnsupportedError("GroupAssetsBy.none is not supported for watchPlaceBucket");
|
||||||
"GroupAssetsBy.none is not supported for watchPlaceBucket",
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final assetCountExp = _db.remoteAssetEntity.id.count();
|
final assetCountExp = _db.remoteAssetEntity.id.count();
|
||||||
|
|
@ -388,27 +325,22 @@ class DriftTimelineRepository extends DriftDatabaseRepository {
|
||||||
}).watch();
|
}).watch();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<List<BaseAsset>> _getPlaceBucketAssets(
|
Future<List<BaseAsset>> _getPlaceBucketAssets(String place, {required int offset, required int count}) {
|
||||||
String place, {
|
final query =
|
||||||
required int offset,
|
_db.remoteAssetEntity.select().join([
|
||||||
required int count,
|
innerJoin(
|
||||||
}) {
|
_db.remoteExifEntity,
|
||||||
final query = _db.remoteAssetEntity.select().join(
|
_db.remoteExifEntity.assetId.equalsExp(_db.remoteAssetEntity.id),
|
||||||
[
|
useColumns: false,
|
||||||
innerJoin(
|
),
|
||||||
_db.remoteExifEntity,
|
])
|
||||||
_db.remoteExifEntity.assetId.equalsExp(_db.remoteAssetEntity.id),
|
..where(
|
||||||
useColumns: false,
|
_db.remoteAssetEntity.deletedAt.isNull() &
|
||||||
),
|
_db.remoteAssetEntity.visibility.equalsValue(AssetVisibility.timeline) &
|
||||||
],
|
_db.remoteExifEntity.city.equals(place),
|
||||||
)
|
)
|
||||||
..where(
|
..orderBy([OrderingTerm.desc(_db.remoteAssetEntity.createdAt)])
|
||||||
_db.remoteAssetEntity.deletedAt.isNull() &
|
..limit(count, offset: offset);
|
||||||
_db.remoteAssetEntity.visibility.equalsValue(AssetVisibility.timeline) &
|
|
||||||
_db.remoteExifEntity.city.equals(place),
|
|
||||||
)
|
|
||||||
..orderBy([OrderingTerm.desc(_db.remoteAssetEntity.createdAt)])
|
|
||||||
..limit(count, offset: offset);
|
|
||||||
return query.map((row) => row.readTable(_db.remoteAssetEntity).toDto()).get();
|
return query.map((row) => row.readTable(_db.remoteAssetEntity).toDto()).get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -419,12 +351,8 @@ class DriftTimelineRepository extends DriftDatabaseRepository {
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
bucketSource: () => _watchRemoteBucket(filter: filter, groupBy: groupBy),
|
bucketSource: () => _watchRemoteBucket(filter: filter, groupBy: groupBy),
|
||||||
assetSource: (offset, count) => _getRemoteAssets(
|
assetSource: (offset, count) =>
|
||||||
filter: filter,
|
_getRemoteAssets(filter: filter, offset: offset, count: count, joinLocal: joinLocal),
|
||||||
offset: offset,
|
|
||||||
count: count,
|
|
||||||
joinLocal: joinLocal,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -460,17 +388,18 @@ class DriftTimelineRepository extends DriftDatabaseRepository {
|
||||||
bool joinLocal = false,
|
bool joinLocal = false,
|
||||||
}) {
|
}) {
|
||||||
if (joinLocal) {
|
if (joinLocal) {
|
||||||
final query = _db.remoteAssetEntity.select().join([
|
final query =
|
||||||
leftOuterJoin(
|
_db.remoteAssetEntity.select().join([
|
||||||
_db.localAssetEntity,
|
leftOuterJoin(
|
||||||
_db.remoteAssetEntity.checksum.equalsExp(_db.localAssetEntity.checksum),
|
_db.localAssetEntity,
|
||||||
useColumns: false,
|
_db.remoteAssetEntity.checksum.equalsExp(_db.localAssetEntity.checksum),
|
||||||
),
|
useColumns: false,
|
||||||
])
|
),
|
||||||
..addColumns([_db.localAssetEntity.id])
|
])
|
||||||
..where(filter(_db.remoteAssetEntity))
|
..addColumns([_db.localAssetEntity.id])
|
||||||
..orderBy([OrderingTerm.desc(_db.remoteAssetEntity.createdAt)])
|
..where(filter(_db.remoteAssetEntity))
|
||||||
..limit(count, offset: offset);
|
..orderBy([OrderingTerm.desc(_db.remoteAssetEntity.createdAt)])
|
||||||
|
..limit(count, offset: offset);
|
||||||
|
|
||||||
return query.map((row) {
|
return query.map((row) {
|
||||||
final asset = row.readTable(_db.remoteAssetEntity).toDto();
|
final asset = row.readTable(_db.remoteAssetEntity).toDto();
|
||||||
|
|
@ -507,9 +436,7 @@ extension on Expression<DateTime> {
|
||||||
return switch (groupBy) {
|
return switch (groupBy) {
|
||||||
GroupAssetsBy.day || GroupAssetsBy.auto => localTimeExp.date,
|
GroupAssetsBy.day || GroupAssetsBy.auto => localTimeExp.date,
|
||||||
GroupAssetsBy.month => localTimeExp.strftime("%Y-%m"),
|
GroupAssetsBy.month => localTimeExp.strftime("%Y-%m"),
|
||||||
GroupAssetsBy.none => throw ArgumentError(
|
GroupAssetsBy.none => throw ArgumentError("GroupAssetsBy.none is not supported for date formatting"),
|
||||||
"GroupAssetsBy.none is not supported for date formatting",
|
|
||||||
),
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -519,9 +446,7 @@ extension on String {
|
||||||
final format = switch (groupBy) {
|
final format = switch (groupBy) {
|
||||||
GroupAssetsBy.day || GroupAssetsBy.auto => "y-M-d",
|
GroupAssetsBy.day || GroupAssetsBy.auto => "y-M-d",
|
||||||
GroupAssetsBy.month => "y-M",
|
GroupAssetsBy.month => "y-M",
|
||||||
GroupAssetsBy.none => throw ArgumentError(
|
GroupAssetsBy.none => throw ArgumentError("GroupAssetsBy.none is not supported for date formatting"),
|
||||||
"GroupAssetsBy.none is not supported for date formatting",
|
|
||||||
),
|
|
||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
return DateFormat(format).parse(this);
|
return DateFormat(format).parse(this);
|
||||||
|
|
|
||||||
|
|
@ -17,15 +17,8 @@ class UserApiRepository extends ApiRepository {
|
||||||
return UserConverter.fromAdminDto(adminDto, preferenceDto);
|
return UserConverter.fromAdminDto(adminDto, preferenceDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<String> createProfileImage({
|
Future<String> createProfileImage({required String name, required Uint8List data}) async {
|
||||||
required String name,
|
final res = await checkNull(_api.createProfileImage(MultipartFile.fromBytes('file', data, filename: name)));
|
||||||
required Uint8List data,
|
|
||||||
}) async {
|
|
||||||
final res = await checkNull(
|
|
||||||
_api.createProfileImage(
|
|
||||||
MultipartFile.fromBytes('file', data, filename: name),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
return res.profileImagePath;
|
return res.profileImagePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,20 +18,8 @@ class DriftUserMetadataRepository extends DriftDatabaseRepository {
|
||||||
|
|
||||||
extension on UserMetadataEntityData {
|
extension on UserMetadataEntityData {
|
||||||
UserMetadata toDto() => switch (key) {
|
UserMetadata toDto() => switch (key) {
|
||||||
UserMetadataKey.onboarding => UserMetadata(
|
UserMetadataKey.onboarding => UserMetadata(userId: userId, key: key, onboarding: Onboarding.fromMap(value)),
|
||||||
userId: userId,
|
UserMetadataKey.preferences => UserMetadata(userId: userId, key: key, preferences: Preferences.fromMap(value)),
|
||||||
key: key,
|
UserMetadataKey.license => UserMetadata(userId: userId, key: key, license: License.fromMap(value)),
|
||||||
onboarding: Onboarding.fromMap(value),
|
};
|
||||||
),
|
|
||||||
UserMetadataKey.preferences => UserMetadata(
|
|
||||||
userId: userId,
|
|
||||||
key: key,
|
|
||||||
preferences: Preferences.fromMap(value),
|
|
||||||
),
|
|
||||||
UserMetadataKey.license => UserMetadata(
|
|
||||||
userId: userId,
|
|
||||||
key: key,
|
|
||||||
license: License.fromMap(value),
|
|
||||||
),
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,63 +6,59 @@ import 'package:openapi/api.dart';
|
||||||
abstract final class UserConverter {
|
abstract final class UserConverter {
|
||||||
/// Base user dto used where the complete user object is not required
|
/// Base user dto used where the complete user object is not required
|
||||||
static UserDto fromSimpleUserDto(UserResponseDto dto) => UserDto(
|
static UserDto fromSimpleUserDto(UserResponseDto dto) => UserDto(
|
||||||
id: dto.id,
|
id: dto.id,
|
||||||
email: dto.email,
|
email: dto.email,
|
||||||
name: dto.name,
|
name: dto.name,
|
||||||
isAdmin: false,
|
isAdmin: false,
|
||||||
updatedAt: DateTime.now(),
|
updatedAt: DateTime.now(),
|
||||||
profileImagePath: dto.profileImagePath,
|
profileImagePath: dto.profileImagePath,
|
||||||
avatarColor: dto.avatarColor.toAvatarColor(),
|
avatarColor: dto.avatarColor.toAvatarColor(),
|
||||||
);
|
);
|
||||||
|
|
||||||
static UserDto fromAdminDto(
|
static UserDto fromAdminDto(UserAdminResponseDto adminDto, [UserPreferencesResponseDto? preferenceDto]) => UserDto(
|
||||||
UserAdminResponseDto adminDto, [
|
id: adminDto.id,
|
||||||
UserPreferencesResponseDto? preferenceDto,
|
email: adminDto.email,
|
||||||
]) =>
|
name: adminDto.name,
|
||||||
UserDto(
|
isAdmin: adminDto.isAdmin,
|
||||||
id: adminDto.id,
|
updatedAt: adminDto.updatedAt,
|
||||||
email: adminDto.email,
|
profileImagePath: adminDto.profileImagePath,
|
||||||
name: adminDto.name,
|
avatarColor: adminDto.avatarColor.toAvatarColor(),
|
||||||
isAdmin: adminDto.isAdmin,
|
memoryEnabled: preferenceDto?.memories.enabled ?? true,
|
||||||
updatedAt: adminDto.updatedAt,
|
inTimeline: false,
|
||||||
profileImagePath: adminDto.profileImagePath,
|
isPartnerSharedBy: false,
|
||||||
avatarColor: adminDto.avatarColor.toAvatarColor(),
|
isPartnerSharedWith: false,
|
||||||
memoryEnabled: preferenceDto?.memories.enabled ?? true,
|
quotaUsageInBytes: adminDto.quotaUsageInBytes ?? 0,
|
||||||
inTimeline: false,
|
quotaSizeInBytes: adminDto.quotaSizeInBytes ?? 0,
|
||||||
isPartnerSharedBy: false,
|
);
|
||||||
isPartnerSharedWith: false,
|
|
||||||
quotaUsageInBytes: adminDto.quotaUsageInBytes ?? 0,
|
|
||||||
quotaSizeInBytes: adminDto.quotaSizeInBytes ?? 0,
|
|
||||||
);
|
|
||||||
|
|
||||||
static UserDto fromPartnerDto(PartnerResponseDto dto) => UserDto(
|
static UserDto fromPartnerDto(PartnerResponseDto dto) => UserDto(
|
||||||
id: dto.id,
|
id: dto.id,
|
||||||
email: dto.email,
|
email: dto.email,
|
||||||
name: dto.name,
|
name: dto.name,
|
||||||
isAdmin: false,
|
isAdmin: false,
|
||||||
updatedAt: DateTime.now(),
|
updatedAt: DateTime.now(),
|
||||||
profileImagePath: dto.profileImagePath,
|
profileImagePath: dto.profileImagePath,
|
||||||
avatarColor: dto.avatarColor.toAvatarColor(),
|
avatarColor: dto.avatarColor.toAvatarColor(),
|
||||||
memoryEnabled: false,
|
memoryEnabled: false,
|
||||||
inTimeline: dto.inTimeline ?? false,
|
inTimeline: dto.inTimeline ?? false,
|
||||||
isPartnerSharedBy: false,
|
isPartnerSharedBy: false,
|
||||||
isPartnerSharedWith: false,
|
isPartnerSharedWith: false,
|
||||||
quotaUsageInBytes: 0,
|
quotaUsageInBytes: 0,
|
||||||
quotaSizeInBytes: 0,
|
quotaSizeInBytes: 0,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
extension on UserAvatarColor {
|
extension on UserAvatarColor {
|
||||||
AvatarColor toAvatarColor() => switch (this) {
|
AvatarColor toAvatarColor() => switch (this) {
|
||||||
UserAvatarColor.red => AvatarColor.red,
|
UserAvatarColor.red => AvatarColor.red,
|
||||||
UserAvatarColor.green => AvatarColor.green,
|
UserAvatarColor.green => AvatarColor.green,
|
||||||
UserAvatarColor.blue => AvatarColor.blue,
|
UserAvatarColor.blue => AvatarColor.blue,
|
||||||
UserAvatarColor.purple => AvatarColor.purple,
|
UserAvatarColor.purple => AvatarColor.purple,
|
||||||
UserAvatarColor.orange => AvatarColor.orange,
|
UserAvatarColor.orange => AvatarColor.orange,
|
||||||
UserAvatarColor.pink => AvatarColor.pink,
|
UserAvatarColor.pink => AvatarColor.pink,
|
||||||
UserAvatarColor.amber => AvatarColor.amber,
|
UserAvatarColor.amber => AvatarColor.amber,
|
||||||
UserAvatarColor.yellow => AvatarColor.yellow,
|
UserAvatarColor.yellow => AvatarColor.yellow,
|
||||||
UserAvatarColor.gray => AvatarColor.gray,
|
UserAvatarColor.gray => AvatarColor.gray,
|
||||||
UserAvatarColor.primary || _ => AvatarColor.primary,
|
UserAvatarColor.primary || _ => AvatarColor.primary,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,10 +50,7 @@ void main() async {
|
||||||
|
|
||||||
runApp(
|
runApp(
|
||||||
ProviderScope(
|
ProviderScope(
|
||||||
overrides: [
|
overrides: [dbProvider.overrideWithValue(db), isarProvider.overrideWithValue(db)],
|
||||||
dbProvider.overrideWithValue(db),
|
|
||||||
isarProvider.overrideWithValue(db),
|
|
||||||
],
|
|
||||||
child: const MainWidget(),
|
child: const MainWidget(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
@ -100,23 +97,15 @@ Future<void> initApp() async {
|
||||||
globalConfig: (Config.holdingQueue, (1000, 1000, 1000)),
|
globalConfig: (Config.holdingQueue, (1000, 1000, 1000)),
|
||||||
);
|
);
|
||||||
|
|
||||||
await FileDownloader().trackTasksInGroup(
|
await FileDownloader().trackTasksInGroup(kDownloadGroupLivePhoto, markDownloadedComplete: false);
|
||||||
kDownloadGroupLivePhoto,
|
|
||||||
markDownloadedComplete: false,
|
|
||||||
);
|
|
||||||
|
|
||||||
await FileDownloader().trackTasks();
|
await FileDownloader().trackTasks();
|
||||||
|
|
||||||
LicenseRegistry.addLicense(
|
LicenseRegistry.addLicense(() async* {
|
||||||
() async* {
|
for (final license in nonPubLicenses.entries) {
|
||||||
for (final license in nonPubLicenses.entries) {
|
yield LicenseEntryWithLineBreaks([license.key], license.value);
|
||||||
yield LicenseEntryWithLineBreaks(
|
}
|
||||||
[license.key],
|
});
|
||||||
license.value,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class ImmichApp extends ConsumerStatefulWidget {
|
class ImmichApp extends ConsumerStatefulWidget {
|
||||||
|
|
@ -160,9 +149,7 @@ class ImmichAppState extends ConsumerState<ImmichApp> with WidgetsBindingObserve
|
||||||
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
||||||
|
|
||||||
// Sets the navigation bar color
|
// Sets the navigation bar color
|
||||||
SystemUiOverlayStyle overlayStyle = const SystemUiOverlayStyle(
|
SystemUiOverlayStyle overlayStyle = const SystemUiOverlayStyle(systemNavigationBarColor: Colors.transparent);
|
||||||
systemNavigationBarColor: Colors.transparent,
|
|
||||||
);
|
|
||||||
if (Platform.isAndroid) {
|
if (Platform.isAndroid) {
|
||||||
// Android 8 does not support transparent app bars
|
// Android 8 does not support transparent app bars
|
||||||
final info = await DeviceInfoPlugin().androidInfo;
|
final info = await DeviceInfoPlugin().androidInfo;
|
||||||
|
|
@ -177,40 +164,22 @@ class ImmichAppState extends ConsumerState<ImmichApp> with WidgetsBindingObserve
|
||||||
void _configureFileDownloaderNotifications() {
|
void _configureFileDownloaderNotifications() {
|
||||||
FileDownloader().configureNotificationForGroup(
|
FileDownloader().configureNotificationForGroup(
|
||||||
kDownloadGroupImage,
|
kDownloadGroupImage,
|
||||||
running: TaskNotification(
|
running: TaskNotification('downloading_media'.tr(), '${'file_name'.tr()}: {filename}'),
|
||||||
'downloading_media'.tr(),
|
complete: TaskNotification('download_finished'.tr(), '${'file_name'.tr()}: {filename}'),
|
||||||
'${'file_name'.tr()}: {filename}',
|
|
||||||
),
|
|
||||||
complete: TaskNotification(
|
|
||||||
'download_finished'.tr(),
|
|
||||||
'${'file_name'.tr()}: {filename}',
|
|
||||||
),
|
|
||||||
progressBar: true,
|
progressBar: true,
|
||||||
);
|
);
|
||||||
|
|
||||||
FileDownloader().configureNotificationForGroup(
|
FileDownloader().configureNotificationForGroup(
|
||||||
kDownloadGroupVideo,
|
kDownloadGroupVideo,
|
||||||
running: TaskNotification(
|
running: TaskNotification('downloading_media'.tr(), '${'file_name'.tr()}: {filename}'),
|
||||||
'downloading_media'.tr(),
|
complete: TaskNotification('download_finished'.tr(), '${'file_name'.tr()}: {filename}'),
|
||||||
'${'file_name'.tr()}: {filename}',
|
|
||||||
),
|
|
||||||
complete: TaskNotification(
|
|
||||||
'download_finished'.tr(),
|
|
||||||
'${'file_name'.tr()}: {filename}',
|
|
||||||
),
|
|
||||||
progressBar: true,
|
progressBar: true,
|
||||||
);
|
);
|
||||||
|
|
||||||
FileDownloader().configureNotificationForGroup(
|
FileDownloader().configureNotificationForGroup(
|
||||||
kManualUploadGroup,
|
kManualUploadGroup,
|
||||||
running: TaskNotification(
|
running: TaskNotification('uploading_media'.tr(), '${'file_name'.tr()}: {displayName}'),
|
||||||
'uploading_media'.tr(),
|
complete: TaskNotification('upload_finished'.tr(), '${'file_name'.tr()}: {displayName}'),
|
||||||
'${'file_name'.tr()}: {displayName}',
|
|
||||||
),
|
|
||||||
complete: TaskNotification(
|
|
||||||
'upload_finished'.tr(),
|
|
||||||
'${'file_name'.tr()}: {displayName}',
|
|
||||||
),
|
|
||||||
progressBar: true,
|
progressBar: true,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -222,19 +191,13 @@ class ImmichAppState extends ConsumerState<ImmichApp> with WidgetsBindingObserve
|
||||||
final isColdStart = currentRouteName == null || currentRouteName == SplashScreenRoute.name;
|
final isColdStart = currentRouteName == null || currentRouteName == SplashScreenRoute.name;
|
||||||
|
|
||||||
if (deepLink.uri.scheme == "immich") {
|
if (deepLink.uri.scheme == "immich") {
|
||||||
final proposedRoute = await deepLinkHandler.handleScheme(
|
final proposedRoute = await deepLinkHandler.handleScheme(deepLink, isColdStart);
|
||||||
deepLink,
|
|
||||||
isColdStart,
|
|
||||||
);
|
|
||||||
|
|
||||||
return proposedRoute;
|
return proposedRoute;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (deepLink.uri.host == "my.immich.app") {
|
if (deepLink.uri.host == "my.immich.app") {
|
||||||
final proposedRoute = await deepLinkHandler.handleMyImmichApp(
|
final proposedRoute = await deepLinkHandler.handleMyImmichApp(deepLink, isColdStart);
|
||||||
deepLink,
|
|
||||||
isColdStart,
|
|
||||||
);
|
|
||||||
|
|
||||||
return proposedRoute;
|
return proposedRoute;
|
||||||
}
|
}
|
||||||
|
|
@ -275,9 +238,7 @@ class ImmichAppState extends ConsumerState<ImmichApp> with WidgetsBindingObserve
|
||||||
final immichTheme = ref.watch(immichThemeProvider);
|
final immichTheme = ref.watch(immichThemeProvider);
|
||||||
|
|
||||||
return ProviderScope(
|
return ProviderScope(
|
||||||
overrides: [
|
overrides: [localeProvider.overrideWithValue(context.locale)],
|
||||||
localeProvider.overrideWithValue(context.locale),
|
|
||||||
],
|
|
||||||
child: MaterialApp.router(
|
child: MaterialApp.router(
|
||||||
title: 'Immich',
|
title: 'Immich',
|
||||||
debugShowCheckedModeBanner: true,
|
debugShowCheckedModeBanner: true,
|
||||||
|
|
@ -285,14 +246,8 @@ class ImmichAppState extends ConsumerState<ImmichApp> with WidgetsBindingObserve
|
||||||
supportedLocales: context.supportedLocales,
|
supportedLocales: context.supportedLocales,
|
||||||
locale: context.locale,
|
locale: context.locale,
|
||||||
themeMode: ref.watch(immichThemeModeProvider),
|
themeMode: ref.watch(immichThemeModeProvider),
|
||||||
darkTheme: getThemeData(
|
darkTheme: getThemeData(colorScheme: immichTheme.dark, locale: context.locale),
|
||||||
colorScheme: immichTheme.dark,
|
theme: getThemeData(colorScheme: immichTheme.light, locale: context.locale),
|
||||||
locale: context.locale,
|
|
||||||
),
|
|
||||||
theme: getThemeData(
|
|
||||||
colorScheme: immichTheme.light,
|
|
||||||
locale: context.locale,
|
|
||||||
),
|
|
||||||
routerConfig: router.config(
|
routerConfig: router.config(
|
||||||
deepLinkBuilder: _deepLinkBuilder,
|
deepLinkBuilder: _deepLinkBuilder,
|
||||||
navigatorObservers: () => [AppNavigationObserver(ref: ref), HeroController()],
|
navigatorObservers: () => [AppNavigationObserver(ref: ref), HeroController()],
|
||||||
|
|
|
||||||
|
|
@ -7,15 +7,9 @@ class AlbumAddAssetsResponse {
|
||||||
List<String> alreadyInAlbum;
|
List<String> alreadyInAlbum;
|
||||||
int successfullyAdded;
|
int successfullyAdded;
|
||||||
|
|
||||||
AlbumAddAssetsResponse({
|
AlbumAddAssetsResponse({required this.alreadyInAlbum, required this.successfullyAdded});
|
||||||
required this.alreadyInAlbum,
|
|
||||||
required this.successfullyAdded,
|
|
||||||
});
|
|
||||||
|
|
||||||
AlbumAddAssetsResponse copyWith({
|
AlbumAddAssetsResponse copyWith({List<String>? alreadyInAlbum, int? successfullyAdded}) {
|
||||||
List<String>? alreadyInAlbum,
|
|
||||||
int? successfullyAdded,
|
|
||||||
}) {
|
|
||||||
return AlbumAddAssetsResponse(
|
return AlbumAddAssetsResponse(
|
||||||
alreadyInAlbum: alreadyInAlbum ?? this.alreadyInAlbum,
|
alreadyInAlbum: alreadyInAlbum ?? this.alreadyInAlbum,
|
||||||
successfullyAdded: successfullyAdded ?? this.successfullyAdded,
|
successfullyAdded: successfullyAdded ?? this.successfullyAdded,
|
||||||
|
|
@ -23,10 +17,7 @@ class AlbumAddAssetsResponse {
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return <String, dynamic>{
|
return <String, dynamic>{'alreadyInAlbum': alreadyInAlbum, 'successfullyAdded': successfullyAdded};
|
||||||
'alreadyInAlbum': alreadyInAlbum,
|
|
||||||
'successfullyAdded': successfullyAdded,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String toJson() => json.encode(toMap());
|
String toJson() => json.encode(toMap());
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1 @@
|
||||||
enum QuickFilterMode {
|
enum QuickFilterMode { all, sharedWithMe, myAlbums }
|
||||||
all,
|
|
||||||
sharedWithMe,
|
|
||||||
myAlbums,
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -11,11 +11,7 @@ class AlbumViewerPageState {
|
||||||
required this.editDescriptionText,
|
required this.editDescriptionText,
|
||||||
});
|
});
|
||||||
|
|
||||||
AlbumViewerPageState copyWith({
|
AlbumViewerPageState copyWith({bool? isEditAlbum, String? editTitleText, String? editDescriptionText}) {
|
||||||
bool? isEditAlbum,
|
|
||||||
String? editTitleText,
|
|
||||||
String? editDescriptionText,
|
|
||||||
}) {
|
|
||||||
return AlbumViewerPageState(
|
return AlbumViewerPageState(
|
||||||
isEditAlbum: isEditAlbum ?? this.isEditAlbum,
|
isEditAlbum: isEditAlbum ?? this.isEditAlbum,
|
||||||
editTitleText: editTitleText ?? this.editTitleText,
|
editTitleText: editTitleText ?? this.editTitleText,
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,7 @@ import 'package:immich_mobile/entities/asset.entity.dart';
|
||||||
class AssetSelectionPageResult {
|
class AssetSelectionPageResult {
|
||||||
final Set<Asset> selectedAssets;
|
final Set<Asset> selectedAssets;
|
||||||
|
|
||||||
const AssetSelectionPageResult({
|
const AssetSelectionPageResult({required this.selectedAssets});
|
||||||
required this.selectedAssets,
|
|
||||||
});
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
if (identical(this, other)) return true;
|
if (identical(this, other)) return true;
|
||||||
|
|
|
||||||
|
|
@ -13,12 +13,7 @@ class AssetSelectionState {
|
||||||
this.selectedCount = 0,
|
this.selectedCount = 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
AssetSelectionState copyWith({
|
AssetSelectionState copyWith({bool? hasRemote, bool? hasLocal, bool? hasMerged, int? selectedCount}) {
|
||||||
bool? hasRemote,
|
|
||||||
bool? hasLocal,
|
|
||||||
bool? hasMerged,
|
|
||||||
int? selectedCount,
|
|
||||||
}) {
|
|
||||||
return AssetSelectionState(
|
return AssetSelectionState(
|
||||||
hasRemote: hasRemote ?? this.hasRemote,
|
hasRemote: hasRemote ?? this.hasRemote,
|
||||||
hasLocal: hasLocal ?? this.hasLocal,
|
hasLocal: hasLocal ?? this.hasLocal,
|
||||||
|
|
@ -28,10 +23,10 @@ class AssetSelectionState {
|
||||||
}
|
}
|
||||||
|
|
||||||
AssetSelectionState.fromSelection(Set<Asset> selection)
|
AssetSelectionState.fromSelection(Set<Asset> selection)
|
||||||
: hasLocal = selection.any((e) => e.storage == AssetState.local),
|
: hasLocal = selection.any((e) => e.storage == AssetState.local),
|
||||||
hasMerged = selection.any((e) => e.storage == AssetState.merged),
|
hasMerged = selection.any((e) => e.storage == AssetState.merged),
|
||||||
hasRemote = selection.any((e) => e.storage == AssetState.remote),
|
hasRemote = selection.any((e) => e.storage == AssetState.remote),
|
||||||
selectedCount = selection.length;
|
selectedCount = selection.length;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() =>
|
String toString() =>
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue