mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-28 03:58:39 +00:00
precheck video dimension
Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -95,6 +95,7 @@ class BiliDownloadEntryInfo with MultiSelectData {
|
||||
epId: ep?.episodeId,
|
||||
title: title,
|
||||
cover: cover,
|
||||
isVertical: pageData?.isVertical ?? false,
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -262,6 +263,8 @@ class PageInfo {
|
||||
|
||||
bool get cacheWidth => width <= height;
|
||||
|
||||
bool get isVertical => rotate == 1 ? width > height : height > width;
|
||||
|
||||
PageInfo({
|
||||
required this.cid,
|
||||
required this.page,
|
||||
|
||||
@@ -9,10 +9,21 @@ class Dimension {
|
||||
return null;
|
||||
}
|
||||
|
||||
bool get isVertical =>
|
||||
width != null && height != null ? height! > width! : false;
|
||||
|
||||
Dimension({this.width, this.height});
|
||||
|
||||
factory Dimension.fromJson(Map<String, dynamic> json) => Dimension(
|
||||
width: json['width'] as int?,
|
||||
height: json['height'] as int?,
|
||||
);
|
||||
Dimension.fromJson(Map<String, dynamic> json) {
|
||||
if (json['rotate'] == 1) {
|
||||
width = json['height'] as int?;
|
||||
height = json['width'] as int?;
|
||||
} else {
|
||||
width = json['width'] as int?;
|
||||
height = json['height'] as int?;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() => 'width: $width, height: $height';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user