From 7700e0bd2f24c8a5e553e211a5ec91ce7cd2c555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Font=C3=A1n?= Date: Fri, 29 Dec 2023 13:43:49 +0100 Subject: [PATCH] Deleted Spotify mods downloader --- .../bobbyesp/spowlo/ui/pages/InitialEntry.kt | 15 ----------- .../ui/pages/downloader/DownloaderPage.kt | 26 ++++++++++++++++++- app/src/main/res/values/strings.xml | 1 + 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/com/bobbyesp/spowlo/ui/pages/InitialEntry.kt b/app/src/main/java/com/bobbyesp/spowlo/ui/pages/InitialEntry.kt index 610053d6..626846e9 100644 --- a/app/src/main/java/com/bobbyesp/spowlo/ui/pages/InitialEntry.kt +++ b/app/src/main/java/com/bobbyesp/spowlo/ui/pages/InitialEntry.kt @@ -523,21 +523,6 @@ fun InitialEntry( } } - LaunchedEffect(true) { - Log.d(TAG, "InitialEntry: Checking for mod updates") - if (PreferencesUtil.isNetworkAvailable()) { - val apiResult = ModsDownloaderAPIService.create().getAPIResponse() - if (apiResult.isSuccess) { - val apiResponse = apiResult.getOrNull() - if (apiResponse != null) { - modsDownloaderViewModel.updateApiResponse(apiResponse) - } - } else { - ToastUtil.makeToast(context.getString(R.string.api_call_failed)) - } - } - } - // LaunchedEffect(Unit) { // if (SPOTDL.getString().isNotEmpty()) return@LaunchedEffect // kotlin.runCatching { diff --git a/app/src/main/java/com/bobbyesp/spowlo/ui/pages/downloader/DownloaderPage.kt b/app/src/main/java/com/bobbyesp/spowlo/ui/pages/downloader/DownloaderPage.kt index 7629aee7..463f658f 100644 --- a/app/src/main/java/com/bobbyesp/spowlo/ui/pages/downloader/DownloaderPage.kt +++ b/app/src/main/java/com/bobbyesp/spowlo/ui/pages/downloader/DownloaderPage.kt @@ -29,6 +29,7 @@ import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.foundation.verticalScroll import androidx.compose.material.ContentAlpha import androidx.compose.material.ExperimentalMaterialApi +import androidx.compose.material.TextButton import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.FormatListBulleted import androidx.compose.material.icons.filled.LibraryMusic @@ -85,6 +86,7 @@ import com.bobbyesp.spowlo.ui.common.LocalWindowWidthState import com.bobbyesp.spowlo.ui.components.ClearButton import com.bobbyesp.spowlo.ui.components.ConsoleOutputComponent import com.bobbyesp.spowlo.ui.components.NavigationBarSpacer +import com.bobbyesp.spowlo.ui.components.SpowloDialog import com.bobbyesp.spowlo.ui.components.songs.SongCard import com.bobbyesp.spowlo.ui.dialogs.DownloaderSettingsDialog import com.bobbyesp.spowlo.ui.pages.settings.about.LocalAsset @@ -134,6 +136,8 @@ fun DownloaderPage( val useDialog = LocalWindowWidthState.current != WindowWidthSizeClass.Compact + val (showModsBannedDialog, updateShowModsBannedDialog) = remember { mutableStateOf(false) } + val clipboardManager = LocalClipboardManager.current val keyboardController = LocalSoftwareKeyboardController.current @@ -181,7 +185,9 @@ fun DownloaderPage( keyboardController?.hide() }, navigateToDownloads = navigateToDownloads, - navigateToMods = navigateToMods, + navigateToMods = { + updateShowModsBannedDialog(!showModsBannedDialog) + }, onSongCardClicked = { onSongCardClicked() }, showOutput = showConsoleOutput, showSongCard = true, @@ -207,6 +213,24 @@ fun DownloaderPage( hide = { downloaderViewModel.hideDialog(scope, useDialog) }) } } + + if(showModsBannedDialog) { + SpowloDialog( + title = { + Text(text = stringResource(id = R.string.mods_downloader)) + }, + text = { + Text(text = stringResource(id = R.string.mods_downloader_banned)) + }, + onDismissRequest = { updateShowModsBannedDialog(false) }, + confirmButton = { + TextButton(onClick = { updateShowModsBannedDialog(false) }) { + Text(text = stringResource(id = R.string.agree)) + } + } + ) + } + } @OptIn( diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index fdc2dc2d..b9b2d46f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -341,4 +341,5 @@ Make the downloader split your downloads folder into folders with the name of the playlist Split by main artist The downloader splits you downloads depending on the main artist of the song + The mods downloader has been deleted since Firebase (a Google hosting service) has disabled APKs downloading in the free version of the same. Please, consider using xManager as an alternative. \ No newline at end of file