mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-08-10 17:10:15 +02:00
Jenkins uses release dates only + APK delete bugfix
This commit is contained in:
@@ -5,6 +5,10 @@ import 'package:obtainium/custom_errors.dart';
|
|||||||
import 'package:obtainium/providers/source_provider.dart';
|
import 'package:obtainium/providers/source_provider.dart';
|
||||||
|
|
||||||
class Jenkins extends AppSource {
|
class Jenkins extends AppSource {
|
||||||
|
Jenkins() {
|
||||||
|
overrideVersionDetectionFormDefault('releaseDateAsVersion', true);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String trimJobUrl(String url) {
|
String trimJobUrl(String url) {
|
||||||
RegExp standardUrlRegEx = RegExp('.*/job/[^/]+');
|
RegExp standardUrlRegEx = RegExp('.*/job/[^/]+');
|
||||||
|
@@ -166,7 +166,9 @@ class _AddAppPageState extends State<AddAppPage> {
|
|||||||
if (appsProvider.apps.containsKey(app.id)) {
|
if (appsProvider.apps.containsKey(app.id)) {
|
||||||
throw ObtainiumError(tr('appAlreadyAdded'));
|
throw ObtainiumError(tr('appAlreadyAdded'));
|
||||||
}
|
}
|
||||||
if (app.additionalSettings['trackOnly'] == true) {
|
if (app.additionalSettings['trackOnly'] == true ||
|
||||||
|
app.additionalSettings['versionDetection'] !=
|
||||||
|
'standardVersionDetection') {
|
||||||
app.installedVersion = app.latestVersion;
|
app.installedVersion = app.latestVersion;
|
||||||
}
|
}
|
||||||
app.categories = pickedCategories;
|
app.categories = pickedCategories;
|
||||||
|
@@ -212,7 +212,7 @@ class AppsProvider with ChangeNotifier {
|
|||||||
var fn = file.path.split('/').last;
|
var fn = file.path.split('/').last;
|
||||||
if (fn.startsWith('${app.id}-') &&
|
if (fn.startsWith('${app.id}-') &&
|
||||||
fn.endsWith('.apk') &&
|
fn.endsWith('.apk') &&
|
||||||
fn != fileName) {
|
fn != downloadedFile.path.split('/').last) {
|
||||||
file.delete();
|
file.delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -320,6 +320,22 @@ abstract class AppSource {
|
|||||||
name = runtimeType.toString();
|
name = runtimeType.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
overrideVersionDetectionFormDefault(String vd, bool disableStandard) {
|
||||||
|
additionalAppSpecificSourceAgnosticSettingFormItems =
|
||||||
|
additionalAppSpecificSourceAgnosticSettingFormItems.map((e) {
|
||||||
|
return e.map((e2) {
|
||||||
|
if (e2.key == 'versionDetection') {
|
||||||
|
var item = e2 as GeneratedFormDropdown;
|
||||||
|
item.defaultValue = vd;
|
||||||
|
if (disableStandard) {
|
||||||
|
item.disabledOptKeys = ['standardVersionDetection'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return e2;
|
||||||
|
}).toList();
|
||||||
|
}).toList();
|
||||||
|
}
|
||||||
|
|
||||||
String standardizeUrl(String url) {
|
String standardizeUrl(String url) {
|
||||||
url = preStandardizeUrl(url);
|
url = preStandardizeUrl(url);
|
||||||
if (!hostChanged) {
|
if (!hostChanged) {
|
||||||
@@ -342,7 +358,7 @@ abstract class AppSource {
|
|||||||
[];
|
[];
|
||||||
|
|
||||||
// Some additional data may be needed for Apps regardless of Source
|
// Some additional data may be needed for Apps regardless of Source
|
||||||
final List<List<GeneratedFormItem>>
|
List<List<GeneratedFormItem>>
|
||||||
additionalAppSpecificSourceAgnosticSettingFormItems = [
|
additionalAppSpecificSourceAgnosticSettingFormItems = [
|
||||||
[
|
[
|
||||||
GeneratedFormSwitch(
|
GeneratedFormSwitch(
|
||||||
|
Reference in New Issue
Block a user