opt handle res

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-29 17:17:35 +08:00
parent b643cb1bd0
commit 924d51d41b
198 changed files with 3715 additions and 2001 deletions

View File

@@ -8,7 +8,7 @@ class DanmakuBlockDataModel {
DanmakuBlockDataModel.fromJson(Map<String, dynamic> json) {
rule = (json['rule'] as List?)?.map((v) => SimpleRule.fromJson(v)).toList();
toast = json['toast'];
toast = json['toast'] == '' ? null : json['toast'];
valid = json['valid'];
ver = json['ver'];
}

View File

@@ -31,7 +31,7 @@ class FavDetailItemData extends BaseVideoItemModel with MultiSelectData {
String? link;
int? ctime;
int? favTime;
Map? ogv;
Ogv? ogv;
String? epId;
FavDetailItemData.fromJson(Map<String, dynamic> json) {
@@ -51,7 +51,7 @@ class FavDetailItemData extends BaseVideoItemModel with MultiSelectData {
pubdate = json['pubtime'];
favTime = json['fav_time'];
bvid = json['bvid'];
ogv = json['ogv'];
ogv = json['ogv'] == null ? null : Ogv.fromJson(json['ogv']);
stat = PlayStat.fromJson(json['cnt_info']);
cid = json['ugc']?['first_cid'];
if (json['link'] != null && json['link'].contains('/bangumi')) {
@@ -62,3 +62,21 @@ class FavDetailItemData extends BaseVideoItemModel with MultiSelectData {
static final _digitRegExp = RegExp(r'\d+');
String resolveEpId(String url) => _digitRegExp.firstMatch(url)!.group(0)!;
}
class Ogv {
String? typeName;
int? typeId;
int? seasonId;
Ogv({
this.typeName,
this.typeId,
this.seasonId,
});
factory Ogv.fromJson(Map<String, dynamic> json) => Ogv(
typeName: json["type_name"],
typeId: json["type_id"],
seasonId: json["season_id"],
);
}

View File

@@ -93,7 +93,7 @@ class HisListItem with MultiSelectData {
longTitle = json['long_title'];
cover = json['cover'];
pic = json['cover'] ?? '';
covers = json['covers'] ?? [];
covers = json['covers'];
uri = json['uri'];
history = History.fromJson(json['history']);
videos = json['videos'];

View File

@@ -8,10 +8,8 @@ class MyEmote {
setting =
json['setting'] != null ? Setting.fromJson(json['setting']) : null;
if (json['packages'] != null) {
packages = <Packages>[];
json['packages'].forEach((v) {
packages!.add(Packages.fromJson(v));
});
packages =
(json['packages'] as List).map((e) => Packages.fromJson(e)).toList();
}
}
@@ -89,10 +87,7 @@ class Packages {
attr = json['attr'];
meta = json['meta'] != null ? PackagesMeta.fromJson(json['meta']) : null;
if (json['emote'] != null) {
emote = <Emote>[];
json['emote'].forEach((v) {
emote!.add(Emote.fromJson(v));
});
emote = (json['emote'] as List).map((e) => Emote.fromJson(e)).toList();
}
flags =
json['flags'] != null ? PackagesFlags.fromJson(json['flags']) : null;