pull/1350/head
deniscerri 2 weeks ago
parent 85fc230e32
commit 53292a2149
No known key found for this signature in database
GPG Key ID: 95C43D517D830350

@ -68,7 +68,7 @@ class BgUtilsPoTokenGeneratorService : Service() {
runtimeManager.destroyProcessById(currentRunningProcess)
stopForeground(STOP_FOREGROUND_REMOVE)
stopSelf()
return super.onStartCommand(intent, flags, startId)
return START_NOT_STICKY
}
serviceScope.launch {

@ -118,33 +118,49 @@ class GenerateYoutubePoTokensFragment : Fragment() {
} else {
val builder = MaterialAlertDialogBuilder(context)
builder.setTitle("BgUtils POT Provider")
builder.setMessage(getString(R.string.please_wait))
builder.setCancelable(false)
val dialog = builder.create()
dialog.show()
lifecycleScope.launch {
val resp = withContext(Dispatchers.IO) {
BgUtilsPoTokenGeneratorUtil.runServer(context) { progress ->
lifecycleScope.launch {
withContext(Dispatchers.Main) {
dialog.setMessage(progress)
builder.setMessage(getString(R.string.bgutils_pot_generation_script_info))
builder.setPositiveButton(R.string.ok) { di: DialogInterface?, _: Int ->
di?.dismiss()
val builder = MaterialAlertDialogBuilder(context)
builder.setTitle("BgUtils POT Provider")
builder.setMessage(getString(R.string.please_wait))
builder.setCancelable(false)
val dialog = builder.create()
dialog.show()
lifecycleScope.launch {
val resp = withContext(Dispatchers.IO) {
BgUtilsPoTokenGeneratorUtil.runServer(context) { progress ->
lifecycleScope.launch {
withContext(Dispatchers.Main) {
dialog.setMessage(progress)
}
}
}
}
}
resp.onSuccess {
dialog.dismiss()
}
resp.onFailure { error ->
dialog.dismiss()
view?.apply {
Snackbar.make(this, error.message ?: "", Snackbar.LENGTH_LONG).show()
resp.onSuccess {
dialog.dismiss()
}
resp.onFailure { error ->
dialog.dismiss()
view?.apply {
Snackbar.make(this, error.message ?: "", Snackbar.LENGTH_LONG).show()
}
}
}
}
builder.setNegativeButton(getString(R.string.cancel)) { dialogInterface: DialogInterface, _: Int ->
this.isChecked = false
updateState()
dialogInterface.cancel()
}
val dialog = builder.create()
dialog.show()
}
}

@ -581,6 +581,7 @@
<string name="external">External</string>
<string name="exit">Exit</string>
<string name="packages_description">Packages are helper applications YTDLnis uses to help with yt-dlp commands. Some of them are already bundled, but you can install newer versions that are published without the need to update the app. The installed apk\'s replace the bundled version that the app uses.</string>
<string name="bgutils_pot_generation_script_info">In order to use the BgUtils POT Provider, the app needs to download Brainicism/bgutil-ytdlp-pot-provider repo from github and initiate the installation. This might take a while to finish. Proceed now?</string>
<plurals name="every_hours"><item quantity="one">Every hour</item><item quantity="other">Every %d hours</item></plurals>
<plurals name="every_days"><item quantity="one">Every day</item><item quantity="other">Every %d days</item></plurals>
<plurals name="every_weeks"><item quantity="one">Every week</item><item quantity="other">Every %d weeks</item></plurals>

Loading…
Cancel
Save