Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c3e94c1f authored by Sayantan Roychowdhury's avatar Sayantan Roychowdhury
Browse files

allow setting size from gitlab releases. else set a RANDOM_SIZE = 1L

parent e27d05d9
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -32,11 +32,14 @@ data class SystemAppInfo(
    @Json(name = "min_sdk") val minSdk: Int,
    @Json(name = "version_name") val versionName: String,
    @Json(name = "url") val downloadUrl: String,
    @Json(name = "size") val size: Long?,
    val priority: Boolean?,
    @Json(name = "blacklisted_android") val blacklistedAndroid: List<Int>?,
    @Json(name = "blacklisted_devices") val blacklistedDevices: List<String>?,
)

private const val RANDOM_SIZE = 1L

fun SystemAppInfo.toApplication(): Application {
    return Application(
        _id = UUID.randomUUID().toString(),
@@ -47,7 +50,7 @@ fun SystemAppInfo.toApplication(): Application {
        name = name,
        package_name = packageName,
        origin = Origin.GITLAB_RELEASES,
        originalSize = 1, // so that the app is not filtered out,
        originalSize = size ?: RANDOM_SIZE,
        url = downloadUrl,
        isSystemApp = true,
        filterLevel = FilterLevel.NONE,