mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-10-25 20:03:44 +02:00
Bugfix in automatic source selection for URL input
This commit is contained in:
@@ -734,11 +734,15 @@ class SourceProvider {
|
|||||||
}
|
}
|
||||||
AppSource? source;
|
AppSource? source;
|
||||||
for (var s in sources.where((element) => element.hosts.isNotEmpty)) {
|
for (var s in sources.where((element) => element.hosts.isNotEmpty)) {
|
||||||
if (RegExp(
|
try {
|
||||||
'://${s.allowSubDomains ? '([^\\.]+\\.)*' : '(www\\.)?'}(${getSourceRegex(s.hosts)})(/|\\z)?')
|
if (RegExp(
|
||||||
.hasMatch(url)) {
|
'^${s.allowSubDomains ? '([^\\.]+\\.)*' : '(www\\.)?'}(${getSourceRegex(s.hosts)})\$')
|
||||||
source = s;
|
.hasMatch(Uri.parse(url).host)) {
|
||||||
break;
|
source = s;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// Ignore
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (source == null) {
|
if (source == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user