Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-01-24 18:07:08 +08:00
parent 68872f7b14
commit e9b5cffa91
18 changed files with 326 additions and 366 deletions

View File

@@ -332,9 +332,7 @@ class _DownloadPanelState extends State<DownloadPanel> {
int? cid;
String? cover;
int? width;
int? height;
bool cacheWidth = false;
bool? cacheWidth;
switch (episode) {
case Part part:
@@ -343,10 +341,7 @@ class _DownloadPanelState extends State<DownloadPanel> {
title = part.part ?? widget.videoDetail!.title!;
duration = part.duration;
pubdate = part.ctime;
if (part.dimension case final dimension?) {
width = dimension.width;
height = dimension.height;
}
cacheWidth = part.dimension?.cacheWidth;
break;
case ugc.EpisodeItem item:
cid = item.cid;
@@ -359,10 +354,7 @@ class _DownloadPanelState extends State<DownloadPanel> {
view = stat.view;
danmaku = stat.danmaku;
}
if (arc.dimension case final dimension?) {
width = dimension.width;
height = dimension.height;
}
cacheWidth = arc.dimension?.cacheWidth;
}
if (item.attribute == 8) {
isCharging = true;
@@ -379,15 +371,9 @@ class _DownloadPanelState extends State<DownloadPanel> {
duration = item.duration == null ? null : item.duration! ~/ 1000;
}
pubdate = item.pubTime;
if (item.dimension case final dimension?) {
width = dimension.width;
height = dimension.height;
}
cacheWidth = item.dimension?.cacheWidth;
break;
}
if (width != null && height != null) {
cacheWidth = width <= height;
}
late final primary = theme.colorScheme.primary;
return Padding(