VideoDownloader fix
This commit is contained in:
@@ -40,7 +40,7 @@ public class VideoDownloader{
|
||||
downloadVideo(video, ctx);
|
||||
return true;
|
||||
} else if (id == OPEN_EXTERNAL_LINK_ID) {
|
||||
ExternalLinkHandler.parseVideoFile(video, ctx);
|
||||
ExternalLinkHandler.parseVideoFile(video, ctx, true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -48,8 +48,7 @@ public class VideoDownloader{
|
||||
public static void injectAction(ArrayList<MenuBottomSheetAction> list, VideoFile video){
|
||||
if (!video.U && !video.I1()) {
|
||||
addAction(list, DOWNLOAD_ID, R.drawable.ic_download_outline_24, R.string.download, 9);
|
||||
if (Preferences.isEnableExternalOpening())
|
||||
addAction(list, OPEN_EXTERNAL_LINK_ID, R.drawable.ic_link_outline_28, getIdentifier("interfacevideoext", "string"), 9);
|
||||
addAction(list, OPEN_EXTERNAL_LINK_ID, R.drawable.ic_link_outline_28, getIdentifier("interfacevideoext", "string"), 9);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,10 +31,10 @@ public class ExternalLinkHandler{
|
||||
private static final Map<String, String> qualities = new HashMap<>();
|
||||
|
||||
public static boolean parseVideoFile(VideoFile file) {
|
||||
return parseVideoFile(file, getContext());
|
||||
return parseVideoFile(file, getContext(), isEnableExternalOpening());
|
||||
}
|
||||
|
||||
public static boolean parseVideoFile(VideoFile file, Context context) {
|
||||
public static boolean parseVideoFile(VideoFile file, Context context, Boolean isEnabled) {
|
||||
if (checkYoutubeLink(file)) {
|
||||
try {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
@@ -47,7 +47,7 @@ public class ExternalLinkHandler{
|
||||
}
|
||||
}
|
||||
|
||||
if (!isEnableExternalOpening()) return false;
|
||||
if (!isEnabled) return false;
|
||||
|
||||
if (checkVkVideo(file)) {
|
||||
if (qualities.size() == 1) {
|
||||
|
||||
Reference in New Issue
Block a user