mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-08-15 03:18:09 +02:00
Made app ids unique
This commit is contained in:
@@ -23,6 +23,7 @@ class APKDetails {
|
|||||||
// App Source abstract class (diff. implementations for GitHub, GitLab, etc.)
|
// App Source abstract class (diff. implementations for GitHub, GitLab, etc.)
|
||||||
|
|
||||||
abstract class AppSource {
|
abstract class AppSource {
|
||||||
|
late String sourceId;
|
||||||
String standardizeURL(String url);
|
String standardizeURL(String url);
|
||||||
Future<APKDetails> getLatestAPKDetails(String standardUrl);
|
Future<APKDetails> getLatestAPKDetails(String standardUrl);
|
||||||
AppNames getAppNames(String standardUrl);
|
AppNames getAppNames(String standardUrl);
|
||||||
@@ -77,6 +78,9 @@ class App {
|
|||||||
// Specific App Source classes
|
// Specific App Source classes
|
||||||
|
|
||||||
class GitHub implements AppSource {
|
class GitHub implements AppSource {
|
||||||
|
@override
|
||||||
|
String sourceId = 'github';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String standardizeURL(String url) {
|
String standardizeURL(String url) {
|
||||||
RegExp standardUrlRegEx = RegExp(r'^https?://github.com/[^/]*/[^/]*');
|
RegExp standardUrlRegEx = RegExp(r'^https?://github.com/[^/]*/[^/]*');
|
||||||
@@ -148,7 +152,7 @@ class SourceService {
|
|||||||
AppNames names = source.getAppNames(standardUrl);
|
AppNames names = source.getAppNames(standardUrl);
|
||||||
APKDetails apk = await source.getLatestAPKDetails(standardUrl);
|
APKDetails apk = await source.getLatestAPKDetails(standardUrl);
|
||||||
return App(
|
return App(
|
||||||
'${names.author}_${names.name}',
|
'${names.author}_${names.name}_${source.sourceId}',
|
||||||
standardUrl,
|
standardUrl,
|
||||||
names.author[0].toUpperCase() + names.author.substring(1),
|
names.author[0].toUpperCase() + names.author.substring(1),
|
||||||
names.name[0].toUpperCase() + names.name.substring(1),
|
names.name[0].toUpperCase() + names.name.substring(1),
|
||||||
|
Reference in New Issue
Block a user