Added Artist attr in model
This commit is contained in:
parent
b0741dac5b
commit
9ee32a2380
10 changed files with 297 additions and 70 deletions
|
|
@ -22,6 +22,8 @@ class $MManga implements MManga, $Instance {
|
||||||
fields: {
|
fields: {
|
||||||
'author': BridgeFieldDef(
|
'author': BridgeFieldDef(
|
||||||
BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.string))),
|
BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.string))),
|
||||||
|
'artist': BridgeFieldDef(
|
||||||
|
BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.string))),
|
||||||
'status': BridgeFieldDef(BridgeTypeAnnotation($MStatus.$type)),
|
'status': BridgeFieldDef(BridgeTypeAnnotation($MStatus.$type)),
|
||||||
'genre': BridgeFieldDef(
|
'genre': BridgeFieldDef(
|
||||||
BridgeTypeAnnotation(
|
BridgeTypeAnnotation(
|
||||||
|
|
@ -58,6 +60,8 @@ class $MManga implements MManga, $Instance {
|
||||||
switch (identifier) {
|
switch (identifier) {
|
||||||
case 'author':
|
case 'author':
|
||||||
return $String($value.author!);
|
return $String($value.author!);
|
||||||
|
case 'artist':
|
||||||
|
return $String($value.artist!);
|
||||||
case 'status':
|
case 'status':
|
||||||
return $MStatus.wrap($value.status!);
|
return $MStatus.wrap($value.status!);
|
||||||
case 'genre':
|
case 'genre':
|
||||||
|
|
@ -88,6 +92,8 @@ class $MManga implements MManga, $Instance {
|
||||||
switch (identifier) {
|
switch (identifier) {
|
||||||
case 'author':
|
case 'author':
|
||||||
$value.author = value.$reified;
|
$value.author = value.$reified;
|
||||||
|
case 'artist':
|
||||||
|
$value.artist = value.$reified;
|
||||||
case 'status':
|
case 'status':
|
||||||
$value.status = value.$reified;
|
$value.status = value.$reified;
|
||||||
case 'genre':
|
case 'genre':
|
||||||
|
|
@ -118,6 +124,9 @@ class $MManga implements MManga, $Instance {
|
||||||
@override
|
@override
|
||||||
String? get author => $value.author;
|
String? get author => $value.author;
|
||||||
|
|
||||||
|
@override
|
||||||
|
String? get artist => $value.artist;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String? get description => $value.description;
|
String? get description => $value.description;
|
||||||
|
|
||||||
|
|
@ -144,6 +153,11 @@ class $MManga implements MManga, $Instance {
|
||||||
// implement author
|
// implement author
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
set artist(String? artist) {
|
||||||
|
// implement artist
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
set description(String? description) {
|
set description(String? description) {
|
||||||
// implement description
|
// implement description
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,8 @@ class MManga {
|
||||||
|
|
||||||
String? author;
|
String? author;
|
||||||
|
|
||||||
|
String? artist;
|
||||||
|
|
||||||
Status? status;
|
Status? status;
|
||||||
|
|
||||||
List<String>? genre;
|
List<String>? genre;
|
||||||
|
|
@ -20,6 +22,7 @@ class MManga {
|
||||||
|
|
||||||
MManga(
|
MManga(
|
||||||
{this.author,
|
{this.author,
|
||||||
|
this.artist,
|
||||||
this.genre,
|
this.genre,
|
||||||
this.imageUrl,
|
this.imageUrl,
|
||||||
this.link,
|
this.link,
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@ class Manga {
|
||||||
|
|
||||||
String? author;
|
String? author;
|
||||||
|
|
||||||
|
String? artist;
|
||||||
|
|
||||||
@enumerated
|
@enumerated
|
||||||
late Status status;
|
late Status status;
|
||||||
|
|
||||||
|
|
@ -51,6 +53,7 @@ class Manga {
|
||||||
{this.id = Isar.autoIncrement,
|
{this.id = Isar.autoIncrement,
|
||||||
required this.source,
|
required this.source,
|
||||||
required this.author,
|
required this.author,
|
||||||
|
required this.artist,
|
||||||
this.favorite = false,
|
this.favorite = false,
|
||||||
required this.genre,
|
required this.genre,
|
||||||
required this.imageUrl,
|
required this.imageUrl,
|
||||||
|
|
@ -70,6 +73,7 @@ class Manga {
|
||||||
|
|
||||||
Manga.fromJson(Map<String, dynamic> json) {
|
Manga.fromJson(Map<String, dynamic> json) {
|
||||||
author = json['author'];
|
author = json['author'];
|
||||||
|
artist = json['artist'];
|
||||||
categories = json['categories']?.cast<int>();
|
categories = json['categories']?.cast<int>();
|
||||||
customCoverImage = json['customCoverImage']?.cast<int>();
|
customCoverImage = json['customCoverImage']?.cast<int>();
|
||||||
dateAdded = json['dateAdded'];
|
dateAdded = json['dateAdded'];
|
||||||
|
|
@ -92,6 +96,7 @@ class Manga {
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
Map<String, dynamic> toJson() => {
|
||||||
'author': author,
|
'author': author,
|
||||||
|
'artist': artist,
|
||||||
'categories': categories,
|
'categories': categories,
|
||||||
'customCoverImage': customCoverImage,
|
'customCoverImage': customCoverImage,
|
||||||
'dateAdded': dateAdded,
|
'dateAdded': dateAdded,
|
||||||
|
|
|
||||||
|
|
@ -17,93 +17,98 @@ const MangaSchema = CollectionSchema(
|
||||||
name: r'Manga',
|
name: r'Manga',
|
||||||
id: -5643034226035087553,
|
id: -5643034226035087553,
|
||||||
properties: {
|
properties: {
|
||||||
r'author': PropertySchema(
|
r'artist': PropertySchema(
|
||||||
id: 0,
|
id: 0,
|
||||||
|
name: r'artist',
|
||||||
|
type: IsarType.string,
|
||||||
|
),
|
||||||
|
r'author': PropertySchema(
|
||||||
|
id: 1,
|
||||||
name: r'author',
|
name: r'author',
|
||||||
type: IsarType.string,
|
type: IsarType.string,
|
||||||
),
|
),
|
||||||
r'categories': PropertySchema(
|
r'categories': PropertySchema(
|
||||||
id: 1,
|
id: 2,
|
||||||
name: r'categories',
|
name: r'categories',
|
||||||
type: IsarType.longList,
|
type: IsarType.longList,
|
||||||
),
|
),
|
||||||
r'customCoverFromTracker': PropertySchema(
|
r'customCoverFromTracker': PropertySchema(
|
||||||
id: 2,
|
id: 3,
|
||||||
name: r'customCoverFromTracker',
|
name: r'customCoverFromTracker',
|
||||||
type: IsarType.string,
|
type: IsarType.string,
|
||||||
),
|
),
|
||||||
r'customCoverImage': PropertySchema(
|
r'customCoverImage': PropertySchema(
|
||||||
id: 3,
|
id: 4,
|
||||||
name: r'customCoverImage',
|
name: r'customCoverImage',
|
||||||
type: IsarType.byteList,
|
type: IsarType.byteList,
|
||||||
),
|
),
|
||||||
r'dateAdded': PropertySchema(
|
r'dateAdded': PropertySchema(
|
||||||
id: 4,
|
id: 5,
|
||||||
name: r'dateAdded',
|
name: r'dateAdded',
|
||||||
type: IsarType.long,
|
type: IsarType.long,
|
||||||
),
|
),
|
||||||
r'description': PropertySchema(
|
r'description': PropertySchema(
|
||||||
id: 5,
|
id: 6,
|
||||||
name: r'description',
|
name: r'description',
|
||||||
type: IsarType.string,
|
type: IsarType.string,
|
||||||
),
|
),
|
||||||
r'favorite': PropertySchema(
|
r'favorite': PropertySchema(
|
||||||
id: 6,
|
id: 7,
|
||||||
name: r'favorite',
|
name: r'favorite',
|
||||||
type: IsarType.bool,
|
type: IsarType.bool,
|
||||||
),
|
),
|
||||||
r'genre': PropertySchema(
|
r'genre': PropertySchema(
|
||||||
id: 7,
|
id: 8,
|
||||||
name: r'genre',
|
name: r'genre',
|
||||||
type: IsarType.stringList,
|
type: IsarType.stringList,
|
||||||
),
|
),
|
||||||
r'imageUrl': PropertySchema(
|
r'imageUrl': PropertySchema(
|
||||||
id: 8,
|
id: 9,
|
||||||
name: r'imageUrl',
|
name: r'imageUrl',
|
||||||
type: IsarType.string,
|
type: IsarType.string,
|
||||||
),
|
),
|
||||||
r'isLocalArchive': PropertySchema(
|
r'isLocalArchive': PropertySchema(
|
||||||
id: 9,
|
id: 10,
|
||||||
name: r'isLocalArchive',
|
name: r'isLocalArchive',
|
||||||
type: IsarType.bool,
|
type: IsarType.bool,
|
||||||
),
|
),
|
||||||
r'isManga': PropertySchema(
|
r'isManga': PropertySchema(
|
||||||
id: 10,
|
id: 11,
|
||||||
name: r'isManga',
|
name: r'isManga',
|
||||||
type: IsarType.bool,
|
type: IsarType.bool,
|
||||||
),
|
),
|
||||||
r'lang': PropertySchema(
|
r'lang': PropertySchema(
|
||||||
id: 11,
|
id: 12,
|
||||||
name: r'lang',
|
name: r'lang',
|
||||||
type: IsarType.string,
|
type: IsarType.string,
|
||||||
),
|
),
|
||||||
r'lastRead': PropertySchema(
|
r'lastRead': PropertySchema(
|
||||||
id: 12,
|
id: 13,
|
||||||
name: r'lastRead',
|
name: r'lastRead',
|
||||||
type: IsarType.long,
|
type: IsarType.long,
|
||||||
),
|
),
|
||||||
r'lastUpdate': PropertySchema(
|
r'lastUpdate': PropertySchema(
|
||||||
id: 13,
|
id: 14,
|
||||||
name: r'lastUpdate',
|
name: r'lastUpdate',
|
||||||
type: IsarType.long,
|
type: IsarType.long,
|
||||||
),
|
),
|
||||||
r'link': PropertySchema(
|
r'link': PropertySchema(
|
||||||
id: 14,
|
id: 15,
|
||||||
name: r'link',
|
name: r'link',
|
||||||
type: IsarType.string,
|
type: IsarType.string,
|
||||||
),
|
),
|
||||||
r'name': PropertySchema(
|
r'name': PropertySchema(
|
||||||
id: 15,
|
id: 16,
|
||||||
name: r'name',
|
name: r'name',
|
||||||
type: IsarType.string,
|
type: IsarType.string,
|
||||||
),
|
),
|
||||||
r'source': PropertySchema(
|
r'source': PropertySchema(
|
||||||
id: 16,
|
id: 17,
|
||||||
name: r'source',
|
name: r'source',
|
||||||
type: IsarType.string,
|
type: IsarType.string,
|
||||||
),
|
),
|
||||||
r'status': PropertySchema(
|
r'status': PropertySchema(
|
||||||
id: 17,
|
id: 18,
|
||||||
name: r'status',
|
name: r'status',
|
||||||
type: IsarType.byte,
|
type: IsarType.byte,
|
||||||
enumMap: _MangastatusEnumValueMap,
|
enumMap: _MangastatusEnumValueMap,
|
||||||
|
|
@ -137,6 +142,12 @@ int _mangaEstimateSize(
|
||||||
Map<Type, List<int>> allOffsets,
|
Map<Type, List<int>> allOffsets,
|
||||||
) {
|
) {
|
||||||
var bytesCount = offsets.last;
|
var bytesCount = offsets.last;
|
||||||
|
{
|
||||||
|
final value = object.artist;
|
||||||
|
if (value != null) {
|
||||||
|
bytesCount += 3 + value.length * 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
final value = object.author;
|
final value = object.author;
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
|
|
@ -218,24 +229,25 @@ void _mangaSerialize(
|
||||||
List<int> offsets,
|
List<int> offsets,
|
||||||
Map<Type, List<int>> allOffsets,
|
Map<Type, List<int>> allOffsets,
|
||||||
) {
|
) {
|
||||||
writer.writeString(offsets[0], object.author);
|
writer.writeString(offsets[0], object.artist);
|
||||||
writer.writeLongList(offsets[1], object.categories);
|
writer.writeString(offsets[1], object.author);
|
||||||
writer.writeString(offsets[2], object.customCoverFromTracker);
|
writer.writeLongList(offsets[2], object.categories);
|
||||||
writer.writeByteList(offsets[3], object.customCoverImage);
|
writer.writeString(offsets[3], object.customCoverFromTracker);
|
||||||
writer.writeLong(offsets[4], object.dateAdded);
|
writer.writeByteList(offsets[4], object.customCoverImage);
|
||||||
writer.writeString(offsets[5], object.description);
|
writer.writeLong(offsets[5], object.dateAdded);
|
||||||
writer.writeBool(offsets[6], object.favorite);
|
writer.writeString(offsets[6], object.description);
|
||||||
writer.writeStringList(offsets[7], object.genre);
|
writer.writeBool(offsets[7], object.favorite);
|
||||||
writer.writeString(offsets[8], object.imageUrl);
|
writer.writeStringList(offsets[8], object.genre);
|
||||||
writer.writeBool(offsets[9], object.isLocalArchive);
|
writer.writeString(offsets[9], object.imageUrl);
|
||||||
writer.writeBool(offsets[10], object.isManga);
|
writer.writeBool(offsets[10], object.isLocalArchive);
|
||||||
writer.writeString(offsets[11], object.lang);
|
writer.writeBool(offsets[11], object.isManga);
|
||||||
writer.writeLong(offsets[12], object.lastRead);
|
writer.writeString(offsets[12], object.lang);
|
||||||
writer.writeLong(offsets[13], object.lastUpdate);
|
writer.writeLong(offsets[13], object.lastRead);
|
||||||
writer.writeString(offsets[14], object.link);
|
writer.writeLong(offsets[14], object.lastUpdate);
|
||||||
writer.writeString(offsets[15], object.name);
|
writer.writeString(offsets[15], object.link);
|
||||||
writer.writeString(offsets[16], object.source);
|
writer.writeString(offsets[16], object.name);
|
||||||
writer.writeByte(offsets[17], object.status.index);
|
writer.writeString(offsets[17], object.source);
|
||||||
|
writer.writeByte(offsets[18], object.status.index);
|
||||||
}
|
}
|
||||||
|
|
||||||
Manga _mangaDeserialize(
|
Manga _mangaDeserialize(
|
||||||
|
|
@ -245,25 +257,26 @@ Manga _mangaDeserialize(
|
||||||
Map<Type, List<int>> allOffsets,
|
Map<Type, List<int>> allOffsets,
|
||||||
) {
|
) {
|
||||||
final object = Manga(
|
final object = Manga(
|
||||||
author: reader.readStringOrNull(offsets[0]),
|
artist: reader.readStringOrNull(offsets[0]),
|
||||||
categories: reader.readLongList(offsets[1]),
|
author: reader.readStringOrNull(offsets[1]),
|
||||||
customCoverFromTracker: reader.readStringOrNull(offsets[2]),
|
categories: reader.readLongList(offsets[2]),
|
||||||
customCoverImage: reader.readByteList(offsets[3]),
|
customCoverFromTracker: reader.readStringOrNull(offsets[3]),
|
||||||
dateAdded: reader.readLongOrNull(offsets[4]),
|
customCoverImage: reader.readByteList(offsets[4]),
|
||||||
description: reader.readStringOrNull(offsets[5]),
|
dateAdded: reader.readLongOrNull(offsets[5]),
|
||||||
favorite: reader.readBoolOrNull(offsets[6]),
|
description: reader.readStringOrNull(offsets[6]),
|
||||||
genre: reader.readStringList(offsets[7]),
|
favorite: reader.readBoolOrNull(offsets[7]),
|
||||||
|
genre: reader.readStringList(offsets[8]),
|
||||||
id: id,
|
id: id,
|
||||||
imageUrl: reader.readStringOrNull(offsets[8]),
|
imageUrl: reader.readStringOrNull(offsets[9]),
|
||||||
isLocalArchive: reader.readBoolOrNull(offsets[9]),
|
isLocalArchive: reader.readBoolOrNull(offsets[10]),
|
||||||
isManga: reader.readBoolOrNull(offsets[10]),
|
isManga: reader.readBoolOrNull(offsets[11]),
|
||||||
lang: reader.readStringOrNull(offsets[11]),
|
lang: reader.readStringOrNull(offsets[12]),
|
||||||
lastRead: reader.readLongOrNull(offsets[12]),
|
lastRead: reader.readLongOrNull(offsets[13]),
|
||||||
lastUpdate: reader.readLongOrNull(offsets[13]),
|
lastUpdate: reader.readLongOrNull(offsets[14]),
|
||||||
link: reader.readStringOrNull(offsets[14]),
|
link: reader.readStringOrNull(offsets[15]),
|
||||||
name: reader.readStringOrNull(offsets[15]),
|
name: reader.readStringOrNull(offsets[16]),
|
||||||
source: reader.readStringOrNull(offsets[16]),
|
source: reader.readStringOrNull(offsets[17]),
|
||||||
status: _MangastatusValueEnumMap[reader.readByteOrNull(offsets[17])] ??
|
status: _MangastatusValueEnumMap[reader.readByteOrNull(offsets[18])] ??
|
||||||
Status.ongoing,
|
Status.ongoing,
|
||||||
);
|
);
|
||||||
return object;
|
return object;
|
||||||
|
|
@ -279,38 +292,40 @@ P _mangaDeserializeProp<P>(
|
||||||
case 0:
|
case 0:
|
||||||
return (reader.readStringOrNull(offset)) as P;
|
return (reader.readStringOrNull(offset)) as P;
|
||||||
case 1:
|
case 1:
|
||||||
return (reader.readLongList(offset)) as P;
|
return (reader.readStringOrNull(offset)) as P;
|
||||||
case 2:
|
case 2:
|
||||||
return (reader.readStringOrNull(offset)) as P;
|
return (reader.readLongList(offset)) as P;
|
||||||
case 3:
|
case 3:
|
||||||
return (reader.readByteList(offset)) as P;
|
return (reader.readStringOrNull(offset)) as P;
|
||||||
case 4:
|
case 4:
|
||||||
return (reader.readLongOrNull(offset)) as P;
|
return (reader.readByteList(offset)) as P;
|
||||||
case 5:
|
case 5:
|
||||||
return (reader.readStringOrNull(offset)) as P;
|
return (reader.readLongOrNull(offset)) as P;
|
||||||
case 6:
|
case 6:
|
||||||
return (reader.readBoolOrNull(offset)) as P;
|
|
||||||
case 7:
|
|
||||||
return (reader.readStringList(offset)) as P;
|
|
||||||
case 8:
|
|
||||||
return (reader.readStringOrNull(offset)) as P;
|
return (reader.readStringOrNull(offset)) as P;
|
||||||
case 9:
|
case 7:
|
||||||
return (reader.readBoolOrNull(offset)) as P;
|
return (reader.readBoolOrNull(offset)) as P;
|
||||||
|
case 8:
|
||||||
|
return (reader.readStringList(offset)) as P;
|
||||||
|
case 9:
|
||||||
|
return (reader.readStringOrNull(offset)) as P;
|
||||||
case 10:
|
case 10:
|
||||||
return (reader.readBoolOrNull(offset)) as P;
|
return (reader.readBoolOrNull(offset)) as P;
|
||||||
case 11:
|
case 11:
|
||||||
return (reader.readStringOrNull(offset)) as P;
|
return (reader.readBoolOrNull(offset)) as P;
|
||||||
case 12:
|
case 12:
|
||||||
return (reader.readLongOrNull(offset)) as P;
|
return (reader.readStringOrNull(offset)) as P;
|
||||||
case 13:
|
case 13:
|
||||||
return (reader.readLongOrNull(offset)) as P;
|
return (reader.readLongOrNull(offset)) as P;
|
||||||
case 14:
|
case 14:
|
||||||
return (reader.readStringOrNull(offset)) as P;
|
return (reader.readLongOrNull(offset)) as P;
|
||||||
case 15:
|
case 15:
|
||||||
return (reader.readStringOrNull(offset)) as P;
|
return (reader.readStringOrNull(offset)) as P;
|
||||||
case 16:
|
case 16:
|
||||||
return (reader.readStringOrNull(offset)) as P;
|
return (reader.readStringOrNull(offset)) as P;
|
||||||
case 17:
|
case 17:
|
||||||
|
return (reader.readStringOrNull(offset)) as P;
|
||||||
|
case 18:
|
||||||
return (_MangastatusValueEnumMap[reader.readByteOrNull(offset)] ??
|
return (_MangastatusValueEnumMap[reader.readByteOrNull(offset)] ??
|
||||||
Status.ongoing) as P;
|
Status.ongoing) as P;
|
||||||
default:
|
default:
|
||||||
|
|
@ -424,6 +439,151 @@ extension MangaQueryWhere on QueryBuilder<Manga, Manga, QWhereClause> {
|
||||||
}
|
}
|
||||||
|
|
||||||
extension MangaQueryFilter on QueryBuilder<Manga, Manga, QFilterCondition> {
|
extension MangaQueryFilter on QueryBuilder<Manga, Manga, QFilterCondition> {
|
||||||
|
QueryBuilder<Manga, Manga, QAfterFilterCondition> artistIsNull() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addFilterCondition(const FilterCondition.isNull(
|
||||||
|
property: r'artist',
|
||||||
|
));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<Manga, Manga, QAfterFilterCondition> artistIsNotNull() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addFilterCondition(const FilterCondition.isNotNull(
|
||||||
|
property: r'artist',
|
||||||
|
));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<Manga, Manga, QAfterFilterCondition> artistEqualTo(
|
||||||
|
String? value, {
|
||||||
|
bool caseSensitive = true,
|
||||||
|
}) {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addFilterCondition(FilterCondition.equalTo(
|
||||||
|
property: r'artist',
|
||||||
|
value: value,
|
||||||
|
caseSensitive: caseSensitive,
|
||||||
|
));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<Manga, Manga, QAfterFilterCondition> artistGreaterThan(
|
||||||
|
String? value, {
|
||||||
|
bool include = false,
|
||||||
|
bool caseSensitive = true,
|
||||||
|
}) {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addFilterCondition(FilterCondition.greaterThan(
|
||||||
|
include: include,
|
||||||
|
property: r'artist',
|
||||||
|
value: value,
|
||||||
|
caseSensitive: caseSensitive,
|
||||||
|
));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<Manga, Manga, QAfterFilterCondition> artistLessThan(
|
||||||
|
String? value, {
|
||||||
|
bool include = false,
|
||||||
|
bool caseSensitive = true,
|
||||||
|
}) {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addFilterCondition(FilterCondition.lessThan(
|
||||||
|
include: include,
|
||||||
|
property: r'artist',
|
||||||
|
value: value,
|
||||||
|
caseSensitive: caseSensitive,
|
||||||
|
));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<Manga, Manga, QAfterFilterCondition> artistBetween(
|
||||||
|
String? lower,
|
||||||
|
String? upper, {
|
||||||
|
bool includeLower = true,
|
||||||
|
bool includeUpper = true,
|
||||||
|
bool caseSensitive = true,
|
||||||
|
}) {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addFilterCondition(FilterCondition.between(
|
||||||
|
property: r'artist',
|
||||||
|
lower: lower,
|
||||||
|
includeLower: includeLower,
|
||||||
|
upper: upper,
|
||||||
|
includeUpper: includeUpper,
|
||||||
|
caseSensitive: caseSensitive,
|
||||||
|
));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<Manga, Manga, QAfterFilterCondition> artistStartsWith(
|
||||||
|
String value, {
|
||||||
|
bool caseSensitive = true,
|
||||||
|
}) {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addFilterCondition(FilterCondition.startsWith(
|
||||||
|
property: r'artist',
|
||||||
|
value: value,
|
||||||
|
caseSensitive: caseSensitive,
|
||||||
|
));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<Manga, Manga, QAfterFilterCondition> artistEndsWith(
|
||||||
|
String value, {
|
||||||
|
bool caseSensitive = true,
|
||||||
|
}) {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addFilterCondition(FilterCondition.endsWith(
|
||||||
|
property: r'artist',
|
||||||
|
value: value,
|
||||||
|
caseSensitive: caseSensitive,
|
||||||
|
));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<Manga, Manga, QAfterFilterCondition> artistContains(String value,
|
||||||
|
{bool caseSensitive = true}) {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addFilterCondition(FilterCondition.contains(
|
||||||
|
property: r'artist',
|
||||||
|
value: value,
|
||||||
|
caseSensitive: caseSensitive,
|
||||||
|
));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<Manga, Manga, QAfterFilterCondition> artistMatches(
|
||||||
|
String pattern,
|
||||||
|
{bool caseSensitive = true}) {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addFilterCondition(FilterCondition.matches(
|
||||||
|
property: r'artist',
|
||||||
|
wildcard: pattern,
|
||||||
|
caseSensitive: caseSensitive,
|
||||||
|
));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<Manga, Manga, QAfterFilterCondition> artistIsEmpty() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addFilterCondition(FilterCondition.equalTo(
|
||||||
|
property: r'artist',
|
||||||
|
value: '',
|
||||||
|
));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<Manga, Manga, QAfterFilterCondition> artistIsNotEmpty() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addFilterCondition(FilterCondition.greaterThan(
|
||||||
|
property: r'artist',
|
||||||
|
value: '',
|
||||||
|
));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
QueryBuilder<Manga, Manga, QAfterFilterCondition> authorIsNull() {
|
QueryBuilder<Manga, Manga, QAfterFilterCondition> authorIsNull() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addFilterCondition(const FilterCondition.isNull(
|
return query.addFilterCondition(const FilterCondition.isNull(
|
||||||
|
|
@ -2607,6 +2767,18 @@ extension MangaQueryLinks on QueryBuilder<Manga, Manga, QFilterCondition> {
|
||||||
}
|
}
|
||||||
|
|
||||||
extension MangaQuerySortBy on QueryBuilder<Manga, Manga, QSortBy> {
|
extension MangaQuerySortBy on QueryBuilder<Manga, Manga, QSortBy> {
|
||||||
|
QueryBuilder<Manga, Manga, QAfterSortBy> sortByArtist() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addSortBy(r'artist', Sort.asc);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<Manga, Manga, QAfterSortBy> sortByArtistDesc() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addSortBy(r'artist', Sort.desc);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
QueryBuilder<Manga, Manga, QAfterSortBy> sortByAuthor() {
|
QueryBuilder<Manga, Manga, QAfterSortBy> sortByAuthor() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addSortBy(r'author', Sort.asc);
|
return query.addSortBy(r'author', Sort.asc);
|
||||||
|
|
@ -2789,6 +2961,18 @@ extension MangaQuerySortBy on QueryBuilder<Manga, Manga, QSortBy> {
|
||||||
}
|
}
|
||||||
|
|
||||||
extension MangaQuerySortThenBy on QueryBuilder<Manga, Manga, QSortThenBy> {
|
extension MangaQuerySortThenBy on QueryBuilder<Manga, Manga, QSortThenBy> {
|
||||||
|
QueryBuilder<Manga, Manga, QAfterSortBy> thenByArtist() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addSortBy(r'artist', Sort.asc);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<Manga, Manga, QAfterSortBy> thenByArtistDesc() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addSortBy(r'artist', Sort.desc);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
QueryBuilder<Manga, Manga, QAfterSortBy> thenByAuthor() {
|
QueryBuilder<Manga, Manga, QAfterSortBy> thenByAuthor() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addSortBy(r'author', Sort.asc);
|
return query.addSortBy(r'author', Sort.asc);
|
||||||
|
|
@ -2983,6 +3167,13 @@ extension MangaQuerySortThenBy on QueryBuilder<Manga, Manga, QSortThenBy> {
|
||||||
}
|
}
|
||||||
|
|
||||||
extension MangaQueryWhereDistinct on QueryBuilder<Manga, Manga, QDistinct> {
|
extension MangaQueryWhereDistinct on QueryBuilder<Manga, Manga, QDistinct> {
|
||||||
|
QueryBuilder<Manga, Manga, QDistinct> distinctByArtist(
|
||||||
|
{bool caseSensitive = true}) {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addDistinctBy(r'artist', caseSensitive: caseSensitive);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
QueryBuilder<Manga, Manga, QDistinct> distinctByAuthor(
|
QueryBuilder<Manga, Manga, QDistinct> distinctByAuthor(
|
||||||
{bool caseSensitive = true}) {
|
{bool caseSensitive = true}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
|
@ -3108,6 +3299,12 @@ extension MangaQueryProperty on QueryBuilder<Manga, Manga, QQueryProperty> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QueryBuilder<Manga, String?, QQueryOperations> artistProperty() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addPropertyName(r'artist');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
QueryBuilder<Manga, String?, QQueryOperations> authorProperty() {
|
QueryBuilder<Manga, String?, QQueryOperations> authorProperty() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addPropertyName(r'author');
|
return query.addPropertyName(r'author');
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ Future importArchivesFromFile(ImportArchivesFromFileRef ref, Manga? mManga,
|
||||||
status: Status.unknown,
|
status: Status.unknown,
|
||||||
description: '',
|
description: '',
|
||||||
isLocalArchive: true,
|
isLocalArchive: true,
|
||||||
|
artist: '',
|
||||||
);
|
);
|
||||||
for (var file in result.files.reversed.toList()) {
|
for (var file in result.files.reversed.toList()) {
|
||||||
(String, LocalExtensionType, Uint8List, String)? data = isManga
|
(String, LocalExtensionType, Uint8List, String)? data = isManga
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ part of 'local_archive.dart';
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$importArchivesFromFileHash() =>
|
String _$importArchivesFromFileHash() =>
|
||||||
r'cbc93a01e89564117369b764d226f4943bf7ee49';
|
r'4ac9e6c438919a1ea8cebd28cb554b13b5e53cc2';
|
||||||
|
|
||||||
/// Copied from Dart SDK
|
/// Copied from Dart SDK
|
||||||
class _SystemHash {
|
class _SystemHash {
|
||||||
|
|
|
||||||
|
|
@ -194,7 +194,7 @@ class LibraryGridViewWidget extends StatelessWidget {
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(5),
|
padding: const EdgeInsets.all(5),
|
||||||
child: Container(
|
child: Container(
|
||||||
color: context.primaryColor,
|
color: context.themeData.cardColor,
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: const BorderRadius.only(
|
borderRadius: const BorderRadius.only(
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,8 @@ Future<dynamic> updateMangaDetail(UpdateMangaDetailRef ref,
|
||||||
[]
|
[]
|
||||||
..author =
|
..author =
|
||||||
getManga.author?.trim().trimLeft().trimRight() ?? manga.author ?? ""
|
getManga.author?.trim().trimLeft().trimRight() ?? manga.author ?? ""
|
||||||
|
..artist =
|
||||||
|
getManga.artist?.trim().trimLeft().trimRight() ?? manga.artist ?? ""
|
||||||
..status =
|
..status =
|
||||||
getManga.status == Status.unknown ? manga.status : getManga.status!
|
getManga.status == Status.unknown ? manga.status : getManga.status!
|
||||||
..description = getManga.description?.trim().trimLeft().trimRight() ??
|
..description = getManga.description?.trim().trimLeft().trimRight() ??
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,8 @@ void pushToMangaReaderDetail(
|
||||||
source: source,
|
source: source,
|
||||||
lang: lang,
|
lang: lang,
|
||||||
lastUpdate: 0,
|
lastUpdate: 0,
|
||||||
isManga: isManga ?? true);
|
isManga: isManga ?? true,
|
||||||
|
artist: getManga.artist ?? '');
|
||||||
final empty = isar.mangas
|
final empty = isar.mangas
|
||||||
.filter()
|
.filter()
|
||||||
.langEqualTo(lang)
|
.langEqualTo(lang)
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,10 @@ extension BuildContextExtensions on BuildContext {
|
||||||
return Theme.of(this).iconTheme.color!.withOpacity(0.7);
|
return Theme.of(this).iconTheme.color!.withOpacity(0.7);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ThemeData get themeData {
|
||||||
|
return Theme.of(this);
|
||||||
|
}
|
||||||
|
|
||||||
double mediaHeight(double data) {
|
double mediaHeight(double data) {
|
||||||
return MediaQuery.of(this).size.height * data;
|
return MediaQuery.of(this).size.height * data;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue