Skip to content

Commit

Permalink
fix: import json config fail(miss type)
Browse files Browse the repository at this point in the history
  • Loading branch information
d1y committed Jun 5, 2023
1 parent c15b4db commit 93d8196
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/mirror/m_utils/source_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,15 @@ class SourceUtils {

/// => zy-player 源
if (id != null) {
var url = Uri.tryParse(api);
Uri? url;
if (api is String) {
url = Uri.parse(api);
} else if (api is Map<String, dynamic>) {
url = Uri.parse(api['root'] + api['path']);
}
if (url == null) return [false, null];

/// FIXME: 不严谨的判断条件
var ifNext = hasName && (url.path.isNotEmpty && url.origin.isNotEmpty);

if (ifNext) {
if (hasName) {
bool isNsfw = (rawData['group'] ?? "") == "18禁";
var data = SourceJsonData(
name: name,
Expand Down

0 comments on commit 93d8196

Please sign in to comment.