mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-07 01:39:18 +08:00
* opt: danmaku weight
* opt: cache clean
* opt: level img
* opt: play icon
* opt: svg big-vip
* opt: webview ua
* opt: simple dialog
* feat: export vtt
* tweak
* opt: mapIndexed
* feat: more subtitle
* refa: settings page
* feat: codec list options
* drawPath
Signed-off-by: dom <githubaccount56556@proton.me>
* custom dialog option
Signed-off-by: dom <githubaccount56556@proton.me>
* update
Signed-off-by: dom <githubaccount56556@proton.me>
* Revert "drawPath"
This reverts commit e8a4b19f0f.
* opt: _initStreamIndex
* fix: avoid gap
* fix: scale [skip ci]
* fix: hide repost menu not login
* tweaks
Signed-off-by: dom <githubaccount56556@proton.me>
---------
Co-authored-by: dom <githubaccount56556@proton.me>
32 lines
780 B
Dart
32 lines
780 B
Dart
class Subtitle implements Comparable<Subtitle> {
|
||
late String lan;
|
||
String? lanDoc;
|
||
String? subtitleUrl;
|
||
String? subtitleUrlV2;
|
||
bool isAi = false;
|
||
|
||
Subtitle({
|
||
required this.lan,
|
||
this.lanDoc,
|
||
this.subtitleUrl,
|
||
this.isAi = false,
|
||
});
|
||
|
||
Subtitle.fromJson(Map<String, dynamic> json) {
|
||
lan = json["lan"];
|
||
isAi = json["type"] == 1;
|
||
lanDoc = '${json["lan_doc"]}${isAi ? '(AI)' : ''}';
|
||
subtitleUrl = json["subtitle_url"];
|
||
subtitleUrlV2 = json["subtitle_url_v2"];
|
||
}
|
||
|
||
@override
|
||
int compareTo(Subtitle other) {
|
||
final thisHasZh = lan.contains('zh');
|
||
final otherHasZh = other.lan.contains('zh');
|
||
if (thisHasZh != otherHasZh) return thisHasZh ? -1 : 1;
|
||
if (isAi != other.isAi) return isAi ? 1 : -1;
|
||
return 0;
|
||
}
|
||
}
|