check if source is obsolete
This commit is contained in:
parent
6fc6f58230
commit
85f96070b8
20 changed files with 319 additions and 160 deletions
|
|
@ -53,6 +53,10 @@ class Source {
|
|||
|
||||
String? additionalParams;
|
||||
|
||||
bool? isLocal;
|
||||
|
||||
bool? isObsolete;
|
||||
|
||||
@enumerated
|
||||
SourceCodeLanguage sourceCodeLanguage = SourceCodeLanguage.dart;
|
||||
|
||||
|
|
@ -80,7 +84,9 @@ class Source {
|
|||
this.headers = '',
|
||||
this.isManga = true,
|
||||
this.appMinVerReq = "",
|
||||
this.additionalParams = ""});
|
||||
this.additionalParams = "",
|
||||
this.isLocal = false,
|
||||
this.isObsolete = false});
|
||||
|
||||
Source.fromJson(Map<String, dynamic> json) {
|
||||
apiUrl = json['apiUrl'];
|
||||
|
|
@ -107,6 +113,8 @@ class Source {
|
|||
version = json['version'];
|
||||
versionLast = json['versionLast'];
|
||||
additionalParams = json['additionalParams'] ?? "";
|
||||
isObsolete = json['isObsolete'];
|
||||
isLocal = json['isLocal'];
|
||||
sourceCodeLanguage =
|
||||
SourceCodeLanguage.values[json['sourceCodeLanguage'] ?? 0];
|
||||
}
|
||||
|
|
@ -136,7 +144,9 @@ class Source {
|
|||
'version': version,
|
||||
'versionLast': versionLast,
|
||||
'additionalParams': additionalParams,
|
||||
'sourceCodeLanguage': sourceCodeLanguage.index
|
||||
'sourceCodeLanguage': sourceCodeLanguage.index,
|
||||
'isObsolete': isObsolete,
|
||||
'isLocal': isLocal
|
||||
};
|
||||
|
||||
bool get isTorrent => (typeSource?.toLowerCase() ?? "") == "torrent";
|
||||
|
|
|
|||
|
|
@ -77,69 +77,79 @@ const SourceSchema = CollectionSchema(
|
|||
name: r'isFullData',
|
||||
type: IsarType.bool,
|
||||
),
|
||||
r'isManga': PropertySchema(
|
||||
r'isLocal': PropertySchema(
|
||||
id: 12,
|
||||
name: r'isLocal',
|
||||
type: IsarType.bool,
|
||||
),
|
||||
r'isManga': PropertySchema(
|
||||
id: 13,
|
||||
name: r'isManga',
|
||||
type: IsarType.bool,
|
||||
),
|
||||
r'isNsfw': PropertySchema(
|
||||
id: 13,
|
||||
id: 14,
|
||||
name: r'isNsfw',
|
||||
type: IsarType.bool,
|
||||
),
|
||||
r'isObsolete': PropertySchema(
|
||||
id: 15,
|
||||
name: r'isObsolete',
|
||||
type: IsarType.bool,
|
||||
),
|
||||
r'isPinned': PropertySchema(
|
||||
id: 14,
|
||||
id: 16,
|
||||
name: r'isPinned',
|
||||
type: IsarType.bool,
|
||||
),
|
||||
r'isTorrent': PropertySchema(
|
||||
id: 15,
|
||||
id: 17,
|
||||
name: r'isTorrent',
|
||||
type: IsarType.bool,
|
||||
),
|
||||
r'lang': PropertySchema(
|
||||
id: 16,
|
||||
id: 18,
|
||||
name: r'lang',
|
||||
type: IsarType.string,
|
||||
),
|
||||
r'lastUsed': PropertySchema(
|
||||
id: 17,
|
||||
id: 19,
|
||||
name: r'lastUsed',
|
||||
type: IsarType.bool,
|
||||
),
|
||||
r'name': PropertySchema(
|
||||
id: 18,
|
||||
id: 20,
|
||||
name: r'name',
|
||||
type: IsarType.string,
|
||||
),
|
||||
r'sourceCode': PropertySchema(
|
||||
id: 19,
|
||||
id: 21,
|
||||
name: r'sourceCode',
|
||||
type: IsarType.string,
|
||||
),
|
||||
r'sourceCodeLanguage': PropertySchema(
|
||||
id: 20,
|
||||
id: 22,
|
||||
name: r'sourceCodeLanguage',
|
||||
type: IsarType.byte,
|
||||
enumMap: _SourcesourceCodeLanguageEnumValueMap,
|
||||
),
|
||||
r'sourceCodeUrl': PropertySchema(
|
||||
id: 21,
|
||||
id: 23,
|
||||
name: r'sourceCodeUrl',
|
||||
type: IsarType.string,
|
||||
),
|
||||
r'typeSource': PropertySchema(
|
||||
id: 22,
|
||||
id: 24,
|
||||
name: r'typeSource',
|
||||
type: IsarType.string,
|
||||
),
|
||||
r'version': PropertySchema(
|
||||
id: 23,
|
||||
id: 25,
|
||||
name: r'version',
|
||||
type: IsarType.string,
|
||||
),
|
||||
r'versionLast': PropertySchema(
|
||||
id: 24,
|
||||
id: 26,
|
||||
name: r'versionLast',
|
||||
type: IsarType.string,
|
||||
)
|
||||
|
|
@ -275,19 +285,21 @@ void _sourceSerialize(
|
|||
writer.writeBool(offsets[9], object.isActive);
|
||||
writer.writeBool(offsets[10], object.isAdded);
|
||||
writer.writeBool(offsets[11], object.isFullData);
|
||||
writer.writeBool(offsets[12], object.isManga);
|
||||
writer.writeBool(offsets[13], object.isNsfw);
|
||||
writer.writeBool(offsets[14], object.isPinned);
|
||||
writer.writeBool(offsets[15], object.isTorrent);
|
||||
writer.writeString(offsets[16], object.lang);
|
||||
writer.writeBool(offsets[17], object.lastUsed);
|
||||
writer.writeString(offsets[18], object.name);
|
||||
writer.writeString(offsets[19], object.sourceCode);
|
||||
writer.writeByte(offsets[20], object.sourceCodeLanguage.index);
|
||||
writer.writeString(offsets[21], object.sourceCodeUrl);
|
||||
writer.writeString(offsets[22], object.typeSource);
|
||||
writer.writeString(offsets[23], object.version);
|
||||
writer.writeString(offsets[24], object.versionLast);
|
||||
writer.writeBool(offsets[12], object.isLocal);
|
||||
writer.writeBool(offsets[13], object.isManga);
|
||||
writer.writeBool(offsets[14], object.isNsfw);
|
||||
writer.writeBool(offsets[15], object.isObsolete);
|
||||
writer.writeBool(offsets[16], object.isPinned);
|
||||
writer.writeBool(offsets[17], object.isTorrent);
|
||||
writer.writeString(offsets[18], object.lang);
|
||||
writer.writeBool(offsets[19], object.lastUsed);
|
||||
writer.writeString(offsets[20], object.name);
|
||||
writer.writeString(offsets[21], object.sourceCode);
|
||||
writer.writeByte(offsets[22], object.sourceCodeLanguage.index);
|
||||
writer.writeString(offsets[23], object.sourceCodeUrl);
|
||||
writer.writeString(offsets[24], object.typeSource);
|
||||
writer.writeString(offsets[25], object.version);
|
||||
writer.writeString(offsets[26], object.versionLast);
|
||||
}
|
||||
|
||||
Source _sourceDeserialize(
|
||||
|
|
@ -310,20 +322,22 @@ Source _sourceDeserialize(
|
|||
isActive: reader.readBoolOrNull(offsets[9]),
|
||||
isAdded: reader.readBoolOrNull(offsets[10]),
|
||||
isFullData: reader.readBoolOrNull(offsets[11]),
|
||||
isManga: reader.readBoolOrNull(offsets[12]),
|
||||
isNsfw: reader.readBoolOrNull(offsets[13]),
|
||||
isPinned: reader.readBoolOrNull(offsets[14]),
|
||||
lang: reader.readStringOrNull(offsets[16]),
|
||||
lastUsed: reader.readBoolOrNull(offsets[17]),
|
||||
name: reader.readStringOrNull(offsets[18]),
|
||||
sourceCode: reader.readStringOrNull(offsets[19]),
|
||||
sourceCodeUrl: reader.readStringOrNull(offsets[21]),
|
||||
typeSource: reader.readStringOrNull(offsets[22]),
|
||||
version: reader.readStringOrNull(offsets[23]),
|
||||
versionLast: reader.readStringOrNull(offsets[24]),
|
||||
isLocal: reader.readBoolOrNull(offsets[12]),
|
||||
isManga: reader.readBoolOrNull(offsets[13]),
|
||||
isNsfw: reader.readBoolOrNull(offsets[14]),
|
||||
isObsolete: reader.readBoolOrNull(offsets[15]),
|
||||
isPinned: reader.readBoolOrNull(offsets[16]),
|
||||
lang: reader.readStringOrNull(offsets[18]),
|
||||
lastUsed: reader.readBoolOrNull(offsets[19]),
|
||||
name: reader.readStringOrNull(offsets[20]),
|
||||
sourceCode: reader.readStringOrNull(offsets[21]),
|
||||
sourceCodeUrl: reader.readStringOrNull(offsets[23]),
|
||||
typeSource: reader.readStringOrNull(offsets[24]),
|
||||
version: reader.readStringOrNull(offsets[25]),
|
||||
versionLast: reader.readStringOrNull(offsets[26]),
|
||||
);
|
||||
object.sourceCodeLanguage = _SourcesourceCodeLanguageValueEnumMap[
|
||||
reader.readByteOrNull(offsets[20])] ??
|
||||
reader.readByteOrNull(offsets[22])] ??
|
||||
SourceCodeLanguage.dart;
|
||||
return object;
|
||||
}
|
||||
|
|
@ -366,27 +380,31 @@ P _sourceDeserializeProp<P>(
|
|||
case 14:
|
||||
return (reader.readBoolOrNull(offset)) as P;
|
||||
case 15:
|
||||
return (reader.readBool(offset)) as P;
|
||||
case 16:
|
||||
return (reader.readStringOrNull(offset)) as P;
|
||||
case 17:
|
||||
return (reader.readBoolOrNull(offset)) as P;
|
||||
case 16:
|
||||
return (reader.readBoolOrNull(offset)) as P;
|
||||
case 17:
|
||||
return (reader.readBool(offset)) as P;
|
||||
case 18:
|
||||
return (reader.readStringOrNull(offset)) as P;
|
||||
case 19:
|
||||
return (reader.readStringOrNull(offset)) as P;
|
||||
return (reader.readBoolOrNull(offset)) as P;
|
||||
case 20:
|
||||
return (_SourcesourceCodeLanguageValueEnumMap[
|
||||
reader.readByteOrNull(offset)] ??
|
||||
SourceCodeLanguage.dart) as P;
|
||||
return (reader.readStringOrNull(offset)) as P;
|
||||
case 21:
|
||||
return (reader.readStringOrNull(offset)) as P;
|
||||
case 22:
|
||||
return (reader.readStringOrNull(offset)) as P;
|
||||
return (_SourcesourceCodeLanguageValueEnumMap[
|
||||
reader.readByteOrNull(offset)] ??
|
||||
SourceCodeLanguage.dart) as P;
|
||||
case 23:
|
||||
return (reader.readStringOrNull(offset)) as P;
|
||||
case 24:
|
||||
return (reader.readStringOrNull(offset)) as P;
|
||||
case 25:
|
||||
return (reader.readStringOrNull(offset)) as P;
|
||||
case 26:
|
||||
return (reader.readStringOrNull(offset)) as P;
|
||||
default:
|
||||
throw IsarError('Unknown property with id $propertyId');
|
||||
}
|
||||
|
|
@ -1839,6 +1857,32 @@ extension SourceQueryFilter on QueryBuilder<Source, Source, QFilterCondition> {
|
|||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Source, Source, QAfterFilterCondition> isLocalIsNull() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(const FilterCondition.isNull(
|
||||
property: r'isLocal',
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Source, Source, QAfterFilterCondition> isLocalIsNotNull() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(const FilterCondition.isNotNull(
|
||||
property: r'isLocal',
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Source, Source, QAfterFilterCondition> isLocalEqualTo(
|
||||
bool? value) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'isLocal',
|
||||
value: value,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Source, Source, QAfterFilterCondition> isMangaIsNull() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(const FilterCondition.isNull(
|
||||
|
|
@ -1891,6 +1935,32 @@ extension SourceQueryFilter on QueryBuilder<Source, Source, QFilterCondition> {
|
|||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Source, Source, QAfterFilterCondition> isObsoleteIsNull() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(const FilterCondition.isNull(
|
||||
property: r'isObsolete',
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Source, Source, QAfterFilterCondition> isObsoleteIsNotNull() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(const FilterCondition.isNotNull(
|
||||
property: r'isObsolete',
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Source, Source, QAfterFilterCondition> isObsoleteEqualTo(
|
||||
bool? value) {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(FilterCondition.equalTo(
|
||||
property: r'isObsolete',
|
||||
value: value,
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Source, Source, QAfterFilterCondition> isPinnedIsNull() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addFilterCondition(const FilterCondition.isNull(
|
||||
|
|
@ -3179,6 +3249,18 @@ extension SourceQuerySortBy on QueryBuilder<Source, Source, QSortBy> {
|
|||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Source, Source, QAfterSortBy> sortByIsLocal() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'isLocal', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Source, Source, QAfterSortBy> sortByIsLocalDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'isLocal', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Source, Source, QAfterSortBy> sortByIsManga() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'isManga', Sort.asc);
|
||||
|
|
@ -3203,6 +3285,18 @@ extension SourceQuerySortBy on QueryBuilder<Source, Source, QSortBy> {
|
|||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Source, Source, QAfterSortBy> sortByIsObsolete() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'isObsolete', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Source, Source, QAfterSortBy> sortByIsObsoleteDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'isObsolete', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Source, Source, QAfterSortBy> sortByIsPinned() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'isPinned', Sort.asc);
|
||||
|
|
@ -3493,6 +3587,18 @@ extension SourceQuerySortThenBy on QueryBuilder<Source, Source, QSortThenBy> {
|
|||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Source, Source, QAfterSortBy> thenByIsLocal() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'isLocal', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Source, Source, QAfterSortBy> thenByIsLocalDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'isLocal', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Source, Source, QAfterSortBy> thenByIsManga() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'isManga', Sort.asc);
|
||||
|
|
@ -3517,6 +3623,18 @@ extension SourceQuerySortThenBy on QueryBuilder<Source, Source, QSortThenBy> {
|
|||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Source, Source, QAfterSortBy> thenByIsObsolete() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'isObsolete', Sort.asc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Source, Source, QAfterSortBy> thenByIsObsoleteDesc() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'isObsolete', Sort.desc);
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Source, Source, QAfterSortBy> thenByIsPinned() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addSortBy(r'isPinned', Sort.asc);
|
||||
|
|
@ -3733,6 +3851,12 @@ extension SourceQueryWhereDistinct on QueryBuilder<Source, Source, QDistinct> {
|
|||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Source, Source, QDistinct> distinctByIsLocal() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addDistinctBy(r'isLocal');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Source, Source, QDistinct> distinctByIsManga() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addDistinctBy(r'isManga');
|
||||
|
|
@ -3745,6 +3869,12 @@ extension SourceQueryWhereDistinct on QueryBuilder<Source, Source, QDistinct> {
|
|||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Source, Source, QDistinct> distinctByIsObsolete() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addDistinctBy(r'isObsolete');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Source, Source, QDistinct> distinctByIsPinned() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addDistinctBy(r'isPinned');
|
||||
|
|
@ -3899,6 +4029,12 @@ extension SourceQueryProperty on QueryBuilder<Source, Source, QQueryProperty> {
|
|||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Source, bool?, QQueryOperations> isLocalProperty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addPropertyName(r'isLocal');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Source, bool?, QQueryOperations> isMangaProperty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addPropertyName(r'isManga');
|
||||
|
|
@ -3911,6 +4047,12 @@ extension SourceQueryProperty on QueryBuilder<Source, Source, QQueryProperty> {
|
|||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Source, bool?, QQueryOperations> isObsoleteProperty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addPropertyName(r'isObsolete');
|
||||
});
|
||||
}
|
||||
|
||||
QueryBuilder<Source, bool?, QQueryOperations> isPinnedProperty() {
|
||||
return QueryBuilder.apply(this, (query) {
|
||||
return query.addPropertyName(r'isPinned');
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import 'package:go_router/go_router.dart';
|
|||
import 'package:isar/isar.dart';
|
||||
import 'package:mangayomi/main.dart';
|
||||
import 'package:mangayomi/models/source.dart';
|
||||
import 'package:mangayomi/modules/browse/extension/providers/fetch_manga_sources.dart';
|
||||
import 'package:mangayomi/services/fetch_manga_sources.dart';
|
||||
import 'package:mangayomi/modules/more/settings/browse/providers/browse_state_provider.dart';
|
||||
import 'package:mangayomi/providers/l10n_providers.dart';
|
||||
import 'package:mangayomi/providers/storage_provider.dart';
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|||
import 'package:grouped_list/sliver_grouped_list.dart';
|
||||
import 'package:mangayomi/models/source.dart';
|
||||
import 'package:mangayomi/modules/browse/extension/providers/extensions_provider.dart';
|
||||
import 'package:mangayomi/modules/browse/extension/providers/fetch_anime_sources.dart';
|
||||
import 'package:mangayomi/modules/browse/extension/providers/fetch_manga_sources.dart';
|
||||
import 'package:mangayomi/services/fetch_anime_sources.dart';
|
||||
import 'package:mangayomi/services/fetch_manga_sources.dart';
|
||||
import 'package:mangayomi/modules/widgets/progress_center.dart';
|
||||
import 'package:mangayomi/providers/l10n_providers.dart';
|
||||
import 'package:mangayomi/sources/source_test.dart';
|
||||
|
|
|
|||
|
|
@ -3,10 +3,11 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mangayomi/main.dart';
|
||||
import 'package:mangayomi/models/source.dart';
|
||||
import 'package:mangayomi/modules/browse/extension/providers/fetch_anime_sources.dart';
|
||||
import 'package:mangayomi/modules/browse/extension/providers/fetch_manga_sources.dart';
|
||||
import 'package:mangayomi/services/fetch_anime_sources.dart';
|
||||
import 'package:mangayomi/services/fetch_manga_sources.dart';
|
||||
import 'package:mangayomi/providers/l10n_providers.dart';
|
||||
import 'package:mangayomi/utils/cached_network.dart';
|
||||
import 'package:mangayomi/utils/extensions/build_context_extensions.dart';
|
||||
import 'package:mangayomi/utils/language.dart';
|
||||
|
||||
class ExtensionListTileWidget extends ConsumerStatefulWidget {
|
||||
|
|
@ -90,42 +91,46 @@ class _ExtensionListTileWidgetState
|
|||
Text(completeLanguageName(widget.source.lang!.toLowerCase()),
|
||||
style:
|
||||
const TextStyle(fontWeight: FontWeight.w300, fontSize: 12)),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
const SizedBox(width: 4),
|
||||
Text(widget.source.version!,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w300, fontSize: 10)),
|
||||
if (widget.source.isNsfw!)
|
||||
Row(
|
||||
children: [
|
||||
const SizedBox(
|
||||
width: 2,
|
||||
),
|
||||
SizedBox(
|
||||
height: 15,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.red.withOpacity(0.7),
|
||||
borderRadius: BorderRadius.circular(5)),
|
||||
child: const Center(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(3),
|
||||
child: Text(
|
||||
"NSFW",
|
||||
style: TextStyle(
|
||||
fontSize: 6,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white),
|
||||
),
|
||||
),
|
||||
)),
|
||||
),
|
||||
],
|
||||
const SizedBox(width: 4),
|
||||
Text(widget.source.version!,
|
||||
style:
|
||||
const TextStyle(fontWeight: FontWeight.w300, fontSize: 12)),
|
||||
if (widget.source.isNsfw!)
|
||||
Row(
|
||||
children: [
|
||||
const SizedBox(
|
||||
width: 2,
|
||||
),
|
||||
],
|
||||
)
|
||||
SizedBox(
|
||||
height: 15,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.red.withOpacity(0.7),
|
||||
borderRadius: BorderRadius.circular(5)),
|
||||
child: const Center(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(3),
|
||||
child: Text(
|
||||
"NSFW",
|
||||
style: TextStyle(
|
||||
fontSize: 6,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white),
|
||||
),
|
||||
),
|
||||
)),
|
||||
),
|
||||
],
|
||||
),
|
||||
if (widget.source.isObsolete ?? false)
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
||||
child: Text("OBSOLETE",
|
||||
style: TextStyle(
|
||||
color: context.primaryColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 12)),
|
||||
)
|
||||
],
|
||||
),
|
||||
trailing: TextButton(
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ import 'package:google_fonts/google_fonts.dart';
|
|||
import 'package:isar/isar.dart';
|
||||
import 'package:mangayomi/main.dart';
|
||||
import 'package:mangayomi/models/source.dart';
|
||||
import 'package:mangayomi/modules/browse/extension/providers/fetch_anime_sources.dart';
|
||||
import 'package:mangayomi/modules/browse/extension/providers/fetch_manga_sources.dart';
|
||||
import 'package:mangayomi/services/fetch_anime_sources.dart';
|
||||
import 'package:mangayomi/services/fetch_manga_sources.dart';
|
||||
import 'package:mangayomi/modules/main_view/providers/migration.dart';
|
||||
import 'package:mangayomi/modules/more/about/providers/check_for_update.dart';
|
||||
import 'package:mangayomi/modules/more/backup_and_restore/providers/auto_backup.dart';
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ part of 'download_provider.dart';
|
|||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$downloadChapterHash() => r'dcb0ade7f80a1ec593667e7311cdafc2d31222cf';
|
||||
String _$downloadChapterHash() => r'a8bbd438963157af07b92601c1741195421a3281';
|
||||
|
||||
/// Copied from Dart SDK
|
||||
class _SystemHash {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import 'dart:developer';
|
|||
import 'package:bot_toast/bot_toast.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mangayomi/modules/browse/extension/providers/fetch_manga_sources.dart';
|
||||
import 'package:mangayomi/services/fetch_manga_sources.dart';
|
||||
import 'package:mangayomi/providers/l10n_providers.dart';
|
||||
import 'package:mangayomi/services/http/m_client.dart';
|
||||
import 'package:mangayomi/utils/extensions/string_extensions.dart';
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ part of 'aniskip.dart';
|
|||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$aniSkipHash() => r'bd921f6bbeebd61d17644a6efd4e5960330ba17b';
|
||||
String _$aniSkipHash() => r'04cf38b827f60d846b1d8fe87e994e9876d106ff';
|
||||
|
||||
/// See also [AniSkip].
|
||||
@ProviderFor(AniSkip)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import 'dart:convert';
|
||||
import 'package:mangayomi/main.dart';
|
||||
import 'package:mangayomi/models/source.dart';
|
||||
import 'package:mangayomi/modules/browse/extension/providers/fetch_manga_sources.dart';
|
||||
import 'package:mangayomi/services/fetch_manga_sources.dart';
|
||||
import 'package:mangayomi/modules/more/settings/browse/providers/browse_state_provider.dart';
|
||||
import 'package:mangayomi/services/http/m_client.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
|
|
@ -127,5 +127,6 @@ Future fetchAnimeSourcesList(FetchAnimeSourcesListRef ref,
|
|||
}
|
||||
}
|
||||
});
|
||||
checkIfSourceIsObsolete(sourceList);
|
||||
}
|
||||
}
|
||||
|
|
@ -7,7 +7,7 @@ part of 'fetch_anime_sources.dart';
|
|||
// **************************************************************************
|
||||
|
||||
String _$fetchAnimeSourcesListHash() =>
|
||||
r'e3d8819da62aabcf7ce82ba67c485f76fd9f7492';
|
||||
r'c84ceb974ca48efdaccd9e3fc44ce7aaab42f086';
|
||||
|
||||
/// Copied from Dart SDK
|
||||
class _SystemHash {
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
import 'dart:convert';
|
||||
import 'package:dart_eval/stdlib/core.dart';
|
||||
import 'package:isar/isar.dart';
|
||||
import 'package:mangayomi/eval/dart/compiler/compiler.dart';
|
||||
import 'package:mangayomi/eval/dart/runtime/runtime.dart';
|
||||
import 'package:mangayomi/main.dart';
|
||||
|
|
@ -129,6 +130,22 @@ Future fetchMangaSourcesList(FetchMangaSourcesListRef ref,
|
|||
}
|
||||
}
|
||||
});
|
||||
checkIfSourceIsObsolete(sourceList);
|
||||
}
|
||||
}
|
||||
|
||||
void checkIfSourceIsObsolete(List<Source> sourceList) {
|
||||
for (var source in isar.sources.filter().idIsNotNull().findAllSync()) {
|
||||
if (sourceList.isNotEmpty && !(source.isLocal ?? false)) {
|
||||
final ids =
|
||||
sourceList.where((e) => e.id != null).map((e) => e.id).toList();
|
||||
if (ids.isNotEmpty) {
|
||||
if (!ids.contains(source.id)) {
|
||||
isar.writeTxnSync(
|
||||
() => isar.sources.putSync(source..isObsolete = true));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -7,7 +7,7 @@ part of 'fetch_manga_sources.dart';
|
|||
// **************************************************************************
|
||||
|
||||
String _$fetchMangaSourcesListHash() =>
|
||||
r'd5e159297c52465b30b2a2f7c6fd13f22778d218';
|
||||
r'6eee9171e2fc6a27faa6350b074391b8250274b0';
|
||||
|
||||
/// Copied from Dart SDK
|
||||
class _SystemHash {
|
||||
|
|
@ -6,7 +6,7 @@ part of 'get_video_list.dart';
|
|||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$getVideoListHash() => r'dd53ef51fd6c729a985644336d467507e5c7923d';
|
||||
String _$getVideoListHash() => r'39511ee62594437fc1bdb51ab531810760d45e0a';
|
||||
|
||||
/// Copied from Dart SDK
|
||||
class _SystemHash {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ part of 'anilist.dart';
|
|||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$anilistHash() => r'afd6de461493a0f7a658e5f9d33bffc9d51c1f6d';
|
||||
String _$anilistHash() => r'4d54bf86bb2f1133e77609c94b22f4ad17837f20';
|
||||
|
||||
/// Copied from Dart SDK
|
||||
class _SystemHash {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ part of 'kitsu.dart';
|
|||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$kitsuHash() => r'c8ceccec70441eefe0c4a94c901adaaa5009cff3';
|
||||
String _$kitsuHash() => r'1fc9a9274c5422d69861487de9ead02f7f2e4c20';
|
||||
|
||||
/// Copied from Dart SDK
|
||||
class _SystemHash {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ part of 'myanimelist.dart';
|
|||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$myAnimeListHash() => r'0213cf673c21b2c164cbac3b86de196335daebf7';
|
||||
String _$myAnimeListHash() => r'88037091b9d25e60a57abb9f8e2ed4d426113a0f';
|
||||
|
||||
/// Copied from Dart SDK
|
||||
class _SystemHash {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ part of 'headers.dart';
|
|||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$headersHash() => r'09d7ba864bc1adec0d540ca6f651d11b76c250a0';
|
||||
String _$headersHash() => r'b329d905b62e8d5fa8e8a1e22d7f6c7f8d115c51';
|
||||
|
||||
/// Copied from Dart SDK
|
||||
class _SystemHash {
|
||||
|
|
|
|||
98
pubspec.lock
98
pubspec.lock
|
|
@ -141,10 +141,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: built_value
|
||||
sha256: a3ec2e0f967bc47f69f95009bb93db936288d61d5343b9436e378b28a2f830c6
|
||||
sha256: fedde275e0a6b798c3296963c5cd224e3e1b55d0e478d5b7e65e6b540f363a0e
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "8.9.0"
|
||||
version: "8.9.1"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -169,14 +169,6 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.3"
|
||||
ci:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: ci
|
||||
sha256: "145d095ce05cddac4d797a158bc4cf3b6016d1fe63d8c3d2fbd7212590adca13"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.1.0"
|
||||
cli_util:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -221,10 +213,10 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
name: cronet_http
|
||||
sha256: a38ffbb49797ae1e0f774fc884d128a7023986b14a3165e1e39841f9f7e22137
|
||||
sha256: "9b9f00ae48971bc8a8cbdd4528bd35511adce00fb79d1ebf9f9907667056640f"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.1"
|
||||
version: "1.2.0"
|
||||
cross_file:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -265,22 +257,14 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.6"
|
||||
custom_lint:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: custom_lint
|
||||
sha256: f89ff83efdba7c8996e86bb3bad0b759d58f9b19ae4d0e277a386ddd8b481217
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.6.0"
|
||||
custom_lint_core:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: custom_lint_core
|
||||
sha256: "1e9128e095ad5e0973469bdaac1ead8bfc86c485954c23cf617299de5e6fa029"
|
||||
sha256: a85e8f78f4c52f6c63cdaf8c872eb573db0231dcdf3c3a5906d493c1f8bc20e6
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.6.1"
|
||||
version: "0.6.3"
|
||||
dart_eval:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
|
@ -293,10 +277,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: dart_style
|
||||
sha256: "40ae61a5d43feea6d24bd22c0537a6629db858963b99b4bc1c3db80676f32368"
|
||||
sha256: "99e066ce75c89d6b29903d788a7bb9369cf754f7b24bf70bf4b6d6d6b26853b9"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.4"
|
||||
version: "2.3.6"
|
||||
dartx:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -396,10 +380,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: extended_image_library
|
||||
sha256: a7cc0270299589ba12b21152abd8ac7287ac8e1997c7ce1a26c337bac4429208
|
||||
sha256: d9a3675485bd69fe1bbe3b7f5664a3544d3eb518adb5a18dab05557562ae1395
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.2"
|
||||
version: "4.0.3"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -436,10 +420,10 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
name: file_picker
|
||||
sha256: "4e42aacde3b993c5947467ab640882c56947d9d27342a5b6f2895b23956954a6"
|
||||
sha256: "1bbf65dd997458a08b531042ec3794112a6c39c07c37ff22113d2e7e4f81d4e4"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.1.1"
|
||||
version: "6.2.1"
|
||||
fixnum:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -535,10 +519,10 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_riverpod
|
||||
sha256: "4bce556b7ecbfea26109638d5237684538d4abc509d253e6c5c4c5733b360098"
|
||||
sha256: "0f1974eff5bbe774bf1d870e406fc6f29e3d6f1c46bd9c58e7172ff68a785d7d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.4.10"
|
||||
version: "2.5.1"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
|
|
@ -642,10 +626,10 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
name: google_fonts
|
||||
sha256: f0b8d115a13ecf827013ec9fc883390ccc0e87a96ed5347a3114cac177ef18e8
|
||||
sha256: b1ac0fe2832c9cc95e5e88b57d627c5e68c223b9657f4b96e1487aa9098c7b82
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.1.0"
|
||||
version: "6.2.1"
|
||||
graphs:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -794,10 +778,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: jni
|
||||
sha256: "0d88790bdf7e298aa65a9094c62b58ea231169a2deb84f23defc7d7955885b43"
|
||||
sha256: "499558e919997adfc45809a66caf0b95b91393e23289dd2826b152f8f04e6611"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.7.2"
|
||||
version: "0.7.3"
|
||||
js:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -826,10 +810,10 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
name: json_path
|
||||
sha256: b1a3e5e34c862a6ca598e226e725647e462bde9fd98dbfa21bb53e105efeb177
|
||||
sha256: "149d32ceb7dc22422ea6d09e401fd688f54e1343bc9ff8c3cb1900ca3b1ad8b1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.7.0"
|
||||
version: "0.7.1"
|
||||
json_view:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
|
@ -1123,10 +1107,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_apple
|
||||
sha256: bdafc6db74253abb63907f4e357302e6bb786ab41465e8635f362ee71fd8707b
|
||||
sha256: "92861b0f0c2443dd8898398c2baa4f1ae925109b5909ae4a17d0108a6a788932"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "9.4.0"
|
||||
version: "9.4.2"
|
||||
permission_handler_html:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -1251,18 +1235,18 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
name: rinf
|
||||
sha256: ebddee9235ac046c2200052325d85b7582ed6e255f3458124c8b3229c6c9add0
|
||||
sha256: a8a61585a5c8e57bb374d6491821dd4656096a44761d300e435490495af73e77
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.6.2"
|
||||
version: "6.7.0"
|
||||
riverpod:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: riverpod
|
||||
sha256: "548e2192eb7aeb826eb89387f814edb76594f3363e2c0bb99dd733d795ba3589"
|
||||
sha256: f21b32ffd26a36555e501b04f4a5dca43ed59e16343f1a30c13632b2351dfa4d
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.5.0"
|
||||
version: "2.5.1"
|
||||
riverpod_analyzer_utils:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -1275,18 +1259,18 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
name: riverpod_annotation
|
||||
sha256: "77e5d51afa4fa3e67903fb8746f33d368728d7051a0b6c292bcee60aeba46d95"
|
||||
sha256: e5e796c0eba4030c704e9dae1b834a6541814963292839dcf9638d53eba84f5c
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.4"
|
||||
version: "2.3.5"
|
||||
riverpod_generator:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: riverpod_generator
|
||||
sha256: "359068f04879347ae4edbe66c81cc95f83fa1743806d1a0c86e55dd3c33ebb32"
|
||||
sha256: d451608bf17a372025fc36058863737636625dfdb7e3cbf6142e0dfeb366ab22
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.11"
|
||||
version: "2.4.0"
|
||||
rxdart:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -1379,10 +1363,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: share_plus_platform_interface
|
||||
sha256: df08bc3a07d01f5ea47b45d03ffcba1fa9cd5370fb44b3f38c70e42cced0f956
|
||||
sha256: "251eb156a8b5fa9ce033747d73535bf53911071f8d3b6f4f0b578505ce0d4496"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.3.1"
|
||||
version: "3.4.0"
|
||||
shelf:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -1544,10 +1528,10 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
name: url_launcher
|
||||
sha256: c512655380d241a337521703af62d2c122bf7b77a46ff7dd750092aa9433499c
|
||||
sha256: "0ecc004c62fd3ed36a2ffcbe0dd9700aee63bd7532d0b642a488b1ec310f492e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.2.4"
|
||||
version: "6.2.5"
|
||||
url_launcher_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -1560,10 +1544,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: url_launcher_ios
|
||||
sha256: "75bb6fe3f60070407704282a2d295630cab232991eb52542b18347a8a941df03"
|
||||
sha256: "9149d493b075ed740901f3ee844a38a00b33116c7c5c10d7fb27df8987fb51d5"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.2.4"
|
||||
version: "6.2.5"
|
||||
url_launcher_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -1680,10 +1664,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: win32
|
||||
sha256: "464f5674532865248444b4c3daca12bd9bf2d7c47f759ce2617986e7229494a8"
|
||||
sha256: "8cb58b45c47dcb42ab3651533626161d6b67a2921917d8d429791f76972b3480"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.2.0"
|
||||
version: "5.3.0"
|
||||
window_manager:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
|
@ -1752,10 +1736,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: yaml_edit
|
||||
sha256: "1579d4a0340a83cf9e4d580ea51a16329c916973bffd5bd4b45e911b25d46bfd"
|
||||
sha256: c566f4f804215d84a7a2c377667f546c6033d5b34b4f9e60dfb09d17c4e97826
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
version: "2.2.0"
|
||||
sdks:
|
||||
dart: ">=3.3.0 <4.0.0"
|
||||
flutter: ">=3.16.0"
|
||||
flutter: ">=3.19.2"
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ dependencies:
|
|||
git:
|
||||
url: https://github.com/kodjodevf/flutter_qjs.git
|
||||
ref: main
|
||||
cronet_http: ^1.1.1
|
||||
cronet_http: ^1.2.0
|
||||
cupertino_http: ^1.3.0
|
||||
http: ^1.2.0
|
||||
google_api_availability: ^5.0.0
|
||||
|
|
|
|||
Loading…
Reference in a new issue