From 34c818a2cd9b4c1ca7ebddef37a63ea7520fb0e0 Mon Sep 17 00:00:00 2001 From: kodjomoustapha <107993382+kodjodevf@users.noreply.github.com> Date: Mon, 6 Jan 2025 15:36:05 +0100 Subject: [PATCH] + --- model/source.dart | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/model/source.dart b/model/source.dart index 94b2b4c..f9bc699 100644 --- a/model/source.dart +++ b/model/source.dart @@ -25,6 +25,8 @@ class Source { String? version; + bool? isManga; + ItemType? itemType; bool? isFullData; @@ -49,6 +51,7 @@ class Source { this.sourceCodeUrl = "", this.apiUrl = "", this.version = "", + this.isManga, this.itemType = ItemType.manga, this.isFullData = false, this.appMinVerReq = "0.2.0", @@ -73,6 +76,7 @@ class Source { isNsfw = json['isNsfw'] ?? false; lang = json['lang'] ?? ""; name = json['name'] ?? ""; + isManga = json['isManga'] ?? ((json['itemType'] as int?) ?? 0) == 0; sourceCodeUrl = json['sourceCodeUrl'] ?? ""; typeSource = json['typeSource'] ?? ""; version = json['version'] ?? ""; @@ -95,6 +99,7 @@ class Source { "sourceCodeUrl": sourceCodeUrl, "apiUrl": apiUrl, "version": version, + "isManga": isManga ?? (itemType?.index ?? 0) == 0, "itemType": itemType?.index ?? 0, "isFullData": isFullData, "appMinVerReq": appMinVerReq, @@ -106,8 +111,4 @@ class Source { const branchName = "main"; -enum ItemType { - manga, - anime, - novel -} \ No newline at end of file +enum ItemType { manga, anime, novel }