Skip to content

Commit

Permalink
fix(youtube/downloads): rename patch to external-downloads (#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
LisoUseInAIKyrios authored May 26, 2023
1 parent b1f73d7 commit b7234ae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

public enum SettingsEnum {
// External downloader
EXTERNAL_DOWNLOADER("revanced_external_downloader", BOOLEAN, TRUE),
EXTERNAL_DOWNLOADER("revanced_external_downloader", BOOLEAN, FALSE),
EXTERNAL_DOWNLOADER_PACKAGE_NAME("revanced_external_downloader_name", STRING,
"org.schabi.newpipe" /* NewPipe */, parents(EXTERNAL_DOWNLOADER)),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
import app.revanced.integrations.utils.ReVancedUtils;
import app.revanced.integrations.utils.StringRef;

public class DownloadButton extends BottomControlButton {
public class ExternalDownloadButton extends BottomControlButton {
@Nullable
private static DownloadButton instance;
private static ExternalDownloadButton instance;

public DownloadButton(ViewGroup viewGroup) {
public ExternalDownloadButton(ViewGroup viewGroup) {
super(
viewGroup,
"download_button",
"external_download_button",
SettingsEnum.EXTERNAL_DOWNLOADER,
DownloadButton::onDownloadClick,
ExternalDownloadButton::onDownloadClick,
null
);
}
Expand All @@ -32,7 +32,7 @@ public DownloadButton(ViewGroup viewGroup) {
*/
public static void initializeButton(View view) {
try {
instance = new DownloadButton((ViewGroup) view);
instance = new ExternalDownloadButton((ViewGroup) view);
} catch (Exception ex) {
LogHelper.printException(() -> "initializeButton failure", ex);
}
Expand All @@ -46,7 +46,7 @@ public static void changeVisibility(boolean showing) {
}

private static void onDownloadClick(View view) {
LogHelper.printDebug(() -> "Download button clicked");
LogHelper.printDebug(() -> "External download button clicked");

final var context = view.getContext();
var downloaderPackageName = SettingsEnum.EXTERNAL_DOWNLOADER_PACKAGE_NAME.getString();
Expand All @@ -55,12 +55,12 @@ private static void onDownloadClick(View view) {
try {
packageEnabled = context.getPackageManager().getApplicationInfo(downloaderPackageName, 0).enabled;
} catch (PackageManager.NameNotFoundException error) {
LogHelper.printDebug(() -> "Downloader could not be found: " + error);
LogHelper.printDebug(() -> "External downloader could not be found: " + error);
}

// If the package is not installed, show the toast
if (!packageEnabled) {
ReVancedUtils.showToastLong(downloaderPackageName + " " + StringRef.str("downloader_not_installed_warning"));
ReVancedUtils.showToastLong(downloaderPackageName + " " + StringRef.str("external_downloader_not_installed_warning"));
return;
}

Expand Down

0 comments on commit b7234ae

Please sign in to comment.