Skip to content
This repository has been archived by the owner on Dec 28, 2024. It is now read-only.

Auto Updater check pre-release #26

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/main/kotlin/com/ratons/config/features/About.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.ratons.config.features;

import at.hannibal2.skyhanni.deps.moulconfig.annotations.ConfigEditorBoolean;
import at.hannibal2.skyhanni.deps.moulconfig.annotations.ConfigEditorDropdown;
import at.hannibal2.skyhanni.deps.moulconfig.annotations.ConfigOption;
import com.google.gson.annotations.Expose;
import com.ratons.features.misc.update.UpdateStream;

public class About {

Expand All @@ -11,6 +13,11 @@ public class About {
@ConfigEditorBoolean
public boolean autoUpdates = true;

@Expose
@ConfigOption(name = "Update Stream", desc = "Select the update stream.")
@ConfigEditorDropdown
public UpdateStream updateStream = UpdateStream.FULL;

@Expose
@ConfigOption(name = "Debug", desc = "Developer setting for checking debug messages.")
@ConfigEditorBoolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ object UpdateManager {
checkUpdate()
}

fun checkUpdate() {
activePromise = context.checkUpdate("full")
fun checkUpdate(stream: String = config.updateStream.streamName) {
activePromise = context.checkUpdate(stream)
.thenAcceptAsync({
potentialUpdate = it
if (it.isUpdateAvailable) {
Expand Down
11 changes: 11 additions & 0 deletions src/main/kotlin/com/ratons/features/misc/update/UpdateStream.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.ratons.features.misc.update

@Suppress("unused")
enum class UpdateStream(private val displayName: String, val streamName: String = "") {
NONE("None"),
PRERELEASE("Pre-release", "pre"),
FULL("Full", "full"),
;

override fun toString() = displayName
}
Loading