From 3c0f54bfd74b50f25d46466fceab768f7f604d96 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Fri, 16 Feb 2024 21:46:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20app=E7=AB=AFmodel=20bvid=20null=20issues?= =?UTF-8?q?=20#546?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/models/home/rcmd/result.dart | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/models/home/rcmd/result.dart b/lib/models/home/rcmd/result.dart index 9363beb3..78747d1a 100644 --- a/lib/models/home/rcmd/result.dart +++ b/lib/models/home/rcmd/result.dart @@ -1,3 +1,5 @@ +import 'package:pilipala/utils/id_utils.dart'; + class RecVideoItemAppModel { RecVideoItemAppModel({ this.id, @@ -50,14 +52,15 @@ class RecVideoItemAppModel { ? json['player_args']['aid'] : int.parse(json['param'] ?? '-1'); aid = json['player_args'] != null ? json['player_args']['aid'] : -1; - bvid = null; + bvid = json['player_args'] != null + ? IdUtils.av2bv(json['player_args']['aid']) + : ''; cid = json['player_args'] != null ? json['player_args']['cid'] : -1; pic = json['cover']; stat = RcmdStat.fromJson(json); // 改用player_args中的duration作为原始数据(秒数) - duration = json['player_args'] != null - ? json['player_args']['duration'] - : -1; + duration = + json['player_args'] != null ? json['player_args']['duration'] : -1; //duration = json['cover_right_text']; title = json['title']; owner = RcmdOwner.fromJson(json);