fix(YouTube): External downloader was not selectable
This commit is contained in:
parent
d0ab25e06d
commit
6752d2a813
2 changed files with 18 additions and 13 deletions
|
|
@ -215,10 +215,8 @@ public class Settings extends BaseSettings {
|
|||
"revanced_queue_manager_user_dialog_message", parent(OVERRIDE_VIDEO_DOWNLOAD_BUTTON));
|
||||
public static final StringSetting EXTERNAL_DOWNLOADER_PACKAGE_NAME_PLAYLIST = new StringSetting("revanced_external_downloader_package_name_playlist", "com.deniscerri.ytdl",
|
||||
parent(OVERRIDE_PLAYLIST_DOWNLOAD_BUTTON));
|
||||
public static final StringSetting EXTERNAL_DOWNLOADER_PACKAGE_NAME_VIDEO = new StringSetting("revanced_external_downloader_package_name_video", "com.deniscerri.ytdl",
|
||||
parent(OVERRIDE_VIDEO_DOWNLOAD_BUTTON));
|
||||
public static final StringSetting EXTERNAL_DOWNLOADER_PACKAGE_NAME_VIDEO_LONG_PRESS = new StringSetting("revanced_external_downloader_package_name_video_long_press", "com.junkfood.seal",
|
||||
parent(OVERRIDE_VIDEO_DOWNLOAD_BUTTON));
|
||||
public static final StringSetting EXTERNAL_DOWNLOADER_PACKAGE_NAME_VIDEO = new StringSetting("revanced_external_downloader_package_name_video", "com.deniscerri.ytdl");
|
||||
public static final StringSetting EXTERNAL_DOWNLOADER_PACKAGE_NAME_VIDEO_LONG_PRESS = new StringSetting("revanced_external_downloader_package_name_video_long_press", "com.junkfood.seal");
|
||||
public static final BooleanSetting OVERRIDE_YOUTUBE_MUSIC_BUTTON = new BooleanSetting("revanced_override_youtube_music_button", FALSE, true);
|
||||
public static final StringSetting THIRD_PARTY_YOUTUBE_MUSIC_PACKAGE_NAME = new StringSetting("revanced_third_party_youtube_music_package_name", PackageNameYouTubeMusic(), true
|
||||
, new YouTubeMusicActionsPatch.HookYouTubeMusicPackageNameAvailability());
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ import java.util.Objects;
|
|||
import java.util.function.Function;
|
||||
|
||||
import app.revanced.extension.shared.settings.StringSetting;
|
||||
import app.revanced.extension.shared.utils.Logger;
|
||||
import app.revanced.extension.shared.utils.Utils;
|
||||
import app.revanced.extension.shared.settings.preference.CustomDialogListPreference;
|
||||
import app.revanced.extension.shared.ui.CustomDialog;
|
||||
import app.revanced.extension.shared.utils.Logger;
|
||||
import app.revanced.extension.shared.utils.Utils;
|
||||
import app.revanced.extension.youtube.settings.Settings;
|
||||
import app.revanced.extension.youtube.utils.ThemeUtils;
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ import app.revanced.extension.youtube.utils.ThemeUtils;
|
|||
*/
|
||||
@SuppressWarnings({"unused", "deprecation"})
|
||||
public class ExternalDownloaderVideoLongPressPreference extends CustomDialogListPreference {
|
||||
private static final StringSetting settings = Settings.EXTERNAL_DOWNLOADER_PACKAGE_NAME_PLAYLIST;
|
||||
private static final StringSetting settings = Settings.EXTERNAL_DOWNLOADER_PACKAGE_NAME_VIDEO_LONG_PRESS;
|
||||
|
||||
/**
|
||||
* Enum representing supported external downloaders with their display names, package names, and download URLs.
|
||||
|
|
@ -54,7 +54,8 @@ public class ExternalDownloaderVideoLongPressPreference extends CustomDialogList
|
|||
private enum Downloader {
|
||||
YTDLNIS("YTDLnis",
|
||||
"com.deniscerri.ytdl",
|
||||
"https://ytdlnis.org"),
|
||||
"https://ytdlnis.org",
|
||||
true),
|
||||
SEAL("Seal",
|
||||
"com.junkfood.seal",
|
||||
"https://github.com/JunkFood02/Seal/releases/latest",
|
||||
|
|
@ -92,6 +93,7 @@ public class ExternalDownloaderVideoLongPressPreference extends CustomDialogList
|
|||
|
||||
/**
|
||||
* Finds a Downloader by its package name. This method can never return {@link #OTHER}.
|
||||
*
|
||||
* @return The Downloader enum or null if not found.
|
||||
*/
|
||||
@Nullable
|
||||
|
|
@ -283,10 +285,12 @@ public class ExternalDownloaderVideoLongPressPreference extends CustomDialogList
|
|||
editText.setEnabled(usingCustomDownloader);
|
||||
editText.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {}
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable edit) {
|
||||
|
|
@ -321,7 +325,8 @@ public class ExternalDownloaderVideoLongPressPreference extends CustomDialogList
|
|||
str("revanced_external_downloader_empty_warning"),
|
||||
null,
|
||||
null,
|
||||
() -> {}, // OK button does nothing (dismiss only).
|
||||
() -> {
|
||||
}, // OK button does nothing (dismiss only).
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
|
|
@ -339,7 +344,8 @@ public class ExternalDownloaderVideoLongPressPreference extends CustomDialogList
|
|||
setValue(newValue);
|
||||
}
|
||||
},
|
||||
() -> {}, // Cancel button action (dismiss only).
|
||||
() -> {
|
||||
}, // Cancel button action (dismiss only).
|
||||
str("revanced_settings_reset"),
|
||||
() -> { // Reset action.
|
||||
String defaultValue = settings.defaultValue;
|
||||
|
|
@ -436,7 +442,8 @@ public class ExternalDownloaderVideoLongPressPreference extends CustomDialogList
|
|||
Logger.printException(() -> "Failed to open downloader URL: " + downloader, ex);
|
||||
}
|
||||
},
|
||||
() -> {}, // Cancel button action (dismiss only).
|
||||
() -> {
|
||||
}, // Cancel button action (dismiss only).
|
||||
null,
|
||||
null,
|
||||
false
|
||||
|
|
|
|||
Loading…
Reference in a new issue