mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
refa: article (#757)
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -204,22 +204,6 @@ class PiliScheme {
|
||||
}
|
||||
return false;
|
||||
case 'opus':
|
||||
// bilibili://opus/detail/12345678?h5awaken=random
|
||||
// String? id = uriDigitRegExp.firstMatch(path)?.group(1);
|
||||
// if (id != null) {
|
||||
// PageUtils.toDupNamed(
|
||||
// '/htmlRender',
|
||||
// parameters: {
|
||||
// 'url': 'https://www.bilibili.com/opus/$id',
|
||||
// 'title': '',
|
||||
// 'id': id,
|
||||
// 'dynamicType': 'opus'
|
||||
// },
|
||||
// off: off,
|
||||
// );
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
bool hasMatch = await _onPushDynDetail(path, off);
|
||||
return hasMatch;
|
||||
case 'search':
|
||||
@@ -234,12 +218,10 @@ class PiliScheme {
|
||||
String? id = uriDigitRegExp.firstMatch(path)?.group(1);
|
||||
if (id != null) {
|
||||
PageUtils.toDupNamed(
|
||||
'/htmlRender',
|
||||
'/articlePage',
|
||||
parameters: {
|
||||
'url': 'www.bilibili.com/read/cv$id',
|
||||
'title': '',
|
||||
'id': 'cv$id',
|
||||
'dynamicType': 'read'
|
||||
'id': id,
|
||||
'type': 'read',
|
||||
},
|
||||
off: off,
|
||||
);
|
||||
@@ -364,12 +346,10 @@ class PiliScheme {
|
||||
?.group(1);
|
||||
if (cvid != null) {
|
||||
PageUtils.toDupNamed(
|
||||
'/htmlRender',
|
||||
'/articlePage',
|
||||
parameters: {
|
||||
'url': 'https://www.bilibili.com/read/cv$cvid',
|
||||
'title': '',
|
||||
'id': 'cv$cvid',
|
||||
'dynamicType': 'read'
|
||||
'id': cvid,
|
||||
'type': 'read',
|
||||
},
|
||||
off: off,
|
||||
);
|
||||
@@ -581,12 +561,10 @@ class PiliScheme {
|
||||
?.group(1);
|
||||
if (id != null) {
|
||||
PageUtils.toDupNamed(
|
||||
'/htmlRender',
|
||||
'/articlePage',
|
||||
parameters: {
|
||||
'url': 'https://www.bilibili.com/read/cv$id',
|
||||
'title': '',
|
||||
'id': 'cv$id',
|
||||
'dynamicType': 'read'
|
||||
'id': id,
|
||||
'type': 'read',
|
||||
},
|
||||
off: off,
|
||||
);
|
||||
@@ -649,12 +627,10 @@ class PiliScheme {
|
||||
RegExp(r'cv(\d+)', caseSensitive: false).firstMatch(path)?.group(1);
|
||||
if (id != null) {
|
||||
PageUtils.toDupNamed(
|
||||
'/htmlRender',
|
||||
'/articlePage',
|
||||
parameters: {
|
||||
'url': 'https://www.bilibili.com/read/cv$id',
|
||||
'title': '',
|
||||
'id': 'cv$id',
|
||||
'dynamicType': 'read'
|
||||
'id': id,
|
||||
'type': 'read',
|
||||
},
|
||||
off: off,
|
||||
);
|
||||
|
||||
@@ -267,12 +267,13 @@ class PageUtils {
|
||||
DynamicItemModel data = res['data'];
|
||||
if (data.basic?['comment_type'] == 12) {
|
||||
toDupNamed(
|
||||
'/htmlRender',
|
||||
'/articlePage',
|
||||
parameters: {
|
||||
'url': 'www.bilibili.com/opus/$id',
|
||||
'title': '',
|
||||
'id': id,
|
||||
'dynamicType': 'opus'
|
||||
'type': 'opus',
|
||||
},
|
||||
arguments: {
|
||||
'item': data,
|
||||
},
|
||||
off: off,
|
||||
);
|
||||
@@ -398,20 +399,17 @@ class PageUtils {
|
||||
case 'DYNAMIC_TYPE_ARTICLE':
|
||||
String? url = item?.modules?.moduleDynamic?.major?.opus?.jumpUrl;
|
||||
if (url != null) {
|
||||
String? title = item?.modules?.moduleDynamic?.major?.opus?.title;
|
||||
if (url.contains('opus') || url.contains('read')) {
|
||||
RegExp digitRegExp = RegExp(r'\d+');
|
||||
Iterable<Match> matches = digitRegExp.allMatches(url);
|
||||
String number = matches.first.group(0)!;
|
||||
if (url.contains('read')) {
|
||||
number = 'cv$number';
|
||||
}
|
||||
toDupNamed('/htmlRender', parameters: {
|
||||
'url': url.startsWith('//') ? url.split('//').last : url,
|
||||
'title': title ?? '',
|
||||
'id': number,
|
||||
'dynamicType': url.split('//').last.split('/')[1]
|
||||
});
|
||||
toDupNamed(
|
||||
'/articlePage',
|
||||
parameters: {
|
||||
'id': number,
|
||||
'type': url.split('//').last.split('/')[1],
|
||||
},
|
||||
);
|
||||
} else {
|
||||
handleWebview('https:$url');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user