mangayomi-mirror/lib/models/source.dart
kodjomoustapha 35e5e2a015 New feature : add Anime
-add trackers support for anime
2023-07-27 19:24:18 +01:00

91 lines
1.6 KiB
Dart

import 'package:isar/isar.dart';
part 'source.g.dart';
@collection
@Name("Sources")
class Source {
Id? id;
String? name;
String? baseUrl;
String? lang;
bool? isActive;
bool? isAdded;
bool? isPinned;
bool? isNsfw;
String? sourceCode;
String? sourceCodeUrl;
String? typeSource;
String? iconUrl;
bool? isFullData;
bool? hasCloudflare;
bool? lastUsed;
String? dateFormat;
String? dateFormatLocale;
String? apiUrl;
String? version;
String? versionLast;
String? headers;
bool? isManga;
Source({
this.id = 0,
this.name = '',
this.baseUrl = '',
this.lang = '',
this.typeSource = '',
this.iconUrl = '',
this.dateFormat = '',
this.dateFormatLocale = '',
this.isActive = true,
this.isAdded = false,
this.isNsfw = false,
this.isFullData = false,
this.hasCloudflare = false,
this.isPinned = false,
this.lastUsed = false,
this.apiUrl = "",
this.sourceCodeUrl = "",
this.version = "",
this.versionLast = "",
this.sourceCode = '',
this.headers = '',
this.isManga = true,
});
Source.fromJson(Map<String, dynamic> json) {
name = json['name'];
id = json['id'];
baseUrl = json['baseUrl'];
lang = json['lang'];
typeSource = json['typeSource'];
iconUrl = json['iconUrl'];
dateFormat = json['dateFormat'];
dateFormatLocale = json['dateFormatLocale'];
isNsfw = json['isNsfw'];
hasCloudflare = json['hasCloudflare'];
sourceCodeUrl = json['sourceCodeUrl'];
apiUrl = json['apiUrl'];
version = json['version'];
isManga = json['isManga'] ?? true;
}
}