From 8d53b07167a5aa2d4ded8b1a9875c1ee19be0ce8 Mon Sep 17 00:00:00 2001 From: kapodamy Date: Sun, 29 Dec 2019 17:56:32 -0300 Subject: [PATCH] fixup * [DownloadDialog.java] use *.opus extension instead of *.webm (bad change from https://github.com/TeamNewPipe/NewPipe/pull/2679/commits/844f80a5f1b0762a043afd2b4aec63b402830e53) * [StreamItemAdapter.java] show "opus" in format label instead of "WebM Opus" --- .../org/schabi/newpipe/download/DownloadDialog.java | 12 ++++++++++-- .../org/schabi/newpipe/util/StreamItemAdapter.java | 10 +++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java b/app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java index 4fbf4ab5f..853bb6d68 100644 --- a/app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java +++ b/app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java @@ -559,8 +559,16 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck case R.id.audio_button: mainStorage = mainStorageAudio; format = audioStreamsAdapter.getItem(selectedAudioIndex).getFormat(); - mime = format.mimeType; - filename += format.suffix; + switch(format) { + case WEBMA_OPUS: + mime = "audio/ogg"; + filename += "opus"; + break; + default: + mime = format.mimeType; + filename += format.suffix; + break; + } break; case R.id.video_button: mainStorage = mainStorageVideo; diff --git a/app/src/main/java/org/schabi/newpipe/util/StreamItemAdapter.java b/app/src/main/java/org/schabi/newpipe/util/StreamItemAdapter.java index 312c47263..cb2fae4f0 100644 --- a/app/src/main/java/org/schabi/newpipe/util/StreamItemAdapter.java +++ b/app/src/main/java/org/schabi/newpipe/util/StreamItemAdapter.java @@ -140,7 +140,15 @@ public class StreamItemAdapter extends BaseA if (stream instanceof SubtitlesStream) { formatNameView.setText(((SubtitlesStream) stream).getLanguageTag()); } else { - formatNameView.setText(stream.getFormat().getName()); + switch (stream.getFormat()) { + case WEBMA_OPUS: + // noinspection AndroidLintSetTextI18n + formatNameView.setText("opus"); + break; + default: + formatNameView.setText(stream.getFormat().getName()); + break; + } } qualityView.setText(qualityString);