Skip to content

Commit

Permalink
Add settings to select a format
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanLobbenmeier committed Jan 7, 2025
1 parent 288627f commit e704352
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ data class Settings(
val cookiesFromBrowser: String?,
val cookiesFile: String?,

// Format
val selectVideo: Boolean = true,
val selectAudio: Boolean = true,
val preferFreeFormats: Boolean = false,
val sortFormats: String?,

// Output
val mergeOutputFormat: String?,
val remuxFormat: String?,
Expand Down
27 changes: 27 additions & 0 deletions src/main/kotlin/de/lobbenmeier/stefan/settings/ui/SettingsUI.kt
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,33 @@ fun SettingsUI(settings: Settings, save: (Settings) -> Unit, cancel: () -> Unit)
)
}

Section("Formats") {
BooleanInput("Select best Video by default", mutableSettings.selectVideo) {
mutableSettings = mutableSettings.copy(selectVideo = it)
}
BooleanInput("Select best Audio by default", mutableSettings.selectAudio) {
mutableSettings = mutableSettings.copy(selectAudio = it)
}
BooleanInput(
"Prefer free formats (ogg, opus, webm)",
mutableSettings.preferFreeFormats
) {
mutableSettings = mutableSettings.copy(preferFreeFormats = it)
}
ChoiceInput(
"Sort formats",
mutableSettings.sortFormats,
onValueChange = { mutableSettings = settings.copy(sortFormats = it) },
options =
listOf(
"res:1080",
"res:720",
"res:480",
"res:360",
)
)
}

Section("Output") {
TextInput(
"Merge Output Format (Fast)",
Expand Down

0 comments on commit e704352

Please sign in to comment.