From 67c0ceedc9833f2c495dfe78e4bc0d80a9b2fd18 Mon Sep 17 00:00:00 2001 From: camo0112 <56369484+camo0112@users.noreply.github.com> Date: Tue, 20 Apr 2021 13:06:40 +0530 Subject: [PATCH 01/72] Error handling in subscribe() in DownloadDialog --- .../newpipe/download/DownloadDialog.java | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 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 4d3726c38..6d9f727a1 100644 --- a/app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java +++ b/app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java @@ -312,25 +312,27 @@ public class DownloadDialog extends DialogFragment private void fetchStreamsSize() { disposables.clear(); - disposables.add(StreamSizeWrapper.fetchSizeForWrapper(wrappedVideoStreams) .subscribe(result -> { - if (dialogBinding.videoAudioGroup.getCheckedRadioButtonId() == R.id.video_button) { - setupVideoSpinner(); - } - })); + if (dialogBinding.videoAudioGroup.getCheckedRadioButtonId() + == R.id.video_button) { + setupVideoSpinner(); + } + }, throwable -> Log.e(TAG, "Throwable " + throwable.getMessage()))); disposables.add(StreamSizeWrapper.fetchSizeForWrapper(wrappedAudioStreams) .subscribe(result -> { - if (dialogBinding.videoAudioGroup.getCheckedRadioButtonId() == R.id.audio_button) { - setupAudioSpinner(); - } - })); + if (dialogBinding.videoAudioGroup.getCheckedRadioButtonId() + == R.id.audio_button) { + setupAudioSpinner(); + } + }, throwable -> Log.e(TAG, "Throwable " + throwable.getMessage()))); disposables.add(StreamSizeWrapper.fetchSizeForWrapper(wrappedSubtitleStreams) .subscribe(result -> { - if (dialogBinding.videoAudioGroup.getCheckedRadioButtonId() == R.id.subtitle_button) { - setupSubtitleSpinner(); - } - })); + if (dialogBinding.videoAudioGroup.getCheckedRadioButtonId() + == R.id.subtitle_button) { + setupSubtitleSpinner(); + } + }, throwable -> Log.e(TAG, "Throwable " + throwable.getMessage()))); } @Override From 4357e02c58d0bb136bd260fa321a34e4dc64aee1 Mon Sep 17 00:00:00 2001 From: camo0112 <56369484+camo0112@users.noreply.github.com> Date: Tue, 20 Apr 2021 16:21:20 +0530 Subject: [PATCH 02/72] user can report the error --- .../schabi/newpipe/download/DownloadDialog.java | 15 ++++++++++++--- 1 file changed, 12 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 6d9f727a1..00fe63da3 100644 --- a/app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java +++ b/app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java @@ -318,21 +318,30 @@ public class DownloadDialog extends DialogFragment == R.id.video_button) { setupVideoSpinner(); } - }, throwable -> Log.e(TAG, "Throwable " + throwable.getMessage()))); + }, throwable -> ErrorActivity.reportErrorInSnackbar(context, + new ErrorInfo(throwable, UserAction.DOWNLOAD_OPEN_DIALOG, + "Downloading video stream size", + currentInfo.getServiceId())))); disposables.add(StreamSizeWrapper.fetchSizeForWrapper(wrappedAudioStreams) .subscribe(result -> { if (dialogBinding.videoAudioGroup.getCheckedRadioButtonId() == R.id.audio_button) { setupAudioSpinner(); } - }, throwable -> Log.e(TAG, "Throwable " + throwable.getMessage()))); + }, throwable -> ErrorActivity.reportErrorInSnackbar(context, + new ErrorInfo(throwable, UserAction.DOWNLOAD_OPEN_DIALOG, + "Downloading audio stream size", + currentInfo.getServiceId())))); disposables.add(StreamSizeWrapper.fetchSizeForWrapper(wrappedSubtitleStreams) .subscribe(result -> { if (dialogBinding.videoAudioGroup.getCheckedRadioButtonId() == R.id.subtitle_button) { setupSubtitleSpinner(); } - }, throwable -> Log.e(TAG, "Throwable " + throwable.getMessage()))); + }, throwable -> ErrorActivity.reportErrorInSnackbar(context, + new ErrorInfo(throwable, UserAction.DOWNLOAD_OPEN_DIALOG, + "Downloading subtitle stream size", + currentInfo.getServiceId())))); } @Override From a012e26d635153a012fce067df200cc50d02ab5e Mon Sep 17 00:00:00 2001 From: evermind Date: Wed, 5 May 2021 08:55:54 +0200 Subject: [PATCH 03/72] =?UTF-8?q?fix=20Rotation=20crash=20on=20=E2=80=9EVi?= =?UTF-8?q?deo=20not=20available=E2=80=9C=20page=20(#5941)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The EmptyFragment should not have a constructor at all. Now a static methods creates the Fragment and arguments are handled via a Bundle. --- .../org/schabi/newpipe/fragments/EmptyFragment.java | 11 ++++++++--- .../newpipe/fragments/detail/VideoDetailFragment.java | 6 +++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/EmptyFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/EmptyFragment.java index fbf2711bc..d4e73bcac 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/EmptyFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/EmptyFragment.java @@ -11,15 +11,20 @@ import org.schabi.newpipe.BaseFragment; import org.schabi.newpipe.R; public class EmptyFragment extends BaseFragment { - final boolean showMessage; + private static final String SHOW_MESSAGE = "SHOW_MESSAGE"; - public EmptyFragment(final boolean showMessage) { - this.showMessage = showMessage; + public static final EmptyFragment newInstance(final boolean showMessage) { + final EmptyFragment emptyFragment = new EmptyFragment(); + final Bundle bundle = new Bundle(1); + bundle.putBoolean(SHOW_MESSAGE, showMessage); + emptyFragment.setArguments(bundle); + return emptyFragment; } @Override public View onCreateView(final LayoutInflater inflater, @Nullable final ViewGroup container, final Bundle savedInstanceState) { + final boolean showMessage = getArguments().getBoolean(SHOW_MESSAGE); final View view = inflater.inflate(R.layout.fragment_empty, container, false); view.findViewById(R.id.empty_state_view).setVisibility( showMessage ? View.VISIBLE : View.GONE); diff --git a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java index 71739ba3d..784a1c3be 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java @@ -929,20 +929,20 @@ public final class VideoDetailFragment if (showRelatedItems && binding.relatedItemsLayout == null) { // temp empty fragment. will be updated in handleResult - pageAdapter.addFragment(new EmptyFragment(false), RELATED_TAB_TAG); + pageAdapter.addFragment(EmptyFragment.newInstance(false), RELATED_TAB_TAG); tabIcons.add(R.drawable.ic_art_track); tabContentDescriptions.add(R.string.related_items_tab_description); } if (showDescription) { // temp empty fragment. will be updated in handleResult - pageAdapter.addFragment(new EmptyFragment(false), DESCRIPTION_TAB_TAG); + pageAdapter.addFragment(EmptyFragment.newInstance(false), DESCRIPTION_TAB_TAG); tabIcons.add(R.drawable.ic_description); tabContentDescriptions.add(R.string.description_tab_description); } if (pageAdapter.getCount() == 0) { - pageAdapter.addFragment(new EmptyFragment(true), EMPTY_TAB_TAG); + pageAdapter.addFragment(EmptyFragment.newInstance(true), EMPTY_TAB_TAG); } pageAdapter.notifyDataSetUpdate(); From b2b99384849e1652b2aa537add457a25389bb162 Mon Sep 17 00:00:00 2001 From: mhmdanas <32234660+mhmdanas@users.noreply.github.com> Date: Sat, 15 May 2021 19:20:27 +0300 Subject: [PATCH 04/72] Put show channel details option in more long-press menus --- .../newpipe/fragments/list/playlist/PlaylistFragment.java | 6 ++++++ .../newpipe/local/history/StatisticsPlaylistFragment.java | 7 +++++++ .../newpipe/local/playlist/LocalPlaylistFragment.java | 6 ++++++ 3 files changed, 19 insertions(+) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/playlist/PlaylistFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/playlist/PlaylistFragment.java index a729b7cc9..1ede515ba 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/playlist/PlaylistFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/playlist/PlaylistFragment.java @@ -59,6 +59,7 @@ import io.reactivex.rxjava3.core.Single; import io.reactivex.rxjava3.disposables.CompositeDisposable; import io.reactivex.rxjava3.disposables.Disposable; +import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty; import static org.schabi.newpipe.ktx.ViewUtils.animate; import static org.schabi.newpipe.ktx.ViewUtils.animateHideRecyclerViewAllowingScrolling; @@ -163,6 +164,11 @@ public class PlaylistFragment extends BaseListInfoFragment { if (KoreUtil.shouldShowPlayWithKodi(context, item.getServiceId())) { entries.add(StreamDialogEntry.play_with_kodi); } + + if (!isNullOrEmpty(item.getUploaderUrl())) { + entries.add(StreamDialogEntry.show_channel_details); + } + StreamDialogEntry.setEnabledEntries(entries); StreamDialogEntry.start_here_on_background.setCustomAction((fragment, infoItem) -> diff --git a/app/src/main/java/org/schabi/newpipe/local/history/StatisticsPlaylistFragment.java b/app/src/main/java/org/schabi/newpipe/local/history/StatisticsPlaylistFragment.java index a2107d5e5..a6877a9a0 100644 --- a/app/src/main/java/org/schabi/newpipe/local/history/StatisticsPlaylistFragment.java +++ b/app/src/main/java/org/schabi/newpipe/local/history/StatisticsPlaylistFragment.java @@ -53,6 +53,8 @@ import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers; import io.reactivex.rxjava3.disposables.CompositeDisposable; import io.reactivex.rxjava3.disposables.Disposable; +import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty; + public class StatisticsPlaylistFragment extends BaseLocalListFragment, Void> { private final CompositeDisposable disposables = new CompositeDisposable(); @@ -359,6 +361,11 @@ public class StatisticsPlaylistFragment if (KoreUtil.shouldShowPlayWithKodi(context, infoItem.getServiceId())) { entries.add(StreamDialogEntry.play_with_kodi); } + + if (!isNullOrEmpty(infoItem.getUploaderUrl())) { + entries.add(StreamDialogEntry.show_channel_details); + } + StreamDialogEntry.setEnabledEntries(entries); StreamDialogEntry.start_here_on_background.setCustomAction((fragment, infoItemDuplicate) -> diff --git a/app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistFragment.java b/app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistFragment.java index 66bd34142..4c2f80edc 100644 --- a/app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistFragment.java +++ b/app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistFragment.java @@ -66,6 +66,7 @@ import io.reactivex.rxjava3.disposables.Disposable; import io.reactivex.rxjava3.schedulers.Schedulers; import io.reactivex.rxjava3.subjects.PublishSubject; +import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty; import static org.schabi.newpipe.ktx.ViewUtils.animate; public class LocalPlaylistFragment extends BaseLocalListFragment, Void> { @@ -771,6 +772,11 @@ public class LocalPlaylistFragment extends BaseLocalListFragment From 10b1da135e35c1e725c01779997a28ff550cc0c5 Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Sun, 23 May 2021 14:54:49 +0200 Subject: [PATCH 05/72] Update ci.yml --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 427da7391..ab816bd9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: uses: actions/setup-java@v2 with: java-version: 8 - distribution: "zulu" + distribution: "adopt" - name: Cache Gradle dependencies uses: actions/cache@v2 @@ -54,7 +54,7 @@ jobs: uses: actions/setup-java@v2 with: java-version: 8 - distribution: "zulu" + distribution: "adopt" - name: Cache Gradle dependencies uses: actions/cache@v2 @@ -79,7 +79,7 @@ jobs: # uses: actions/setup-java@v2 # with: # java-version: 11 # Sonar requires JDK 11 -# distribution: "zulu" +# distribution: "adopt" # - name: Cache SonarCloud packages # uses: actions/cache@v2 From 57474e2dab44f568243019d96d6edd4b2f6e6439 Mon Sep 17 00:00:00 2001 From: Eric Xu Date: Fri, 21 May 2021 00:33:11 -0400 Subject: [PATCH 06/72] Refactor and optimize equals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove multiple casts of obj - Simply use object equals on the streams because PlayQueueItem’s equals already compares urls --- .../schabi/newpipe/player/playqueue/PlayQueue.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java b/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java index 6131d8565..7cfc9fba1 100644 --- a/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java +++ b/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java @@ -500,22 +500,14 @@ public abstract class PlayQueue implements Serializable { * we don't have to do anything with new queue. * This method also gives a chance to track history of items in a queue in * VideoDetailFragment without duplicating items from two identical queues - * */ + */ @Override public boolean equals(@Nullable final Object obj) { - if (!(obj instanceof PlayQueue) - || getStreams().size() != ((PlayQueue) obj).getStreams().size()) { + if (!(obj instanceof PlayQueue)) { return false; } - final PlayQueue other = (PlayQueue) obj; - for (int i = 0; i < getStreams().size(); i++) { - if (!getItem(i).getUrl().equals(other.getItem(i).getUrl())) { - return false; - } - } - - return true; + return streams.equals(other.streams); } public boolean isDisposed() { From 013c59f904595899a404dae672a16245174d3eda Mon Sep 17 00:00:00 2001 From: Eric Xu Date: Fri, 21 May 2021 17:56:10 -0400 Subject: [PATCH 07/72] Refactor ArrayList fields to List --- .../java/org/schabi/newpipe/player/playqueue/PlayQueue.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java b/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java index 7cfc9fba1..bafd7fd82 100644 --- a/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java +++ b/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java @@ -41,12 +41,12 @@ import io.reactivex.rxjava3.subjects.BehaviorSubject; public abstract class PlayQueue implements Serializable { public static final boolean DEBUG = MainActivity.DEBUG; - private ArrayList backup; - private ArrayList streams; + private List backup; + private List streams; @NonNull private final AtomicInteger queueIndex; - private final ArrayList history; + private final List history; private transient BehaviorSubject eventBroadcast; private transient Flowable broadcastReceiver; From 4cd1f201f536e52fbf183f281ec2267ebdc72e40 Mon Sep 17 00:00:00 2001 From: Eric Xu Date: Fri, 21 May 2021 14:12:35 -0400 Subject: [PATCH 08/72] Refactor streams to initialize with values --- .../java/org/schabi/newpipe/player/playqueue/PlayQueue.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java b/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java index bafd7fd82..857cb5e72 100644 --- a/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java +++ b/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java @@ -54,8 +54,7 @@ public abstract class PlayQueue implements Serializable { private transient boolean disposed; PlayQueue(final int index, final List startWith) { - streams = new ArrayList<>(); - streams.addAll(startWith); + streams = new ArrayList<>(startWith); history = new ArrayList<>(); if (streams.size() > index) { history.add(streams.get(index)); From 882b235a781fd10228e03c55d212cebe310baf4d Mon Sep 17 00:00:00 2001 From: Eric Xu Date: Fri, 21 May 2021 17:53:40 -0400 Subject: [PATCH 09/72] Test PlayQueue equals --- .../player/playqueue/PlayQueueTest.java | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java diff --git a/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java b/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java new file mode 100644 index 000000000..7ae383510 --- /dev/null +++ b/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java @@ -0,0 +1,78 @@ +package org.schabi.newpipe.player.playqueue; + +import org.junit.Before; +import org.junit.Test; +import org.junit.experimental.runners.Enclosed; +import org.junit.runner.RunWith; +import org.schabi.newpipe.extractor.stream.StreamInfoItem; +import org.schabi.newpipe.extractor.stream.StreamType; + +import java.util.Collections; +import java.util.List; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; + +@SuppressWarnings("checkstyle:HideUtilityClassConstructor") +@RunWith(Enclosed.class) +public class PlayQueueTest { + public static PlayQueue mockPlayQueue(final int index, final List streams) { + // I tried using Mockito, but it didn't work for some reason + return new PlayQueue(index, streams) { + @Override + public boolean isComplete() { + throw new UnsupportedOperationException(); + } + + @Override + public void fetch() { + throw new UnsupportedOperationException(); + } + }; + } + + public static class EqualsTests { + private PlayQueueItem item1; + private PlayQueueItem item2; + + @Before + public void setup() { + final String url1 = "www.website1.com"; + final String url2 = "www.website2.com"; + final StreamInfoItem info1 = new StreamInfoItem( + 0, url1, "", StreamType.VIDEO_STREAM + ); + final StreamInfoItem info2 = new StreamInfoItem( + 0, url2, "", StreamType.VIDEO_STREAM + ); + item1 = new PlayQueueItem(info1); + item2 = new PlayQueueItem(info2); + } + + @Test + public void sameStreams() { + final List streams = Collections.nCopies(5, item1); + final PlayQueue queue1 = mockPlayQueue(0, streams); + final PlayQueue queue2 = mockPlayQueue(0, streams); + assertEquals(queue1, queue2); + } + + @Test + public void sameSizeDifferentItems() { + final List streams1 = Collections.nCopies(5, item1); + final List streams2 = Collections.nCopies(5, item2); + final PlayQueue queue1 = mockPlayQueue(0, streams1); + final PlayQueue queue2 = mockPlayQueue(0, streams2); + assertNotEquals(queue1, queue2); + } + + @Test + public void differentSizeStreams() { + final List streams1 = Collections.nCopies(5, item1); + final List streams2 = Collections.nCopies(6, item2); + final PlayQueue queue1 = mockPlayQueue(0, streams1); + final PlayQueue queue2 = mockPlayQueue(0, streams2); + assertNotEquals(queue1, queue2); + } + } +} From 441c68ead25ac33e1381c4fa09a729748df2e2e7 Mon Sep 17 00:00:00 2001 From: Eric Xu Date: Fri, 21 May 2021 18:00:46 -0400 Subject: [PATCH 10/72] Add hashCode() to match equals(other) --- .../java/org/schabi/newpipe/player/playqueue/PlayQueue.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java b/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java index 857cb5e72..f7d70fc34 100644 --- a/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java +++ b/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java @@ -509,6 +509,11 @@ public abstract class PlayQueue implements Serializable { return streams.equals(other.streams); } + @Override + public int hashCode() { + return streams.hashCode(); + } + public boolean isDisposed() { return disposed; } From 8efe2859b843580a31ca3f16331bf792e528b643 Mon Sep 17 00:00:00 2001 From: Eric Xu Date: Fri, 21 May 2021 18:04:22 -0400 Subject: [PATCH 11/72] Refactor assignments to field declaration Assignments that don't require the constructor can be moved out. --- .../org/schabi/newpipe/player/playqueue/PlayQueue.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java b/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java index f7d70fc34..a5fa949de 100644 --- a/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java +++ b/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java @@ -46,22 +46,21 @@ public abstract class PlayQueue implements Serializable { @NonNull private final AtomicInteger queueIndex; - private final List history; + private final List history = new ArrayList<>(); private transient BehaviorSubject eventBroadcast; private transient Flowable broadcastReceiver; - private transient boolean disposed; + private transient boolean disposed = false; PlayQueue(final int index, final List startWith) { streams = new ArrayList<>(startWith); - history = new ArrayList<>(); + if (streams.size() > index) { history.add(streams.get(index)); } queueIndex = new AtomicInteger(index); - disposed = false; } /*////////////////////////////////////////////////////////////////////////// From 8d0f2d371dacb98bd17add0c26d20c6dd6c47b6f Mon Sep 17 00:00:00 2001 From: Eric Xu Date: Fri, 21 May 2021 22:54:15 -0400 Subject: [PATCH 12/72] Test PlayQueue.setIndex(...) --- .../player/playqueue/PlayQueueTest.java | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java b/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java index 7ae383510..e050d1a82 100644 --- a/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java +++ b/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java @@ -7,11 +7,15 @@ import org.junit.runner.RunWith; import org.schabi.newpipe.extractor.stream.StreamInfoItem; import org.schabi.newpipe.extractor.stream.StreamType; +import java.util.ArrayList; import java.util.Collections; import java.util.List; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.spy; @SuppressWarnings("checkstyle:HideUtilityClassConstructor") @RunWith(Enclosed.class) @@ -31,6 +35,73 @@ public class PlayQueueTest { }; } + public static class SetIndexTests { + private static final int SIZE = 5; + private PlayQueue nonEmptyQueue; + private PlayQueue emptyQueue; + + @Before + public void setup() { + nonEmptyQueue = spy(mockPlayQueue( + 0, Collections.nCopies(SIZE, mock(PlayQueueItem.class)) + )); + emptyQueue = spy(mockPlayQueue(0, new ArrayList<>())); + } + + @Test + public void negative() { + nonEmptyQueue.setIndex(-5); + assertEquals(0, nonEmptyQueue.getIndex()); + + emptyQueue.setIndex(-5); + assertEquals(0, nonEmptyQueue.getIndex()); + } + + @Test + public void inBounds() { + nonEmptyQueue.setIndex(2); + assertEquals(2, nonEmptyQueue.getIndex()); + + // emptyQueue not tested because 0 isn't technically inBounds + } + + @Test + public void outOfBoundIsComplete() { + doReturn(true).when(nonEmptyQueue).isComplete(); + nonEmptyQueue.setIndex(7); + assertEquals(2, nonEmptyQueue.getIndex()); + + doReturn(true).when(emptyQueue).isComplete(); + emptyQueue.setIndex(2); + assertEquals(0, emptyQueue.getIndex()); + } + + @Test + public void outOfBoundsNotComplete() { + doReturn(false).when(nonEmptyQueue).isComplete(); + nonEmptyQueue.setIndex(7); + assertEquals(SIZE - 1, nonEmptyQueue.getIndex()); + + doReturn(false).when(emptyQueue).isComplete(); + emptyQueue.setIndex(2); + assertEquals(0, emptyQueue.getIndex()); + } + + @Test + public void indexZero() { + nonEmptyQueue.setIndex(0); + assertEquals(0, nonEmptyQueue.getIndex()); + + doReturn(true).when(emptyQueue).isComplete(); + emptyQueue.setIndex(0); + assertEquals(0, emptyQueue.getIndex()); + + doReturn(false).when(emptyQueue).isComplete(); + emptyQueue.setIndex(0); + assertEquals(0, emptyQueue.getIndex()); + } + } + public static class EqualsTests { private PlayQueueItem item1; private PlayQueueItem item2; From 775fbc9a75f57ef66a4659778a0017753f34bcab Mon Sep 17 00:00:00 2001 From: Eric Xu Date: Fri, 21 May 2021 23:33:23 -0400 Subject: [PATCH 13/72] Rewrite setIndex(int) to pass unit tests Original did not cover the case of when streams is empty and documentation does not specify any input restrictions. There's an ambiguity with broadcasting an event between the documentation and the actual code (see TODO). --- .../newpipe/player/playqueue/PlayQueue.java | 28 +++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java b/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java index a5fa949de..46627e12e 100644 --- a/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java +++ b/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java @@ -135,18 +135,36 @@ public abstract class PlayQueue implements Serializable { public synchronized void setIndex(final int index) { final int oldIndex = getIndex(); - int newIndex = index; + final int newIndex; + if (index < 0) { newIndex = 0; + } else if (index < streams.size()) { + // Regular assignment for index in bounds + newIndex = index; + } else if (streams.isEmpty()) { + // Out of bounds from here on + // Need to check if stream is empty to prevent arithmetic error and negative index + newIndex = 0; + } else if (isComplete()) { + // Circular indexing + newIndex = index % streams.size(); + } else { + // Index of last element + newIndex = streams.size() - 1; } - if (index >= streams.size()) { - newIndex = isComplete() ? index % streams.size() : streams.size() - 1; - } + + queueIndex.set(newIndex); + if (oldIndex != newIndex) { history.add(streams.get(newIndex)); } - queueIndex.set(newIndex); + /* + TODO: Documentation states that a SelectEvent will only be emitted if the new index is... + different from the old one but this is emitted regardless? Not sure what this what it does + exactly so I won't touch it + */ broadcast(new SelectEvent(oldIndex, newIndex)); } From e8eeac673570e3bb4e8dd202be3085a7a359ab69 Mon Sep 17 00:00:00 2001 From: Eric Xu Date: Fri, 21 May 2021 23:41:24 -0400 Subject: [PATCH 14/72] Resolve TODO in indexOf(...) PlayQueueItem overrides equals and hashCode, so using indexOf is perfectly fine. --- .../java/org/schabi/newpipe/player/playqueue/PlayQueue.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java b/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java index 46627e12e..44b33e344 100644 --- a/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java +++ b/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java @@ -196,8 +196,6 @@ public abstract class PlayQueue implements Serializable { * @return the index of the given item */ public int indexOf(@NonNull final PlayQueueItem item) { - // referential equality, can't think of a better way to do this - // todo: better than this return streams.indexOf(item); } From 77f694033666bebcfd41ad153e8e540983678b62 Mon Sep 17 00:00:00 2001 From: Eric Xu Date: Fri, 21 May 2021 23:53:45 -0400 Subject: [PATCH 15/72] Refactor making a PlayQueueItem to static method --- .../player/playqueue/PlayQueueTest.java | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java b/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java index e050d1a82..b3641547f 100644 --- a/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java +++ b/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java @@ -13,6 +13,7 @@ import java.util.List; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNull; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; @@ -35,6 +36,13 @@ public class PlayQueueTest { }; } + public static PlayQueueItem makeItemWithUrl(final String url) { + final StreamInfoItem infoItem = new StreamInfoItem( + 0, url, "", StreamType.VIDEO_STREAM + ); + return new PlayQueueItem(infoItem); + } + public static class SetIndexTests { private static final int SIZE = 5; private PlayQueue nonEmptyQueue; @@ -103,22 +111,8 @@ public class PlayQueueTest { } public static class EqualsTests { - private PlayQueueItem item1; - private PlayQueueItem item2; - - @Before - public void setup() { - final String url1 = "www.website1.com"; - final String url2 = "www.website2.com"; - final StreamInfoItem info1 = new StreamInfoItem( - 0, url1, "", StreamType.VIDEO_STREAM - ); - final StreamInfoItem info2 = new StreamInfoItem( - 0, url2, "", StreamType.VIDEO_STREAM - ); - item1 = new PlayQueueItem(info1); - item2 = new PlayQueueItem(info2); - } + private final PlayQueueItem item1 = makeItemWithUrl("URL_1"); + private final PlayQueueItem item2 = makeItemWithUrl("URL_2"); @Test public void sameStreams() { From 363bbf5fd3d3fa0ceb060f4d0552db9f062fcff7 Mon Sep 17 00:00:00 2001 From: Eric Xu Date: Sat, 22 May 2021 00:00:39 -0400 Subject: [PATCH 16/72] Test getItem(int) --- .../player/playqueue/PlayQueueTest.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java b/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java index b3641547f..587d54b0f 100644 --- a/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java +++ b/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java @@ -1,6 +1,7 @@ package org.schabi.newpipe.player.playqueue; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.experimental.runners.Enclosed; import org.junit.runner.RunWith; @@ -10,6 +11,7 @@ import org.schabi.newpipe.extractor.stream.StreamType; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.Objects; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; @@ -110,6 +112,34 @@ public class PlayQueueTest { } } + public static class GetItemTests { + private static List streams; + private PlayQueue queue; + + @BeforeClass + public static void init() { + streams = new ArrayList<>(Collections.nCopies(5, makeItemWithUrl("OTHER_URL"))); + streams.set(3, makeItemWithUrl("TARGET_URL")); + } + + @Before + public void setup() { + queue = mockPlayQueue(0, streams); + } + + @Test + public void inBounds() { + assertEquals("TARGET_URL", Objects.requireNonNull(queue.getItem(3)).getUrl()); + assertEquals("OTHER_URL", Objects.requireNonNull(queue.getItem(1)).getUrl()); + } + + @Test + public void outOfBounds() { + assertNull(queue.getItem(-1)); + assertNull(queue.getItem(5)); + } + } + public static class EqualsTests { private final PlayQueueItem item1 = makeItemWithUrl("URL_1"); private final PlayQueueItem item2 = makeItemWithUrl("URL_2"); From 92a67bb8cb65cbfca24883de822b350e9748a8cf Mon Sep 17 00:00:00 2001 From: Eric Xu Date: Sat, 22 May 2021 01:09:29 -0400 Subject: [PATCH 17/72] Rearrange fields Final fields should be arranged first --- .../org/schabi/newpipe/player/playqueue/PlayQueue.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java b/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java index 44b33e344..ebd4abc44 100644 --- a/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java +++ b/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java @@ -40,17 +40,15 @@ import io.reactivex.rxjava3.subjects.BehaviorSubject; */ public abstract class PlayQueue implements Serializable { public static final boolean DEBUG = MainActivity.DEBUG; - - private List backup; - private List streams; - @NonNull private final AtomicInteger queueIndex; private final List history = new ArrayList<>(); + private List backup; + private List streams; + private transient BehaviorSubject eventBroadcast; private transient Flowable broadcastReceiver; - private transient boolean disposed = false; PlayQueue(final int index, final List startWith) { From 08949ee3475994cb32881651aec78614fa69e992 Mon Sep 17 00:00:00 2001 From: Zhiheng Xu Date: Sat, 22 May 2021 11:49:05 -0400 Subject: [PATCH 18/72] Refactor static methods to package private Stops Android Studio from "recognizing" them as tests --- .../org/schabi/newpipe/player/playqueue/PlayQueueTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java b/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java index 587d54b0f..d9b6c5f18 100644 --- a/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java +++ b/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java @@ -23,7 +23,7 @@ import static org.mockito.Mockito.spy; @SuppressWarnings("checkstyle:HideUtilityClassConstructor") @RunWith(Enclosed.class) public class PlayQueueTest { - public static PlayQueue mockPlayQueue(final int index, final List streams) { + static PlayQueue mockPlayQueue(final int index, final List streams) { // I tried using Mockito, but it didn't work for some reason return new PlayQueue(index, streams) { @Override @@ -38,7 +38,7 @@ public class PlayQueueTest { }; } - public static PlayQueueItem makeItemWithUrl(final String url) { + static PlayQueueItem makeItemWithUrl(final String url) { final StreamInfoItem infoItem = new StreamInfoItem( 0, url, "", StreamType.VIDEO_STREAM ); From bf8e8798d9e12f46ceeb3fa5bd029bb8ad0f9236 Mon Sep 17 00:00:00 2001 From: Zhiheng Xu Date: Sat, 22 May 2021 12:45:09 -0400 Subject: [PATCH 19/72] Add test for setIndex --- .../player/playqueue/PlayQueueTest.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java b/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java index d9b6c5f18..0211b5efc 100644 --- a/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java +++ b/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java @@ -8,6 +8,7 @@ import org.junit.runner.RunWith; import org.schabi.newpipe.extractor.stream.StreamInfoItem; import org.schabi.newpipe.extractor.stream.StreamType; +import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -110,6 +111,32 @@ public class PlayQueueTest { emptyQueue.setIndex(0); assertEquals(0, emptyQueue.getIndex()); } + + @SuppressWarnings("unchecked") + @Test + public void addToHistory() throws NoSuchFieldException, IllegalAccessException { + final Field field; + field = PlayQueue.class.getDeclaredField("history"); + field.setAccessible(true); + List history; + + /* + history's size is currently 1. 0 is the also the current index, so history should not + be affected. + */ + nonEmptyQueue.setIndex(0); + history = (List) Objects.requireNonNull( + field.get(nonEmptyQueue) + ); + assertEquals(1, history.size()); + + // Index 3 != 0, so the second history element should be the item at streams[3] + nonEmptyQueue.setIndex(3); + history = (List) Objects.requireNonNull( + field.get(nonEmptyQueue) + ); + assertEquals(nonEmptyQueue.getItem(3), history.get(1)); + } } public static class GetItemTests { From e1a6347c4eef0bc374109b3efcb57562f6a8440b Mon Sep 17 00:00:00 2001 From: Zhiheng Xu Date: Sat, 22 May 2021 13:28:01 -0400 Subject: [PATCH 20/72] Refactor shuffle and update documentation - Add early return for invalid sizes to shuffle - Rename variables to be more descriptive - Refactor moving list element, removing unnecessary operations - Unwrap if clause for adding to history because the condition is guaranteed by the guard clause - Inline the value 0 for the ReorderEvent - Update documentation to reflect new changes --- .../newpipe/player/playqueue/PlayQueue.java | 37 +++++++++++-------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java b/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java index ebd4abc44..1437210d9 100644 --- a/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java +++ b/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java @@ -422,34 +422,41 @@ public abstract class PlayQueue implements Serializable { } /** - * Shuffles the current play queue. + * Shuffles the current play queue *

- * This method first backs up the existing play queue and item being played. - * Then a newly shuffled play queue will be generated along with currently - * playing item placed at the beginning of the queue. + * This method first backs up the existing play queue and item being played. Then a newly + * shuffled play queue will be generated along with currently playing item placed at the + * beginning of the queue. This item will also be added to the history. *

*

- * Will emit a {@link ReorderEvent} in any context. + * Will emit a {@link ReorderEvent} if shuffled. *

+ * + * @implNote Does nothing if the queue is empty or has a size of 1 */ public synchronized void shuffle() { + // Can't shuffle an list that's empty or only has one element + if (size() <= 1) { + return; + } + // Create a backup if it doesn't already exist if (backup == null) { backup = new ArrayList<>(streams); } - final int originIndex = getIndex(); - final PlayQueueItem current = getItem(); + + final int originalIndex = getIndex(); + final PlayQueueItem currentItem = getItem(); + Collections.shuffle(streams); - final int newIndex = streams.indexOf(current); - if (newIndex != -1) { - streams.add(0, streams.remove(newIndex)); - } + // Move currentItem to the head of the queue + streams.remove(currentItem); + streams.add(0, currentItem); queueIndex.set(0); - if (streams.size() > 0) { - history.add(streams.get(0)); - } - broadcast(new ReorderEvent(originIndex, queueIndex.get())); + history.add(currentItem); + + broadcast(new ReorderEvent(originalIndex, 0)); } /** From 5ab6e84044d5d3ada8c9c3e9f8f754a7b712c51e Mon Sep 17 00:00:00 2001 From: Zhiheng Xu Date: Sat, 22 May 2021 13:39:15 -0400 Subject: [PATCH 21/72] Remove redundant clearing of list --- .../main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java b/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java index 1437210d9..45f5efa03 100644 --- a/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java +++ b/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java @@ -476,7 +476,6 @@ public abstract class PlayQueue implements Serializable { final int originIndex = getIndex(); final PlayQueueItem current = getItem(); - streams.clear(); streams = backup; backup = null; From 2e161a1f45d8da2bedd2b924da1c90cc68678714 Mon Sep 17 00:00:00 2001 From: Zhiheng Xu Date: Sat, 22 May 2021 13:56:02 -0400 Subject: [PATCH 22/72] Change shuffle() guard to check for size <= 2 After testing the app, I realized that shuffling a queue with size 2 does nothing --- .../java/org/schabi/newpipe/player/playqueue/PlayQueue.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java b/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java index 45f5efa03..014c13339 100644 --- a/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java +++ b/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueue.java @@ -432,11 +432,12 @@ public abstract class PlayQueue implements Serializable { * Will emit a {@link ReorderEvent} if shuffled. *

* - * @implNote Does nothing if the queue is empty or has a size of 1 + * @implNote Does nothing if the queue has a size <= 2 (the currently playing video must stay on + * top, so shuffling a size-2 list does nothing) */ public synchronized void shuffle() { // Can't shuffle an list that's empty or only has one element - if (size() <= 1) { + if (size() <= 2) { return; } // Create a backup if it doesn't already exist From e518c0dc148a041116e80bd867b1002d209c37b4 Mon Sep 17 00:00:00 2001 From: Zhiheng Xu Date: Sun, 23 May 2021 15:24:35 -0400 Subject: [PATCH 23/72] =?UTF-8?q?Rename=20mockPlayQueue(=E2=80=A6)=20to=20?= =?UTF-8?q?makePlayQueue(=E2=80=A6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../player/playqueue/PlayQueueTest.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java b/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java index 0211b5efc..1c0500984 100644 --- a/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java +++ b/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java @@ -24,7 +24,7 @@ import static org.mockito.Mockito.spy; @SuppressWarnings("checkstyle:HideUtilityClassConstructor") @RunWith(Enclosed.class) public class PlayQueueTest { - static PlayQueue mockPlayQueue(final int index, final List streams) { + static PlayQueue makePlayQueue(final int index, final List streams) { // I tried using Mockito, but it didn't work for some reason return new PlayQueue(index, streams) { @Override @@ -53,10 +53,10 @@ public class PlayQueueTest { @Before public void setup() { - nonEmptyQueue = spy(mockPlayQueue( + nonEmptyQueue = spy(makePlayQueue( 0, Collections.nCopies(SIZE, mock(PlayQueueItem.class)) )); - emptyQueue = spy(mockPlayQueue(0, new ArrayList<>())); + emptyQueue = spy(makePlayQueue(0, new ArrayList<>())); } @Test @@ -151,7 +151,7 @@ public class PlayQueueTest { @Before public void setup() { - queue = mockPlayQueue(0, streams); + queue = makePlayQueue(0, streams); } @Test @@ -174,8 +174,8 @@ public class PlayQueueTest { @Test public void sameStreams() { final List streams = Collections.nCopies(5, item1); - final PlayQueue queue1 = mockPlayQueue(0, streams); - final PlayQueue queue2 = mockPlayQueue(0, streams); + final PlayQueue queue1 = makePlayQueue(0, streams); + final PlayQueue queue2 = makePlayQueue(0, streams); assertEquals(queue1, queue2); } @@ -183,8 +183,8 @@ public class PlayQueueTest { public void sameSizeDifferentItems() { final List streams1 = Collections.nCopies(5, item1); final List streams2 = Collections.nCopies(5, item2); - final PlayQueue queue1 = mockPlayQueue(0, streams1); - final PlayQueue queue2 = mockPlayQueue(0, streams2); + final PlayQueue queue1 = makePlayQueue(0, streams1); + final PlayQueue queue2 = makePlayQueue(0, streams2); assertNotEquals(queue1, queue2); } @@ -192,8 +192,8 @@ public class PlayQueueTest { public void differentSizeStreams() { final List streams1 = Collections.nCopies(5, item1); final List streams2 = Collections.nCopies(6, item2); - final PlayQueue queue1 = mockPlayQueue(0, streams1); - final PlayQueue queue2 = mockPlayQueue(0, streams2); + final PlayQueue queue1 = makePlayQueue(0, streams1); + final PlayQueue queue2 = makePlayQueue(0, streams2); assertNotEquals(queue1, queue2); } } From 40f66977c77bb743c276f1baad4849944bb769b6 Mon Sep 17 00:00:00 2001 From: Zhiheng Xu Date: Sun, 23 May 2021 15:33:57 -0400 Subject: [PATCH 24/72] Rewrite addToHistory test without using reflection --- .../player/playqueue/PlayQueueTest.java | 36 ++++++------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java b/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java index 1c0500984..da1173e9b 100644 --- a/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java +++ b/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java @@ -8,17 +8,17 @@ import org.junit.runner.RunWith; import org.schabi.newpipe.extractor.stream.StreamInfoItem; import org.schabi.newpipe.extractor.stream.StreamType; -import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Objects; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; @SuppressWarnings("checkstyle:HideUtilityClassConstructor") @@ -53,9 +53,11 @@ public class PlayQueueTest { @Before public void setup() { - nonEmptyQueue = spy(makePlayQueue( - 0, Collections.nCopies(SIZE, mock(PlayQueueItem.class)) - )); + final List streams = new ArrayList<>(5); + for (int i = 0; i < 5; ++i) { + streams.add(makeItemWithUrl("URL_" + i)); + } + nonEmptyQueue = spy(makePlayQueue(0, streams)); emptyQueue = spy(makePlayQueue(0, new ArrayList<>())); } @@ -112,30 +114,14 @@ public class PlayQueueTest { assertEquals(0, emptyQueue.getIndex()); } - @SuppressWarnings("unchecked") @Test - public void addToHistory() throws NoSuchFieldException, IllegalAccessException { - final Field field; - field = PlayQueue.class.getDeclaredField("history"); - field.setAccessible(true); - List history; - - /* - history's size is currently 1. 0 is the also the current index, so history should not - be affected. - */ + public void addToHistory() { nonEmptyQueue.setIndex(0); - history = (List) Objects.requireNonNull( - field.get(nonEmptyQueue) - ); - assertEquals(1, history.size()); + assertFalse(nonEmptyQueue.previous()); - // Index 3 != 0, so the second history element should be the item at streams[3] nonEmptyQueue.setIndex(3); - history = (List) Objects.requireNonNull( - field.get(nonEmptyQueue) - ); - assertEquals(nonEmptyQueue.getItem(3), history.get(1)); + assertTrue(nonEmptyQueue.previous()); + assertEquals("URL_0", Objects.requireNonNull(nonEmptyQueue.getItem()).getUrl()); } } From c0f47195a25ec3561bbe915196ce7097d684d4bb Mon Sep 17 00:00:00 2001 From: Zhiheng Xu Date: Mon, 24 May 2021 13:03:52 -0400 Subject: [PATCH 25/72] Remove Enclosed.class runner Does not affect Gradle tests and only benefits IDE workflow --- .../org/schabi/newpipe/player/playqueue/PlayQueueTest.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java b/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java index da1173e9b..43e090900 100644 --- a/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java +++ b/app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java @@ -3,8 +3,6 @@ package org.schabi.newpipe.player.playqueue; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; -import org.junit.experimental.runners.Enclosed; -import org.junit.runner.RunWith; import org.schabi.newpipe.extractor.stream.StreamInfoItem; import org.schabi.newpipe.extractor.stream.StreamType; @@ -22,7 +20,6 @@ import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.spy; @SuppressWarnings("checkstyle:HideUtilityClassConstructor") -@RunWith(Enclosed.class) public class PlayQueueTest { static PlayQueue makePlayQueue(final int index, final List streams) { // I tried using Mockito, but it didn't work for some reason From 6422e31b10e75217a1de72ab2ea6c96defd3cc7f Mon Sep 17 00:00:00 2001 From: Fynn Godau Date: Wed, 26 May 2021 08:44:24 +0200 Subject: [PATCH 26/72] [Bandcamp] Handles links without `/` Co-authored-by: yashpalgoyal1304 --- app/src/main/AndroidManifest.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index e247e57b8..c87ae2d25 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -332,7 +332,6 @@ - Date: Wed, 26 May 2021 09:01:08 +0200 Subject: [PATCH 27/72] [Bandcamp] Increase accuracy of intent filters --- app/src/main/AndroidManifest.xml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c87ae2d25..eb15cddce 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -319,7 +319,7 @@ - + @@ -330,9 +330,23 @@ - + + + + + + + + + + + + + + + Date: Sat, 22 May 2021 21:32:36 -0400 Subject: [PATCH 28/72] Add formatting removal on paste for search Closes #5912 --- .../newpipe/fragments/list/search/SearchFragment.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java index b52aaf2f8..282367ffc 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java @@ -9,6 +9,7 @@ import android.text.Editable; import android.text.Html; import android.text.TextUtils; import android.text.TextWatcher; +import android.text.style.CharacterStyle; import android.util.Log; import android.view.KeyEvent; import android.view.LayoutInflater; @@ -588,6 +589,12 @@ public class SearchFragment extends BaseListFragment Date: Sun, 23 May 2021 10:44:17 -0400 Subject: [PATCH 29/72] Add comment --- .../schabi/newpipe/fragments/list/search/SearchFragment.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java index 282367ffc..86282362a 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java @@ -589,12 +589,14 @@ public class SearchFragment extends BaseListFragment Date: Sun, 23 May 2021 10:50:18 -0400 Subject: [PATCH 30/72] Simplify code --- .../newpipe/fragments/list/search/SearchFragment.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java index 86282362a..70fce1cb7 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java @@ -590,13 +590,10 @@ public class SearchFragment extends BaseListFragment Date: Thu, 27 May 2021 09:56:27 +0200 Subject: [PATCH 31/72] Change IRC link Move from freenode webchat to libera chat --- .github/ISSUE_TEMPLATE/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 5a97b3662..03e24bcca 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,7 +1,7 @@ blank_issues_enabled: false contact_links: - name: 💬 IRC - url: https://webchat.freenode.net/#newpipe + url: ircs://irc.libera.chat:6697/newpipe about: Chat with us via IRC for quick Q/A - name: 💬 Matrix url: https://matrix.to/#/#freenode_#newpipe:matrix.org From 23ee9b786708decccd010cf9835c106fd614a413 Mon Sep 17 00:00:00 2001 From: TiA4f8R <74829229+TiA4f8R@users.noreply.github.com> Date: Thu, 27 May 2021 22:07:45 +0200 Subject: [PATCH 32/72] Update Matrix link of NewPipe IRC from Freenode to Libera.chat --- .github/ISSUE_TEMPLATE/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 03e24bcca..505d0c66f 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -4,5 +4,5 @@ contact_links: url: ircs://irc.libera.chat:6697/newpipe about: Chat with us via IRC for quick Q/A - name: 💬 Matrix - url: https://matrix.to/#/#freenode_#newpipe:matrix.org + url: https://matrix.to/#/#newpipe:libera.chat about: Chat with us via Matrix for quick Q/A From b564433ff607ff78b5b203f80cf429332e990466 Mon Sep 17 00:00:00 2001 From: camo0112 <56369484+camo0112@users.noreply.github.com> Date: Fri, 28 May 2021 03:38:53 +0530 Subject: [PATCH 33/72] Option for download is redundant and thus removed when linkType is CHANNEL or PLAYLIST --- app/src/main/java/org/schabi/newpipe/RouterActivity.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/RouterActivity.java b/app/src/main/java/org/schabi/newpipe/RouterActivity.java index 13efcb58d..2b3262c85 100644 --- a/app/src/main/java/org/schabi/newpipe/RouterActivity.java +++ b/app/src/main/java/org/schabi/newpipe/RouterActivity.java @@ -466,6 +466,11 @@ public class RouterActivity extends AppCompatActivity { if (capabilities.contains(AUDIO)) { returnList.add(backgroundPlayer); } + // download is redundant for linkType CHANNEL AND PLAYLIST (till playlist downloading is + // not supported ) + returnList.add(new AdapterChoiceItem(getString(R.string.download_key), + getString(R.string.download), + R.drawable.ic_file_download)); } else { returnList.add(showInfo); @@ -478,10 +483,6 @@ public class RouterActivity extends AppCompatActivity { } } - returnList.add(new AdapterChoiceItem(getString(R.string.download_key), - getString(R.string.download), - R.drawable.ic_file_download)); - return returnList; } From e8d518cd6c85bb0f6d26c10122b7279abebaa7f8 Mon Sep 17 00:00:00 2001 From: Tobi Date: Fri, 28 May 2021 11:59:27 +0200 Subject: [PATCH 34/72] Add Libera webchat link --- .github/ISSUE_TEMPLATE/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 505d0c66f..b0fdb56db 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,7 +1,7 @@ blank_issues_enabled: false contact_links: - name: 💬 IRC - url: ircs://irc.libera.chat:6697/newpipe + url: https://web.libera.chat/#newpipe about: Chat with us via IRC for quick Q/A - name: 💬 Matrix url: https://matrix.to/#/#newpipe:libera.chat From 6ec72ef94591305ec5a7a5ccfebd64bef357c80f Mon Sep 17 00:00:00 2001 From: TobiGr Date: Fri, 28 May 2021 12:43:15 +0200 Subject: [PATCH 35/72] Fix empty fragment text not centered when text longer than one line --- app/src/main/res/layout/main_bg.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/res/layout/main_bg.xml b/app/src/main/res/layout/main_bg.xml index 996ecdde4..659784e45 100644 --- a/app/src/main/res/layout/main_bg.xml +++ b/app/src/main/res/layout/main_bg.xml @@ -5,6 +5,8 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" + android:paddingStart="@dimen/activity_horizontal_margin" + android:paddingEnd="@dimen/activity_horizontal_margin" tools:context=".fragments.detail.VideoDetailFragment"> From f1bc4f5c20fd509e511cf0eb609eefb21402eb1c Mon Sep 17 00:00:00 2001 From: TobiGr Date: Fri, 28 May 2021 15:04:39 +0200 Subject: [PATCH 36/72] Update junit from 4.13.1 to 4.13.2 https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.13.2.md --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 1b77756e1..2f32c13f0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -270,7 +270,7 @@ dependencies { debugImplementation "com.facebook.stetho:stetho-okhttp3:${stethoVersion}" /** Testing **/ - testImplementation 'junit:junit:4.13.1' + testImplementation 'junit:junit:4.13.2' testImplementation "org.mockito:mockito-core:${mockitoVersion}" testImplementation "org.mockito:mockito-inline:${mockitoVersion}" From 6956d16f0e7a25a026c274d3db1ee639dde48228 Mon Sep 17 00:00:00 2001 From: TobiGr Date: Fri, 28 May 2021 15:07:30 +0200 Subject: [PATCH 37/72] Update dependency for core library desugaring Hopefully fixes reproducible builds. --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 2f32c13f0..0a4ece481 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -178,7 +178,7 @@ sonarqube { dependencies { /** Desugaring **/ - coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.1' + coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' /** NewPipe libraries **/ // You can use a local version by uncommenting a few lines in settings.gradle From a84ab7413cbe237fedb218a4edbcbf38784a1c02 Mon Sep 17 00:00:00 2001 From: TiA4f8R <74829229+TiA4f8R@users.noreply.github.com> Date: Sat, 29 May 2021 14:18:15 +0200 Subject: [PATCH 38/72] Change IRC chat button link in READMEs (#6393) * Change the IRC chat button link in the original README * Change the IRC chat button link in the Spanish README * Change the IRC chat button link in the Japanese README * Change the IRC chat button link in the Korean README * Change the IRC chat button link in the Brazilian Portuguese README * Change the IRC chat button link in the Romanian README * Change the IRC chat button link in the Somali README * Change the IRC chat button link in the Turkish README --- README.es.md | 2 +- README.ja.md | 2 +- README.ko.md | 2 +- README.md | 2 +- README.pt_BR.md | 2 +- README.ro.md | 2 +- README.so.md | 2 +- README.tr.md | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.es.md b/README.es.md index 7eae15c08..3920545d5 100644 --- a/README.es.md +++ b/README.es.md @@ -9,7 +9,7 @@ - +


diff --git a/README.ja.md b/README.ja.md index a961005a7..980dc914a 100644 --- a/README.ja.md +++ b/README.ja.md @@ -9,7 +9,7 @@ - +


diff --git a/README.ko.md b/README.ko.md index a677aaca4..269cfda49 100644 --- a/README.ko.md +++ b/README.ko.md @@ -9,7 +9,7 @@ - +


diff --git a/README.md b/README.md index 8ccaad64b..93c70a532 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ - +


diff --git a/README.pt_BR.md b/README.pt_BR.md index e32da8206..5cdd8ae13 100644 --- a/README.pt_BR.md +++ b/README.pt_BR.md @@ -10,7 +10,7 @@ - +


diff --git a/README.ro.md b/README.ro.md index fb5624630..a53019c9c 100644 --- a/README.ro.md +++ b/README.ro.md @@ -9,7 +9,7 @@ - +


diff --git a/README.so.md b/README.so.md index 31afbe475..ed42fde0d 100644 --- a/README.so.md +++ b/README.so.md @@ -9,7 +9,7 @@ - +


diff --git a/README.tr.md b/README.tr.md index bb9148af8..0bd644934 100644 --- a/README.tr.md +++ b/README.tr.md @@ -9,7 +9,7 @@ - +


From fd4408e572f5c5aacf5c74ace91ef7c1ed46c474 Mon Sep 17 00:00:00 2001 From: XiangRongLin <41164160+XiangRongLin@users.noreply.github.com> Date: Mon, 31 May 2021 12:36:21 +0200 Subject: [PATCH 39/72] Set ImportExportDataPath only on successful export --- .../settings/ContentSettingsFragment.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java b/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java index ab6ff7414..ef1558186 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java @@ -25,8 +25,8 @@ import org.schabi.newpipe.error.ReCaptchaActivity; import org.schabi.newpipe.extractor.NewPipe; import org.schabi.newpipe.extractor.localization.ContentCountry; import org.schabi.newpipe.extractor.localization.Localization; -import org.schabi.newpipe.util.FilePickerActivityHelper; import org.schabi.newpipe.util.FilePathUtils; +import org.schabi.newpipe.util.FilePickerActivityHelper; import org.schabi.newpipe.util.ZipHelper; import java.io.File; @@ -178,11 +178,9 @@ public class ContentSettingsFragment extends BasePreferenceFragment { && resultCode == Activity.RESULT_OK && data.getData() != null) { final File file = Utils.getFileForUri(data.getData()); final String path = file.getAbsolutePath(); - setImportExportDataPath(file); if (requestCode == REQUEST_EXPORT_PATH) { - final SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.US); - exportDatabase(path + "/NewPipeData-" + sdf.format(new Date()) + ".zip"); + exportDatabase(file); } else { final AlertDialog.Builder builder = new AlertDialog.Builder(requireActivity()); builder.setMessage(R.string.override_current_data) @@ -195,15 +193,21 @@ public class ContentSettingsFragment extends BasePreferenceFragment { } } - private void exportDatabase(final String path) { + private void exportDatabase(final File folder) { try { + final SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.US); + final String path = folder.getAbsolutePath() + "/NewPipeData-" + + sdf.format(new Date()) + ".zip"; + //checkpoint before export NewPipeDatabase.checkpoint(); final SharedPreferences preferences = PreferenceManager - .getDefaultSharedPreferences(requireContext()); + .getDefaultSharedPreferences(requireContext()); manager.exportDatabase(preferences, path); + setImportExportDataPath(folder); + Toast.makeText(getContext(), R.string.export_complete_toast, Toast.LENGTH_SHORT).show(); } catch (final Exception e) { ErrorActivity.reportUiErrorInSnackbar(this, "Exporting database", e); From f13a1b04e64d01d2337662b724ddff4b9ede54fc Mon Sep 17 00:00:00 2001 From: XiangRongLin <41164160+XiangRongLin@users.noreply.github.com> Date: Mon, 31 May 2021 12:38:21 +0200 Subject: [PATCH 40/72] Set ImportExportDataPath only on successful import Also set the folder instead of the file itself as path --- .../settings/ContentSettingsFragment.java | 34 +++++++++++++------ 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java b/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java index ef1558186..c77ca034f 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java @@ -177,7 +177,6 @@ public class ContentSettingsFragment extends BasePreferenceFragment { if ((requestCode == REQUEST_IMPORT_PATH || requestCode == REQUEST_EXPORT_PATH) && resultCode == Activity.RESULT_OK && data.getData() != null) { final File file = Utils.getFileForUri(data.getData()); - final String path = file.getAbsolutePath(); if (requestCode == REQUEST_EXPORT_PATH) { exportDatabase(file); @@ -185,7 +184,7 @@ public class ContentSettingsFragment extends BasePreferenceFragment { final AlertDialog.Builder builder = new AlertDialog.Builder(requireActivity()); builder.setMessage(R.string.override_current_data) .setPositiveButton(getString(R.string.finish), - (d, id) -> importDatabase(path)) + (d, id) -> importDatabase(file)) .setNegativeButton(android.R.string.cancel, (d, id) -> d.cancel()); builder.create().show(); @@ -214,11 +213,13 @@ public class ContentSettingsFragment extends BasePreferenceFragment { } } - private void importDatabase(final String filePath) { + private void importDatabase(final File file) { + final String filePath = file.getAbsolutePath(); + // check if file is supported if (!ZipHelper.isValidZipFile(filePath)) { Toast.makeText(getContext(), R.string.no_valid_zip_file, Toast.LENGTH_SHORT) - .show(); + .show(); return; } @@ -239,26 +240,37 @@ public class ContentSettingsFragment extends BasePreferenceFragment { alert.setNegativeButton(android.R.string.no, (dialog, which) -> { dialog.dismiss(); - // restart app to properly load db - System.exit(0); + finishImport(file); }); alert.setPositiveButton(getString(R.string.finish), (dialog, which) -> { dialog.dismiss(); manager.loadSharedPreferences(PreferenceManager - .getDefaultSharedPreferences(requireContext())); - // restart app to properly load db - System.exit(0); + .getDefaultSharedPreferences(requireContext())); + finishImport(file); }); alert.show(); } else { - // restart app to properly load db - System.exit(0); + finishImport(file); } } catch (final Exception e) { ErrorActivity.reportUiErrorInSnackbar(this, "Importing database", e); } } + /** + * Save import path and restart system. + * + * @param file The file of the created backup + */ + private void finishImport(final File file) { + if (file.getParentFile() != null) { + setImportExportDataPath(file.getParentFile()); + } + + // restart app to properly load db + System.exit(0); + } + private void setImportExportDataPath(final File file) { final String directoryPath; if (file.isDirectory()) { From 05eb0d0fbe7ffc13d6b9a431d0825c6ce6c8dc79 Mon Sep 17 00:00:00 2001 From: XiangRongLin <41164160+XiangRongLin@users.noreply.github.com> Date: Mon, 31 May 2021 12:40:14 +0200 Subject: [PATCH 41/72] Commit path immediately when import backup --- .../settings/ContentSettingsFragment.java | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java b/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java index c77ca034f..7b2b1aeb5 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java @@ -1,5 +1,6 @@ package org.schabi.newpipe.settings; +import android.annotation.SuppressLint; import android.app.Activity; import android.content.Context; import android.content.Intent; @@ -205,7 +206,7 @@ public class ContentSettingsFragment extends BasePreferenceFragment { .getDefaultSharedPreferences(requireContext()); manager.exportDatabase(preferences, path); - setImportExportDataPath(folder); + setImportExportDataPath(folder, false); Toast.makeText(getContext(), R.string.export_complete_toast, Toast.LENGTH_SHORT).show(); } catch (final Exception e) { @@ -230,7 +231,7 @@ public class ContentSettingsFragment extends BasePreferenceFragment { if (!manager.extractDb(filePath)) { Toast.makeText(getContext(), R.string.could_not_import_all_files, Toast.LENGTH_LONG) - .show(); + .show(); } //If settings file exist, ask if it should be imported. @@ -264,14 +265,16 @@ public class ContentSettingsFragment extends BasePreferenceFragment { */ private void finishImport(final File file) { if (file.getParentFile() != null) { - setImportExportDataPath(file.getParentFile()); + //immediately because app is about to exit + setImportExportDataPath(file.getParentFile(), true); } // restart app to properly load db System.exit(0); } - private void setImportExportDataPath(final File file) { + @SuppressLint("ApplySharedPref") + private void setImportExportDataPath(final File file, final boolean immediately) { final String directoryPath; if (file.isDirectory()) { directoryPath = file.getAbsolutePath(); @@ -283,6 +286,13 @@ public class ContentSettingsFragment extends BasePreferenceFragment { directoryPath = ""; } } - defaultPreferences.edit().putString(importExportDataPathKey, directoryPath).apply(); + final SharedPreferences.Editor editor = defaultPreferences + .edit() + .putString(importExportDataPathKey, directoryPath); + if (immediately) { + editor.commit(); + } else { + editor.apply(); + } } } From 004907d306f84bbe800b624e9af650f73989652b Mon Sep 17 00:00:00 2001 From: XiangRongLin <41164160+XiangRongLin@users.noreply.github.com> Date: Mon, 31 May 2021 15:09:57 +0200 Subject: [PATCH 42/72] Annotate methode parameters as NonNull --- .../schabi/newpipe/settings/ContentSettingsFragment.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java b/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java index 7b2b1aeb5..9af3666a6 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java @@ -193,7 +193,7 @@ public class ContentSettingsFragment extends BasePreferenceFragment { } } - private void exportDatabase(final File folder) { + private void exportDatabase(@NonNull final File folder) { try { final SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.US); final String path = folder.getAbsolutePath() + "/NewPipeData-" @@ -214,7 +214,7 @@ public class ContentSettingsFragment extends BasePreferenceFragment { } } - private void importDatabase(final File file) { + private void importDatabase(@NonNull final File file) { final String filePath = file.getAbsolutePath(); // check if file is supported @@ -263,7 +263,7 @@ public class ContentSettingsFragment extends BasePreferenceFragment { * * @param file The file of the created backup */ - private void finishImport(final File file) { + private void finishImport(@NonNull final File file) { if (file.getParentFile() != null) { //immediately because app is about to exit setImportExportDataPath(file.getParentFile(), true); @@ -274,7 +274,7 @@ public class ContentSettingsFragment extends BasePreferenceFragment { } @SuppressLint("ApplySharedPref") - private void setImportExportDataPath(final File file, final boolean immediately) { + private void setImportExportDataPath(@NonNull final File file, final boolean immediately) { final String directoryPath; if (file.isDirectory()) { directoryPath = file.getAbsolutePath(); From 142cde975fd55932d9b3ae2e8a15805fdebe4bad Mon Sep 17 00:00:00 2001 From: camo0112 <56369484+camo0112@users.noreply.github.com> Date: Tue, 1 Jun 2021 10:43:57 +0530 Subject: [PATCH 43/72] fixed channel description textView --- app/src/main/res/layout/list_channel_item.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/layout/list_channel_item.xml b/app/src/main/res/layout/list_channel_item.xml index baaddd814..6af6add2b 100644 --- a/app/src/main/res/layout/list_channel_item.xml +++ b/app/src/main/res/layout/list_channel_item.xml @@ -34,11 +34,12 @@ android:layout_height="wrap_content" android:layout_marginBottom="@dimen/channel_item_description_to_details_margin" android:ellipsize="end" - android:lines="2" + android:maxLines="2" android:textAppearance="?android:attr/textAppearanceSmall" android:textSize="@dimen/video_item_search_uploader_text_size" app:layout_constraintBottom_toTopOf="@+id/itemAdditionalDetails" - app:layout_constraintLeft_toLeftOf="@+id/itemTitleView" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="@+id/itemTitleView" app:layout_constraintTop_toBottomOf="@+id/itemTitleView" tools:text="Channel description, Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc tristique vitae sem vitae blanditLorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc tristique vitae sem vitae blanditLorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc tristique vitae sem vitae blandit" /> From ffad244e1efef08ece0ecfe808ada63ea9b014b6 Mon Sep 17 00:00:00 2001 From: mhmdanas <32234660+mhmdanas@users.noreply.github.com> Date: Wed, 2 Jun 2021 01:14:43 +0300 Subject: [PATCH 44/72] Upgrade PrettyTime to 5.0.1 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 0a4ece481..f9409d222 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -258,7 +258,7 @@ dependencies { implementation "com.jakewharton.rxbinding4:rxbinding:4.0.0" // Date and time formatting - implementation "org.ocpsoft.prettytime:prettytime:5.0.0.Final" + implementation "org.ocpsoft.prettytime:prettytime:5.0.1.Final" /** Debugging **/ // Memory leak detection From 997267bad1867a12d23d99d54c5ac214995d324f Mon Sep 17 00:00:00 2001 From: Stypox Date: Sun, 28 Mar 2021 23:17:20 +0200 Subject: [PATCH 45/72] Show video metadata below the decription --- .../fragments/detail/DescriptionFragment.java | 103 +++++++++++++++++- .../main/res/layout/fragment_description.xml | 22 +++- app/src/main/res/layout/item_metadata.xml | 44 ++++++++ app/src/main/res/values/strings.xml | 15 ++- 4 files changed, 177 insertions(+), 7 deletions(-) create mode 100644 app/src/main/res/layout/item_metadata.xml diff --git a/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java index b4424928f..b44841fdb 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java @@ -4,14 +4,18 @@ import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.LinearLayout; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.annotation.StringRes; import androidx.core.text.HtmlCompat; import org.schabi.newpipe.BaseFragment; +import org.schabi.newpipe.R; import org.schabi.newpipe.databinding.FragmentDescriptionBinding; +import org.schabi.newpipe.databinding.ItemMetadataBinding; import org.schabi.newpipe.extractor.stream.Description; import org.schabi.newpipe.extractor.stream.StreamInfo; import org.schabi.newpipe.util.Localization; @@ -21,6 +25,8 @@ import icepick.State; import io.reactivex.rxjava3.disposables.Disposable; import static android.text.TextUtils.isEmpty; +import static org.schabi.newpipe.extractor.stream.StreamExtractor.NO_AGE_LIMIT; +import static org.schabi.newpipe.extractor.utils.Utils.isBlank; public class DescriptionFragment extends BaseFragment { @@ -45,6 +51,7 @@ public class DescriptionFragment extends BaseFragment { if (streamInfo != null) { setupUploadDate(binding.detailUploadDateView); setupDescription(binding.detailDescriptionView); + setupMetadata(inflater, binding.detailMetadataLayout); } return binding.getRoot(); } @@ -70,7 +77,7 @@ public class DescriptionFragment extends BaseFragment { final Description description = streamInfo.getDescription(); if (description == null || isEmpty(description.getContent()) || description == Description.emptyDescription) { - descriptionTextView.setText(""); + descriptionTextView.setVisibility(View.GONE); return; } @@ -90,4 +97,98 @@ public class DescriptionFragment extends BaseFragment { break; } } + + private void setupMetadata(final LayoutInflater inflater, + final LinearLayout layout) { + addMetadataItem(inflater, layout, false, + R.string.metadata_category, streamInfo.getCategory()); + + addTagsMetadataItem(inflater, layout); + + addMetadataItem(inflater, layout, false, + R.string.metadata_licence, streamInfo.getLicence()); + + addPrivacyMetadataItem(inflater, layout); + + if (streamInfo.getAgeLimit() != NO_AGE_LIMIT) { + addMetadataItem(inflater, layout, false, + R.string.metadata_age_limit, String.valueOf(streamInfo.getAgeLimit())); + } + + if (streamInfo.getLanguageInfo() != null) { + addMetadataItem(inflater, layout, false, + R.string.metadata_language, streamInfo.getLanguageInfo().getDisplayLanguage()); + } + + addMetadataItem(inflater, layout, true, + R.string.metadata_support, streamInfo.getSupportInfo()); + addMetadataItem(inflater, layout, true, + R.string.metadata_host, streamInfo.getHost()); + addMetadataItem(inflater, layout, true, + R.string.metadata_thumbnail_url, streamInfo.getThumbnailUrl()); + } + + private void addMetadataItem(final LayoutInflater inflater, + final LinearLayout layout, + final boolean linkifyContent, + @StringRes final int type, + @Nullable final String content) { + if (isBlank(content)) { + return; + } + + final ItemMetadataBinding binding = ItemMetadataBinding.inflate(inflater, layout, false); + binding.metadataTypeView.setText(type); + + if (linkifyContent) { + TextLinkifier.createLinksFromPlainText(layout.getContext(), content, + binding.metadataContentView); + } else { + binding.metadataContentView.setText(content); + } + + layout.addView(binding.getRoot()); + } + + private void addTagsMetadataItem(final LayoutInflater inflater, final LinearLayout layout) { + if (streamInfo.getTags() != null && !streamInfo.getTags().isEmpty()) { + final StringBuilder tags = new StringBuilder(); + for (int i = 0; i < streamInfo.getTags().size(); ++i) { + if (i != 0) { + tags.append(", "); + } + tags.append(streamInfo.getTags().get(i)); + } + + addMetadataItem(inflater, layout, false, R.string.metadata_tags, tags.toString()); + } + } + + private void addPrivacyMetadataItem(final LayoutInflater inflater, final LinearLayout layout) { + if (streamInfo.getPrivacy() != null) { + @StringRes final int contentRes; + switch (streamInfo.getPrivacy()) { + case PUBLIC: + contentRes = R.string.metadata_privacy_public; + break; + case UNLISTED: + contentRes = R.string.metadata_privacy_unlisted; + break; + case PRIVATE: + contentRes = R.string.metadata_privacy_private; + break; + case INTERNAL: + contentRes = R.string.metadata_privacy_internal; + break; + case OTHER: default: + contentRes = 0; + break; + } + + if (contentRes != 0) { + addMetadataItem(inflater, layout, false, + R.string.metadata_privacy, layout.getContext().getString(contentRes)); + } + } + } } diff --git a/app/src/main/res/layout/fragment_description.xml b/app/src/main/res/layout/fragment_description.xml index e3845e892..e079e41fe 100644 --- a/app/src/main/res/layout/fragment_description.xml +++ b/app/src/main/res/layout/fragment_description.xml @@ -2,10 +2,10 @@ + android:layout_height="wrap_content" + android:orientation="vertical" + android:scrollbars="vertical"> + + diff --git a/app/src/main/res/layout/item_metadata.xml b/app/src/main/res/layout/item_metadata.xml new file mode 100644 index 000000000..441b916e8 --- /dev/null +++ b/app/src/main/res/layout/item_metadata.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b8ca33c87..f614b6b64 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -716,4 +716,17 @@ Select your favorite night theme — %s You can select your favorite night theme below Download has started - \ No newline at end of file + Category + Tags + Licence + Privacy + Age limit + Language + Support + Host + Thumbnail URL + Public + Unlisted + Private + Internal + From d0d5373be927f19f0ab1e5d8fe55b99bcb76ccec Mon Sep 17 00:00:00 2001 From: Stypox Date: Wed, 31 Mar 2021 21:29:59 +0200 Subject: [PATCH 46/72] Allow copying metadata to clipboard --- .../schabi/newpipe/fragments/detail/DescriptionFragment.java | 5 +++++ app/src/main/res/layout/item_metadata.xml | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java index b44841fdb..df16ee7f4 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java @@ -19,6 +19,7 @@ import org.schabi.newpipe.databinding.ItemMetadataBinding; import org.schabi.newpipe.extractor.stream.Description; import org.schabi.newpipe.extractor.stream.StreamInfo; import org.schabi.newpipe.util.Localization; +import org.schabi.newpipe.util.ShareUtils; import org.schabi.newpipe.util.TextLinkifier; import icepick.State; @@ -139,6 +140,10 @@ public class DescriptionFragment extends BaseFragment { final ItemMetadataBinding binding = ItemMetadataBinding.inflate(inflater, layout, false); binding.metadataTypeView.setText(type); + binding.metadataTypeView.setOnLongClickListener(v -> { + ShareUtils.copyToClipboard(requireContext(), content); + return true; + }); if (linkifyContent) { TextLinkifier.createLinksFromPlainText(layout.getContext(), content, diff --git a/app/src/main/res/layout/item_metadata.xml b/app/src/main/res/layout/item_metadata.xml index 441b916e8..4da962d5c 100644 --- a/app/src/main/res/layout/item_metadata.xml +++ b/app/src/main/res/layout/item_metadata.xml @@ -15,10 +15,10 @@ Date: Thu, 1 Apr 2021 16:43:31 +0200 Subject: [PATCH 47/72] Add button to allow selecting text in the description Since now selection is disabled by default, this fixes #5453 --- .../fragments/detail/DescriptionFragment.java | 86 ++++++++++++++----- .../main/res/drawable-night/ic_select_all.xml | 10 +++ app/src/main/res/drawable/ic_select_all.xml | 10 +++ .../main/res/layout/fragment_description.xml | 56 ++++++++++-- app/src/main/res/values/strings.xml | 3 + 5 files changed, 136 insertions(+), 29 deletions(-) create mode 100644 app/src/main/res/drawable-night/ic_select_all.xml create mode 100644 app/src/main/res/drawable/ic_select_all.xml diff --git a/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java index df16ee7f4..034738d37 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java @@ -5,11 +5,11 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; -import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.StringRes; +import androidx.appcompat.widget.TooltipCompat; import androidx.core.text.HtmlCompat; import org.schabi.newpipe.BaseFragment; @@ -35,6 +35,7 @@ public class DescriptionFragment extends BaseFragment { StreamInfo streamInfo = null; @Nullable Disposable descriptionDisposable = null; + FragmentDescriptionBinding binding; public DescriptionFragment() { } @@ -47,11 +48,10 @@ public class DescriptionFragment extends BaseFragment { public View onCreateView(@NonNull final LayoutInflater inflater, @Nullable final ViewGroup container, @Nullable final Bundle savedInstanceState) { - final FragmentDescriptionBinding binding = - FragmentDescriptionBinding.inflate(inflater, container, false); + binding = FragmentDescriptionBinding.inflate(inflater, container, false); if (streamInfo != null) { - setupUploadDate(binding.detailUploadDateView); - setupDescription(binding.detailDescriptionView); + setupUploadDate(); + setupDescription(); setupMetadata(inflater, binding.detailMetadataLayout); } return binding.getRoot(); @@ -65,40 +65,82 @@ public class DescriptionFragment extends BaseFragment { } } - private void setupUploadDate(final TextView uploadDateTextView) { + + private void setupUploadDate() { if (streamInfo.getUploadDate() != null) { - uploadDateTextView.setText(Localization + binding.detailUploadDateView.setText(Localization .localizeUploadDate(activity, streamInfo.getUploadDate().offsetDateTime())); } else { - uploadDateTextView.setVisibility(View.GONE); + binding.detailUploadDateView.setVisibility(View.GONE); } } - private void setupDescription(final TextView descriptionTextView) { + + private void setupDescription() { final Description description = streamInfo.getDescription(); if (description == null || isEmpty(description.getContent()) || description == Description.emptyDescription) { - descriptionTextView.setVisibility(View.GONE); + binding.detailDescriptionView.setVisibility(View.GONE); + binding.detailSelectDescriptionButton.setVisibility(View.GONE); return; } + // start with disabled state. This also loads description content (!) + disableDescriptionSelection(); + + binding.detailSelectDescriptionButton.setOnClickListener(v -> { + if (binding.detailDescriptionNoteView.getVisibility() == View.VISIBLE) { + disableDescriptionSelection(); + } else { + // enable selection only when button is clicked to prevent flickering + enableDescriptionSelection(); + } + }); + } + + private void enableDescriptionSelection() { + binding.detailDescriptionNoteView.setVisibility(View.VISIBLE); + binding.detailDescriptionView.setTextIsSelectable(true); + + final String buttonLabel = getString(R.string.description_select_disable); + binding.detailSelectDescriptionButton.setContentDescription(buttonLabel); + TooltipCompat.setTooltipText(binding.detailSelectDescriptionButton, buttonLabel); + binding.detailSelectDescriptionButton.setImageResource(R.drawable.ic_close); + } + + private void disableDescriptionSelection() { + // show description content again, otherwise some links are not clickable + loadDescriptionContent(); + + binding.detailDescriptionNoteView.setVisibility(View.GONE); + binding.detailDescriptionView.setTextIsSelectable(false); + + final String buttonLabel = getString(R.string.description_select_enable); + binding.detailSelectDescriptionButton.setContentDescription(buttonLabel); + TooltipCompat.setTooltipText(binding.detailSelectDescriptionButton, buttonLabel); + binding.detailSelectDescriptionButton.setImageResource(R.drawable.ic_select_all); + } + + private void loadDescriptionContent() { + final Description description = streamInfo.getDescription(); switch (description.getType()) { case Description.HTML: descriptionDisposable = TextLinkifier.createLinksFromHtmlBlock(requireContext(), - description.getContent(), descriptionTextView, + description.getContent(), binding.detailDescriptionView, HtmlCompat.FROM_HTML_MODE_LEGACY); break; case Description.MARKDOWN: descriptionDisposable = TextLinkifier.createLinksFromMarkdownText(requireContext(), - description.getContent(), descriptionTextView); + description.getContent(), binding.detailDescriptionView); break; case Description.PLAIN_TEXT: default: descriptionDisposable = TextLinkifier.createLinksFromPlainText(requireContext(), - description.getContent(), descriptionTextView); + description.getContent(), binding.detailDescriptionView); break; } } + private void setupMetadata(final LayoutInflater inflater, final LinearLayout layout) { addMetadataItem(inflater, layout, false, @@ -138,21 +180,23 @@ public class DescriptionFragment extends BaseFragment { return; } - final ItemMetadataBinding binding = ItemMetadataBinding.inflate(inflater, layout, false); - binding.metadataTypeView.setText(type); - binding.metadataTypeView.setOnLongClickListener(v -> { + final ItemMetadataBinding itemBinding + = ItemMetadataBinding.inflate(inflater, layout, false); + + itemBinding.metadataTypeView.setText(type); + itemBinding.metadataTypeView.setOnLongClickListener(v -> { ShareUtils.copyToClipboard(requireContext(), content); return true; }); if (linkifyContent) { - TextLinkifier.createLinksFromPlainText(layout.getContext(), content, - binding.metadataContentView); + TextLinkifier.createLinksFromPlainText(requireContext(), + content, itemBinding.metadataContentView); } else { - binding.metadataContentView.setText(content); + itemBinding.metadataContentView.setText(content); } - layout.addView(binding.getRoot()); + layout.addView(itemBinding.getRoot()); } private void addTagsMetadataItem(final LayoutInflater inflater, final LinearLayout layout) { @@ -192,7 +236,7 @@ public class DescriptionFragment extends BaseFragment { if (contentRes != 0) { addMetadataItem(inflater, layout, false, - R.string.metadata_privacy, layout.getContext().getString(contentRes)); + R.string.metadata_privacy, getString(contentRes)); } } } diff --git a/app/src/main/res/drawable-night/ic_select_all.xml b/app/src/main/res/drawable-night/ic_select_all.xml new file mode 100644 index 000000000..157734911 --- /dev/null +++ b/app/src/main/res/drawable-night/ic_select_all.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_select_all.xml b/app/src/main/res/drawable/ic_select_all.xml new file mode 100644 index 000000000..e8693d51b --- /dev/null +++ b/app/src/main/res/drawable/ic_select_all.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/layout/fragment_description.xml b/app/src/main/res/layout/fragment_description.xml index e079e41fe..e4622a85f 100644 --- a/app/src/main/res/layout/fragment_description.xml +++ b/app/src/main/res/layout/fragment_description.xml @@ -9,7 +9,8 @@ + android:layout_height="wrap_content" + android:animateLayoutChanges="true"> + + + + + + Select your favorite night theme — %s You can select your favorite night theme below Download has started + You can now select text inside the description. Note that the page may flicker and links may not be clickable while in selection mode. + Enable selecting text in the description + Disable selecting text in the description Category Tags Licence From 14256137e8ac2ed871b355a8e5bd7ab9ffc44465 Mon Sep 17 00:00:00 2001 From: Stypox Date: Wed, 2 Jun 2021 16:09:21 +0200 Subject: [PATCH 48/72] Use chips to show tags in metadata section Clicking on chips opens the search fragment Long clicking copies to clipboard --- .../fragments/detail/DescriptionFragment.java | 34 +++++++++++--- app/src/main/res/layout/chip.xml | 9 ++++ .../main/res/layout/fragment_description.xml | 4 +- app/src/main/res/layout/item_metadata.xml | 14 +++--- .../main/res/layout/item_metadata_tags.xml | 45 +++++++++++++++++++ 5 files changed, 89 insertions(+), 17 deletions(-) create mode 100644 app/src/main/res/layout/chip.xml create mode 100644 app/src/main/res/layout/item_metadata_tags.xml diff --git a/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java index 034738d37..bbff26cc4 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java @@ -12,13 +12,17 @@ import androidx.annotation.StringRes; import androidx.appcompat.widget.TooltipCompat; import androidx.core.text.HtmlCompat; +import com.google.android.material.chip.Chip; + import org.schabi.newpipe.BaseFragment; import org.schabi.newpipe.R; import org.schabi.newpipe.databinding.FragmentDescriptionBinding; import org.schabi.newpipe.databinding.ItemMetadataBinding; +import org.schabi.newpipe.databinding.ItemMetadataTagsBinding; import org.schabi.newpipe.extractor.stream.Description; import org.schabi.newpipe.extractor.stream.StreamInfo; import org.schabi.newpipe.util.Localization; +import org.schabi.newpipe.util.NavigationHelper; import org.schabi.newpipe.util.ShareUtils; import org.schabi.newpipe.util.TextLinkifier; @@ -201,18 +205,34 @@ public class DescriptionFragment extends BaseFragment { private void addTagsMetadataItem(final LayoutInflater inflater, final LinearLayout layout) { if (streamInfo.getTags() != null && !streamInfo.getTags().isEmpty()) { - final StringBuilder tags = new StringBuilder(); - for (int i = 0; i < streamInfo.getTags().size(); ++i) { - if (i != 0) { - tags.append(", "); - } - tags.append(streamInfo.getTags().get(i)); + final ItemMetadataTagsBinding itemBinding + = ItemMetadataTagsBinding.inflate(inflater, layout, false); + + for (final String tag : streamInfo.getTags()) { + final Chip chip = (Chip) inflater.inflate(R.layout.chip, + itemBinding.metadataTagsChips, false); + chip.setText(tag); + chip.setOnClickListener(this::onTagClick); + chip.setOnLongClickListener(this::onTagLongClick); + itemBinding.metadataTagsChips.addView(chip); } - addMetadataItem(inflater, layout, false, R.string.metadata_tags, tags.toString()); + layout.addView(itemBinding.getRoot()); } } + private void onTagClick(final View chip) { + if (getParentFragment() != null) { + NavigationHelper.openSearchFragment(getParentFragment().getParentFragmentManager(), + streamInfo.getServiceId(), ((Chip) chip).getText().toString()); + } + } + + private boolean onTagLongClick(final View chip) { + ShareUtils.copyToClipboard(requireContext(), ((Chip) chip).getText().toString()); + return true; + } + private void addPrivacyMetadataItem(final LayoutInflater inflater, final LinearLayout layout) { if (streamInfo.getPrivacy() != null) { @StringRes final int contentRes; diff --git a/app/src/main/res/layout/chip.xml b/app/src/main/res/layout/chip.xml new file mode 100644 index 000000000..f7a55fdf3 --- /dev/null +++ b/app/src/main/res/layout/chip.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_description.xml b/app/src/main/res/layout/fragment_description.xml index e4622a85f..c44b88cb6 100644 --- a/app/src/main/res/layout/fragment_description.xml +++ b/app/src/main/res/layout/fragment_description.xml @@ -88,9 +88,9 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="16dp" - android:layout_marginTop="8dp" + android:layout_marginTop="10dp" android:layout_marginEnd="16dp" - android:layout_marginBottom="16dp" + android:layout_marginBottom="10dp" android:orientation="vertical" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" diff --git a/app/src/main/res/layout/item_metadata.xml b/app/src/main/res/layout/item_metadata.xml index 4da962d5c..b9015e603 100644 --- a/app/src/main/res/layout/item_metadata.xml +++ b/app/src/main/res/layout/item_metadata.xml @@ -1,23 +1,23 @@ + android:paddingTop="6dp" + android:paddingBottom="6dp"> + app:layout_constraintGuide_percent="0.23" /> - \ No newline at end of file diff --git a/app/src/main/res/layout/item_metadata_tags.xml b/app/src/main/res/layout/item_metadata_tags.xml new file mode 100644 index 000000000..cd0b8c42d --- /dev/null +++ b/app/src/main/res/layout/item_metadata_tags.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + \ No newline at end of file From fe7536e3743ec86ba2e969655659a5b7cc9fd141 Mon Sep 17 00:00:00 2001 From: TiA4f8R <74829229+TiA4f8R@users.noreply.github.com> Date: Wed, 2 Jun 2021 18:27:08 +0200 Subject: [PATCH 49/72] Change NewPipe IRC links in the contribution guidelines (#6415) * Change NewPipe IRC links in the contribution guidelines * Remove redundant line break Co-authored-by: opusforlife2 <53176348+opusforlife2@users.noreply.github.com> Co-authored-by: Mohammed Anas <32234660+mhmdanas@users.noreply.github.com> Co-authored-by: opusforlife2 <53176348+opusforlife2@users.noreply.github.com> --- .github/CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index ecaf94d5d..f6c3ae65a 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -41,6 +41,6 @@ You'll see exactly what is sent, be able to add your comments, and then send it. ## Communication -* The [#newpipe](irc:irc.freenode.net/newpipe) channel on freenode has the core team and other developers in it. [Click here for webchat](https://webchat.freenode.net/?channels=newpipe)! -* You can also use a Matrix account to join the Newpipe channel at [#freenode_#newpipe:matrix.org](https://matrix.to/#/#freenode_#newpipe:matrix.org). +* The #newpipe channel on Libera Chat (`ircs://irc.libera.chat:6697/newpipe`) has the core team and other developers in it. [Click here for webchat](https://web.libera.chat/#newpipe)! +* You can also use a Matrix account to join the NewPipe channel at [#newpipe:libera.chat](https://matrix.to/#/#newpipe:libera.chat). * Post suggestions, changes, ideas etc. on GitHub or IRC. From d025ef11f8e72f083fd91c8436a29c438f384bc0 Mon Sep 17 00:00:00 2001 From: Stypox Date: Wed, 2 Jun 2021 16:15:53 +0200 Subject: [PATCH 50/72] Sort tags in metadata section --- .../newpipe/fragments/detail/DescriptionFragment.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java index bbff26cc4..5f1cbc365 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java @@ -26,6 +26,10 @@ import org.schabi.newpipe.util.NavigationHelper; import org.schabi.newpipe.util.ShareUtils; import org.schabi.newpipe.util.TextLinkifier; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + import icepick.State; import io.reactivex.rxjava3.disposables.Disposable; @@ -208,7 +212,9 @@ public class DescriptionFragment extends BaseFragment { final ItemMetadataTagsBinding itemBinding = ItemMetadataTagsBinding.inflate(inflater, layout, false); - for (final String tag : streamInfo.getTags()) { + final List tags = new ArrayList<>(streamInfo.getTags()); + Collections.sort(tags); + for (final String tag : tags) { final Chip chip = (Chip) inflater.inflate(R.layout.chip, itemBinding.metadataTagsChips, false); chip.setText(tag); From 9e94c81ef2b34b19a975384d872d3d97263cb3cb Mon Sep 17 00:00:00 2001 From: Stypox Date: Wed, 2 Jun 2021 21:19:57 +0200 Subject: [PATCH 51/72] Always show scrollbars for metadata tags --- app/src/main/res/layout/item_metadata_tags.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/res/layout/item_metadata_tags.xml b/app/src/main/res/layout/item_metadata_tags.xml index cd0b8c42d..d887c9e28 100644 --- a/app/src/main/res/layout/item_metadata_tags.xml +++ b/app/src/main/res/layout/item_metadata_tags.xml @@ -30,6 +30,7 @@ android:layout_marginStart="16dp" android:layout_marginTop="-8dp" android:layout_marginBottom="-8dp" + android:fadeScrollbars="false" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="@+id/guideline" From b9aaafdb30324b7460e73170eedfbd20ebf4a167 Mon Sep 17 00:00:00 2001 From: TiA4f8R <74829229+TiA4f8R@users.noreply.github.com> Date: Thu, 13 May 2021 12:49:34 +0200 Subject: [PATCH 52/72] Add Open in browser option to long-press menu Add Open in browser option to long-press menu when long pressing a stream and a subscription --- .../org/schabi/newpipe/fragments/list/BaseListFragment.java | 2 +- .../newpipe/local/subscription/SubscriptionFragment.kt | 6 ++++-- .../java/org/schabi/newpipe/util/StreamDialogEntry.java | 5 ++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/BaseListFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/BaseListFragment.java index 38fdbccab..728558685 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/BaseListFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/BaseListFragment.java @@ -370,10 +370,10 @@ public abstract class BaseListFragment extends BaseStateFragment StreamDialogEntry.share )); } + entries.add(StreamDialogEntry.open_in_browser); if (KoreUtil.shouldShowPlayWithKodi(context, item.getServiceId())) { entries.add(StreamDialogEntry.play_with_kodi); } - if (!isNullOrEmpty(item.getUploaderUrl())) { entries.add(StreamDialogEntry.show_channel_details); } diff --git a/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionFragment.kt b/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionFragment.kt index d3f80e214..13643af15 100644 --- a/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionFragment.kt +++ b/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionFragment.kt @@ -294,12 +294,14 @@ class SubscriptionFragment : BaseStateFragment() { } private fun showLongTapDialog(selectedItem: ChannelInfoItem) { - val commands = arrayOf(getString(R.string.share), getString(R.string.unsubscribe)) + val commands = arrayOf(getString(R.string.share), getString(R.string.open_in_browser), + getString(R.string.unsubscribe)) val actions = DialogInterface.OnClickListener { _, i -> when (i) { 0 -> ShareUtils.shareText(requireContext(), selectedItem.name, selectedItem.url) - 1 -> deleteChannel(selectedItem) + 1 -> ShareUtils.openUrlInBrowser(requireContext(), selectedItem.url) + 2 -> deleteChannel(selectedItem) } } diff --git a/app/src/main/java/org/schabi/newpipe/util/StreamDialogEntry.java b/app/src/main/java/org/schabi/newpipe/util/StreamDialogEntry.java index 2d59febc2..b7629fac3 100644 --- a/app/src/main/java/org/schabi/newpipe/util/StreamDialogEntry.java +++ b/app/src/main/java/org/schabi/newpipe/util/StreamDialogEntry.java @@ -87,7 +87,10 @@ public enum StreamDialogEntry { }), share(R.string.share, (fragment, item) -> - ShareUtils.shareText(fragment.getContext(), item.getName(), item.getUrl())); + ShareUtils.shareText(fragment.getContext(), item.getName(), item.getUrl())), + + open_in_browser(R.string.open_in_browser, (fragment, item) -> + ShareUtils.openUrlInBrowser(fragment.getContext(), item.getUrl())); /////////////// From b4d60154646eb06df1d1219a46685ee5ae1105d3 Mon Sep 17 00:00:00 2001 From: TiA4f8R <74829229+TiA4f8R@users.noreply.github.com> Date: Thu, 13 May 2021 17:45:51 +0200 Subject: [PATCH 53/72] Add the Open in browser option when long-pressing a stream for local and online playlists and for history --- .../schabi/newpipe/fragments/list/playlist/PlaylistFragment.java | 1 + .../schabi/newpipe/local/history/StatisticsPlaylistFragment.java | 1 + .../org/schabi/newpipe/local/playlist/LocalPlaylistFragment.java | 1 + 3 files changed, 3 insertions(+) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/playlist/PlaylistFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/playlist/PlaylistFragment.java index 1ede515ba..0e36d18c7 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/playlist/PlaylistFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/playlist/PlaylistFragment.java @@ -161,6 +161,7 @@ public class PlaylistFragment extends BaseListInfoFragment { StreamDialogEntry.share )); } + entries.add(StreamDialogEntry.open_in_browser); if (KoreUtil.shouldShowPlayWithKodi(context, item.getServiceId())) { entries.add(StreamDialogEntry.play_with_kodi); } diff --git a/app/src/main/java/org/schabi/newpipe/local/history/StatisticsPlaylistFragment.java b/app/src/main/java/org/schabi/newpipe/local/history/StatisticsPlaylistFragment.java index a6877a9a0..10aa8aa68 100644 --- a/app/src/main/java/org/schabi/newpipe/local/history/StatisticsPlaylistFragment.java +++ b/app/src/main/java/org/schabi/newpipe/local/history/StatisticsPlaylistFragment.java @@ -358,6 +358,7 @@ public class StatisticsPlaylistFragment StreamDialogEntry.share )); } + entries.add(StreamDialogEntry.open_in_browser); if (KoreUtil.shouldShowPlayWithKodi(context, infoItem.getServiceId())) { entries.add(StreamDialogEntry.play_with_kodi); } diff --git a/app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistFragment.java b/app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistFragment.java index 4c2f80edc..f79282641 100644 --- a/app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistFragment.java +++ b/app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistFragment.java @@ -769,6 +769,7 @@ public class LocalPlaylistFragment extends BaseLocalListFragment Date: Thu, 3 Jun 2021 14:40:00 +0200 Subject: [PATCH 54/72] Using Localization.shortCount() and old likeCount --- .../newpipe/info_list/holder/CommentsMiniInfoItemHolder.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/info_list/holder/CommentsMiniInfoItemHolder.java b/app/src/main/java/org/schabi/newpipe/info_list/holder/CommentsMiniInfoItemHolder.java index b106e029d..ae7ddfd63 100644 --- a/app/src/main/java/org/schabi/newpipe/info_list/holder/CommentsMiniInfoItemHolder.java +++ b/app/src/main/java/org/schabi/newpipe/info_list/holder/CommentsMiniInfoItemHolder.java @@ -137,7 +137,10 @@ public class CommentsMiniInfoItemHolder extends InfoItemHolder { } if (item.getLikeCount() >= 0) { - itemLikesCountView.setText(String.valueOf(item.getLikeCount())); + itemLikesCountView.setText( + Localization.shortCount( + itemBuilder.getContext(), + item.getLikeCount())); } else { itemLikesCountView.setText("-"); } From 8ed8b94ec742d4fac523b2ecc55e600dcd2fbbbe Mon Sep 17 00:00:00 2001 From: TobiGr Date: Fri, 4 Jun 2021 16:20:20 +0200 Subject: [PATCH 55/72] Update extractor version to ff11c2df2a22cc10d9fd7e59538d10ca7ccbaffb --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 0a4ece481..88b3263d9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -183,7 +183,7 @@ dependencies { /** NewPipe libraries **/ // You can use a local version by uncommenting a few lines in settings.gradle implementation 'com.github.TeamNewPipe:nanojson:1d9e1aea9049fc9f85e68b43ba39fe7be1c1f751' - implementation 'com.github.TeamNewPipe:NewPipeExtractor:v0.21.3' + implementation 'com.github.TeamNewPipe:NewPipeExtractor:ff11c2df2a22cc10d9fd7e59538d10ca7ccbaffb' /** Checkstyle **/ checkstyle "com.puppycrawl.tools:checkstyle:${checkstyleVersion}" From 98fdbec4429c7843262fe164fa6db3bb3aaa099a Mon Sep 17 00:00:00 2001 From: TobiGr Date: Sat, 5 Jun 2021 12:24:53 +0200 Subject: [PATCH 56/72] Fix playback speed not being updated in PlayQueuAcitvity Fixes #6419 --- .../java/org/schabi/newpipe/player/PlayQueueActivity.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/PlayQueueActivity.java b/app/src/main/java/org/schabi/newpipe/player/PlayQueueActivity.java index 08a2762a9..29c9ac77b 100644 --- a/app/src/main/java/org/schabi/newpipe/player/PlayQueueActivity.java +++ b/app/src/main/java/org/schabi/newpipe/player/PlayQueueActivity.java @@ -15,6 +15,7 @@ import android.view.ViewGroup; import android.widget.PopupMenu; import android.widget.SeekBar; +import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import androidx.recyclerview.widget.ItemTouchHelper; import androidx.recyclerview.widget.LinearLayoutManager; @@ -456,6 +457,7 @@ public final class PlayQueueActivity extends AppCompatActivity final boolean playbackSkipSilence) { if (player != null) { player.setPlaybackParameters(playbackTempo, playbackPitch, playbackSkipSilence); + onPlaybackParameterChanged(player.getPlaybackParameters()); } } @@ -639,7 +641,7 @@ public final class PlayQueueActivity extends AppCompatActivity queueControlBinding.controlShuffle.setImageAlpha(shuffleAlpha); } - private void onPlaybackParameterChanged(final PlaybackParameters parameters) { + private void onPlaybackParameterChanged(@Nullable final PlaybackParameters parameters) { if (parameters != null) { if (menu != null && player != null) { final MenuItem item = menu.findItem(R.id.action_playback_speed); From 9fc3ddeab783930062686f41640eb58170d3a6c0 Mon Sep 17 00:00:00 2001 From: TiA4f8R <74829229+TiA4f8R@users.noreply.github.com> Date: Sat, 5 Jun 2021 12:48:34 +0200 Subject: [PATCH 57/72] Fix Play with Kodi button in Player always prompts to install Kore --- app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java b/app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java index df804136a..106399735 100644 --- a/app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java +++ b/app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java @@ -596,6 +596,7 @@ public final class NavigationHelper { final Intent intent = new Intent(Intent.ACTION_VIEW); intent.setPackage(context.getString(R.string.kore_package)); intent.setData(videoURL); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(intent); } } From 25130db371b48452d4d5553c5f7c582d32382052 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Sat, 5 Jun 2021 16:08:27 +0200 Subject: [PATCH 58/72] Translated using Weblate (German) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently translated at 56.0% (28 of 50 strings) Translated using Weblate (Russian) Currently translated at 100.0% (657 of 657 strings) Translated using Weblate (German) Currently translated at 100.0% (657 of 657 strings) Translated using Weblate (Interlingua) Currently translated at 40.0% (263 of 657 strings) Translated using Weblate (Chinese (Traditional)) Currently translated at 100.0% (657 of 657 strings) Translated using Weblate (Indonesian) Currently translated at 100.0% (657 of 657 strings) Translated using Weblate (Indonesian) Currently translated at 100.0% (657 of 657 strings) Translated using Weblate (Slovak) Currently translated at 100.0% (657 of 657 strings) Translated using Weblate (Dutch) Currently translated at 100.0% (657 of 657 strings) Translated using Weblate (Hebrew) Currently translated at 100.0% (657 of 657 strings) Translated using Weblate (Chinese (Simplified)) Currently translated at 100.0% (657 of 657 strings) Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (657 of 657 strings) Translated using Weblate (Arabic) Currently translated at 100.0% (657 of 657 strings) Translated using Weblate (Greek) Currently translated at 99.8% (656 of 657 strings) Translated using Weblate (Italian) Currently translated at 100.0% (657 of 657 strings) Translated using Weblate (Russian) Currently translated at 98.9% (650 of 657 strings) Translated using Weblate (French) Currently translated at 99.8% (656 of 657 strings) Translated using Weblate (German) Currently translated at 98.9% (650 of 657 strings) Translated using Weblate (English) Currently translated at 100.0% (657 of 657 strings) Translated using Weblate (Interlingua) Currently translated at 34.6% (222 of 641 strings) Translated using Weblate (Serbian) Currently translated at 100.0% (641 of 641 strings) Translated using Weblate (Serbian) Currently translated at 16.0% (8 of 50 strings) Translated using Weblate (Odia) Currently translated at 4.2% (27 of 641 strings) Translated using Weblate (Odia) Currently translated at 2.0% (1 of 50 strings) Translated using Weblate (Dutch (Belgium)) Currently translated at 99.3% (637 of 641 strings) Translated using Weblate (Swedish) Currently translated at 87.3% (560 of 641 strings) Translated using Weblate (Serbian) Currently translated at 100.0% (641 of 641 strings) Translated using Weblate (Chinese (Simplified)) Currently translated at 100.0% (641 of 641 strings) Translated using Weblate (Greek) Currently translated at 100.0% (641 of 641 strings) Translated using Weblate (Chinese (Simplified)) Currently translated at 100.0% (50 of 50 strings) Translated using Weblate (French) Currently translated at 70.0% (35 of 50 strings) Translated using Weblate (Indonesian) Currently translated at 100.0% (50 of 50 strings) Translated using Weblate (Ukrainian) Currently translated at 8.0% (4 of 50 strings) Translated using Weblate (Lithuanian) Currently translated at 4.0% (2 of 50 strings) Translated using Weblate (Bengali) Currently translated at 93.7% (601 of 641 strings) Translated using Weblate (Interlingua) Currently translated at 34.3% (220 of 641 strings) Translated using Weblate (Ukrainian) Currently translated at 8.0% (4 of 50 strings) Co-authored-by: Andrij Mizyk Co-authored-by: David Braz Co-authored-by: Eric Co-authored-by: Hosted Weblate Co-authored-by: Hritik R Co-authored-by: JY3 Co-authored-by: Jacque Fresco Co-authored-by: Jeff Huang Co-authored-by: Juraj Timko Co-authored-by: Kristoffer Grundström Co-authored-by: Ldm Public Co-authored-by: Louis Morel Co-authored-by: Oymate Co-authored-by: Rex_sa Co-authored-by: S3aBreeze Co-authored-by: Software In Interlingua Co-authored-by: Terry Louwers Co-authored-by: TobiGr Co-authored-by: Vasilis K Co-authored-by: Yaron Shahrabani Co-authored-by: Zhiheng Xu Co-authored-by: bomzhellino Co-authored-by: chr56 Co-authored-by: gymka Co-authored-by: jul-debug Co-authored-by: nautilusx Co-authored-by: random r Co-authored-by: whenwesober Co-authored-by: Обилић Co-authored-by: Слободан Симић(Slobodan Simić) Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/de/ Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/fr/ Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/id/ Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/lt/ Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/or/ Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/sr/ Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/uk/ Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/zh_Hans/ Translation: NewPipe/Metadata --- app/src/main/res/values-ar/strings.xml | 16 ++++++ .../main/res/values-b+zh+HANS+CN/strings.xml | 18 ++++++- app/src/main/res/values-bn/strings.xml | 2 +- app/src/main/res/values-de/strings.xml | 16 ++++++ app/src/main/res/values-el/strings.xml | 17 +++++- app/src/main/res/values-fr/strings.xml | 15 ++++++ app/src/main/res/values-he/strings.xml | 16 ++++++ app/src/main/res/values-ia/strings.xml | 53 ++++++++++++++++++- app/src/main/res/values-in/strings.xml | 18 ++++++- app/src/main/res/values-it/strings.xml | 16 ++++++ app/src/main/res/values-nl-rBE/strings.xml | 15 ++++++ app/src/main/res/values-nl/strings.xml | 30 ++++++++--- app/src/main/res/values-or/strings.xml | 5 +- app/src/main/res/values-pt-rBR/strings.xml | 16 ++++++ app/src/main/res/values-ru/strings.xml | 16 ++++++ app/src/main/res/values-sk/strings.xml | 22 ++++++-- app/src/main/res/values-sr/strings.xml | 46 ++++++++-------- app/src/main/res/values-sv/strings.xml | 2 +- app/src/main/res/values-zh-rTW/strings.xml | 16 ++++++ app/src/main/res/values/strings.xml | 2 +- .../metadata/android/de/changelogs/968.txt | 7 +++ .../metadata/android/de/changelogs/969.txt | 8 +++ .../metadata/android/fr/changelogs/963.txt | 1 + .../metadata/android/fr/changelogs/967.txt | 1 + .../metadata/android/fr/changelogs/968.txt | 6 +++ .../metadata/android/id/changelogs/969.txt | 8 +++ .../metadata/android/lt/full_description.txt | 2 +- .../metadata/android/lt/short_description.txt | 1 + .../metadata/android/or/short_description.txt | 2 +- .../metadata/android/sk/changelogs/969.txt | 8 +++ .../metadata/android/sr/full_description.txt | 2 +- .../metadata/android/uk/short_description.txt | 2 +- .../android/zh-Hans/changelogs/66.txt | 20 +++++++ 33 files changed, 380 insertions(+), 45 deletions(-) create mode 100644 fastlane/metadata/android/de/changelogs/968.txt create mode 100644 fastlane/metadata/android/de/changelogs/969.txt create mode 100644 fastlane/metadata/android/fr/changelogs/963.txt create mode 100644 fastlane/metadata/android/fr/changelogs/967.txt create mode 100644 fastlane/metadata/android/fr/changelogs/968.txt create mode 100644 fastlane/metadata/android/id/changelogs/969.txt create mode 100644 fastlane/metadata/android/lt/short_description.txt create mode 100644 fastlane/metadata/android/sk/changelogs/969.txt diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 82ee9efae..21138e156 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -720,4 +720,20 @@ إظهار تفاصيل القناة تعطيل نفق الوسائط إذا واجهت شاشة سوداء أو التقطيع في تشغيل الفيديو تعطيل نفق الوسائط + داخلي + خاص + غير مدرج + عامة + عنوان URL للصورة المصغرة + المضيف + الدعم + اللغة + الحد العمري + الخصوصيّة + الرخصة + الفئة + الصنف + تعطيل تحديد النص في الوصف + تمكين تحديد نص في الوصف + يمكنك الآن تحديد نص داخل الوصف. لاحظ أن الصفحة قد تومض وقد لا تكون الروابط قابلة للنقر أثناء وضع التحديد. \ No newline at end of file diff --git a/app/src/main/res/values-b+zh+HANS+CN/strings.xml b/app/src/main/res/values-b+zh+HANS+CN/strings.xml index 2fe2643b6..187ecda1c 100644 --- a/app/src/main/res/values-b+zh+HANS+CN/strings.xml +++ b/app/src/main/res/values-b+zh+HANS+CN/strings.xml @@ -387,7 +387,7 @@ 音调 解除音视挂钩(可能导致失真) 首选“打开”操作 - 打开内容时的默认操作 - %s + 打开内容时的默认操作 — %s 没有可下载的串流 字幕 修改播放器字幕比例和背景样式。重启应用生效。 @@ -678,4 +678,20 @@ 显示频道详情 如果遇到黑屏或视频播放卡顿的情况,请禁用媒体隧道 禁用媒体隧道 + 禁止选择描述中的文本 + 内部 + 私密 + 未列出 + 公开 + 缩略图 URL + 主机 + 支持 + 语言 + 年龄限制 + 隐私 + 许可证 + 标签 + 类别 + 允许选择描述中的文本 + 你现在可以选择描述中的文本。请注意,在选择模式下,页面可能会闪烁,链接可能变得无法点击。 \ No newline at end of file diff --git a/app/src/main/res/values-bn/strings.xml b/app/src/main/res/values-bn/strings.xml index 72c113deb..6dad087b0 100644 --- a/app/src/main/res/values-bn/strings.xml +++ b/app/src/main/res/values-bn/strings.xml @@ -346,7 +346,7 @@ শেয়ার পপ-আপ মোডে ওপেন করো ব্রাউজারে ওপেন করো - বাদ দিন + বাতিল ইনস্টল কোন স্ট্রিম প্লেয়ার পাওয়া যায়নি (প্লে করতে VLC ইন্সটল করতে পারেন). কোন স্ট্রিম প্লেয়ার পাওয়া যায়নি। VLC ইনস্টল করতে চাও\? diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 1e3c8fc8a..aff2c1e64 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -680,4 +680,20 @@ Kanal-Details anzeigen Deaktiviere das Media-Tunneling, wenn bei der Videowiedergabe ein schwarzer Bildschirm oder Stottern auftritt Media-Tunneling deaktivieren + Intern + Privat + Öffentlich + Sprache + Altersbeschränkung + Sichtbarkeit + Lizenz + Tags + Kategorie + Nicht gelistet + Vorschaubild-URL + Server + Unterstützung + Auswählen von Text in der Beschreibung deaktivieren + Auswählen von Text in der Beschreibung aktivieren + Du kannst nun Text innerhalb der Beschreibung auswählen. Beachte, dass die Seite flackern kann und Links im Auswahlmodus möglicherweise nicht anklickbar sind. \ No newline at end of file diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 07fa633c7..d735a1493 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -645,7 +645,7 @@ Στιγμιότυπα PeerTube Χρωματισμός ειδοποιήσεων Επιτρέπει στο Android να τροποποιήσει το χρώμα της ειδοποίησης, σύμφωνα με το κύριο χρώμα του εικονιδίου (δεν διατίθεται σε όλες τις συσκευές) - Χρήση των εικονιδίων στην οθόνη κλειδώματοςως φόντο και στις ειδοποιήσεις + Χρήση των εικονιδίων ως φόντο στην οθόνη κλειδώματος και στις ειδοποιήσεις Εμφάνιση Υπολογισμός hash Ειδοποιήσεις για πρόοδο βίντεο hashing @@ -680,4 +680,19 @@ Εμφάνιση λεπτομερειών καναλιού Απενεργοποιήστε το media tunneling, αν εμφανίζεται μαύρη οθόνη ή διακοπτόμενος ήχος κατά την αναπαραγωγή βίντεο Απενεργοποίηση media tunneling + Εσωτερικό + Ιδιωτικό + Εκτός λίστας + Δημόσιο + URL εικονιδίου + Υποστήριξη + Γλώσσα + Όριο ηλικίας + Ιδιωτικότητα + Άδεια + Ετικέτες + Κατηγορία + Απενεργοποίηση επιλογής κειμένου στην περιγραφή + Ενεργοποίηση επιλογής κειμένου στην περιγραφή + Τώρα μπορείτε να επιλέξετε κείμενο εντός της περιγραφής. Σημειώστε ότι, η σελίδα μπορεί να παρουσιάζει αστάθεια κατά τη διάρκεια της κατάστασης επιλογής κειμένου. \ No newline at end of file diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index dd8c07fd3..2205e5479 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -682,4 +682,19 @@ Afficher les détails de la chaîne Désactivez le tunnelage multimédia si vous constatez un écran noir ou un bégaiement lors de la lecture d\'une vidéo Désactiver le tunnelage média + Désactiver la sélection de texte dans la description + Permettre la sélection de texte dans la description + Interne + Privé + Non répertorié + Public + URL de la vignette + Hôte + Support + Langue + Limite d\'âge + Vie privée + Licence + Étiquettes + Catégorie \ No newline at end of file diff --git a/app/src/main/res/values-he/strings.xml b/app/src/main/res/values-he/strings.xml index 276f868c2..d9b074f42 100644 --- a/app/src/main/res/values-he/strings.xml +++ b/app/src/main/res/values-he/strings.xml @@ -700,4 +700,20 @@ להציג את פרטי הערוץ כדאי להשבית תיעול מדיה אם הופיעה תופעה של מסך שחור או גמגום בנגינת וידאו השבתת תיעול מדיה + פנימי + פרטי + לא מופיע ברשימות + ציבורי + כתובת תמונה ממוזערת + אירוח + תמיכה + שפה + הגבלת גיל + פרטיות + רישיון + תגיות + קטגוריה + השבתת בחירת טקסט בתיאור + הפעלת בחירת טקסט בתיאור + מעתה ניתן לבחור טקסט בתוך התיאור. נא לשים לב שהעמוד עשוי להבהב והקישורים לא יהיו לחיצים בזמן מצב הבחירה. \ No newline at end of file diff --git a/app/src/main/res/values-ia/strings.xml b/app/src/main/res/values-ia/strings.xml index 01372470d..28b0511b7 100644 --- a/app/src/main/res/values-ia/strings.xml +++ b/app/src/main/res/values-ia/strings.xml @@ -54,7 +54,7 @@ Chronologia de cerca Immagazinar le cercas localmente Chronologia de reproductiones - We + Resumer le reproduction Restaurar le ultime position del reproduction Positiones in le listas Monstrar le indicatores de position in listas @@ -151,7 +151,7 @@ Configurationes A proposito de © %1$s per %2$s sub %3$s - Aperir sito web + Aperir le sito web A proposito de Licentias Contribuer @@ -207,4 +207,53 @@ Nemo is observante Chronologia de reproductiones vacuate. Deler omne chronologia de reproductiones\? + Pardono, qualcosa vadeva incorrecte. + Pardono, illo non deberea haber ocurrite. + Deler le positiones de reproduction + Cantos + Listas de reproduction + Lista de reproduction + Reporto de error + Activar el \"Modo restricte\" de YouTube + Plus de 100 videos + Nemo es ascoltante + + %s reproduction + %s reproductiones + + Le numero de subscriptores non es disponibile + + %s subscriptor + %s subscriptores + + Nulle subscriptores + Audio + Video + Nihil contentos ci + Nulle resultatos + Reporto de usator + Reportar un error + Description + Fluxos associate + Non me place + Commentos + Me place + Reportar + Reportar in GitHub + Permitter monstrar supra altere applicationes + Esque tu vole reinitialisar le valores predefinite\? + Reinitialisar le valores predefinite + Nulle fluxos disponibile pro discargar + Ocurreva un error: %1$s + File displaciate o delite + Falleva le interfacie del application + Le discarga al carta SD non es possibile. Reinitialisar le location del dossier de discargas\? + Immagazinage externe non disponibile + Error + Adjuta + Esque tu vole deler tote le positiones de reproduction\? + Dele tote le positiones de reproduction + Usar le recerca rapide e inexacte + Thema nocturne + Nihil \ No newline at end of file diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml index 98ea1a5c9..cee727ebc 100644 --- a/app/src/main/res/values-in/strings.xml +++ b/app/src/main/res/values-in/strings.xml @@ -656,7 +656,7 @@ Konten ini bersifat pribadi, jadi tidak dapat di stream ataupun diunduh oleh NewPipe. Ini adalah sebuah trek SoundCloud Go +, setidaknya di negara Anda, sehingga tidak dapat di stream atau diunduh oleh Newpipe. Konten ini tidak tersedia di negara Anda. - Aplikasi crash + Hentikan aplikasi Video ini dibatasi usia. \nKarena kebijakan YouTube yang baru dengan video yang dibatasi usia, Newpipe tidak dapat mengakses aliran video dan karenanya tidak dapat memainkannya. Kamu bisa pilih tema malam favoritmu dibawah @@ -670,4 +670,20 @@ Tampilkan rincian channel Nonaktifkan terowongan media (tunnel) jiaka anda mengalami sebuah layar hitam atau kerusakan dalam memutar video Nonaktifkan terowongan media (tunnel) + Internal + Privasi + Tidak didaftar + Publik + Alamat URL gambar mini/thumbnail + Host + Dukungan + Bahasa + Batas umur + Privasi + Lisensi + Tag + Kategori + Nonaktifkan dapat memilih teks pada deskripsi + Aktifkan dapat memilih teks pada deskripsi + Anda sekarang dapat memilih teks di dalam deskripsi. Perhatikan bahwa halaman mungkin berkedip dan tautan tidak dapat diklik saat dalam mode pemilihan. \ No newline at end of file diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 42cff5ed1..5fc10029b 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -680,4 +680,20 @@ Mostra dettagli canale Disattiva il tunneling multimediale se durante la riproduzione dei video si verificano schermate nere o irregolarità nell\'audio Disattiva tunneling multimediale + Interno + Privato + Non elencato + Pubblico + URL miniatura + Host + Supporto + Lingua + Limite di età + Privacy + Licenza + Etichette + Categoria + Disattiva la selezione del testo nella descrizione + Attiva la selezione del testo nella descrizione + Ora puoi selezionare il testo all\'interno della descrizione. Nota che la pagina potrebbe sfarfallare e i link potrebbero non essere cliccabili mentre sei in modalità di selezione. \ No newline at end of file diff --git a/app/src/main/res/values-nl-rBE/strings.xml b/app/src/main/res/values-nl-rBE/strings.xml index a0f111be0..4c54d5ede 100644 --- a/app/src/main/res/values-nl-rBE/strings.xml +++ b/app/src/main/res/values-nl-rBE/strings.xml @@ -665,4 +665,19 @@ Toon beschrijving Nacht Thema Open met + Featured + Deze inhoud is privé, waardoor het niet kan worden gestreamd of gedownload door NewPipe. + Laat de app crashen + Schakel media tunneling uit indien u een zwart scherm of haperingen vaststelt bij het afspelen van video\'s + De download is begonnen + U kunt uw favoriete nachtthema hieronder kiezen + Kies uw favoriete nachtthema - %s + Automatisch (thema van de telefoon) + Radio + Deze inhoud is enkel toegankelijk voor betalende gebruikers, waardoor het niet kan worden gestreamd of gedownload door NewPipe. + Deze video is enkel toegankelijk voor YouTube Music Premium leden, waardoor het niet kan worden gestreamd of gedownload door NewPipe. + Dit is (tenminste in uw land) een SoundCloud Go+ titel, waardoor het niet kan worden gestreamd of gedownload door NewPipe. + Deze inhoud is niet toegankelijk in uw land. + Geen app beschikbaar om dit te openen + Hoofdstukken \ No newline at end of file diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 8bf1b8796..adc400ea2 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -72,7 +72,7 @@ Video Geluid Opnieuw proberen - Druk op \"zoeken\" om te beginnen. + Druk op \"Zoeken\" om te beginnen. Automatisch afspelen Speelt video’s af als NewPipe vanuit een andere app wordt geopend Live @@ -262,8 +262,8 @@ Bezig met laden van gevraagde inhoud Databank importeren Databank exporteren - Dit overschrijft je huidige geschiedenis, abonnementen, playlists en instellingen - Exporteer geschiedenis, abonnementen, playlists en instellingen + Dit overschrijft je huidige geschiedenis, abonnementen, afspeellijsten en instellingen + Exporteer geschiedenis, abonnementen, afspeellijsten en instellingen Geëxporteerd Geïmporteerd Geen geldig ZIP-bestand @@ -599,7 +599,7 @@ \nSchakel \"%1$s\" in bij de instellingen als u die wilt zien. Verwijder bekeken Originele teksten van services zijn zichtbaar in stream-items - YouTube \"beperkte modus\" aanzetten + YouTube \"Beperkte modus\" aanzetten Laat originele tijd geleden zien Kanaal avatar afbeelding Door %s @@ -641,7 +641,7 @@ Verwijder cookies die NewPipe opslaat wanneer u een reCAPTCHA oplost reCAPTCHA cookies zijn verwijderd Verwijder reCAPTCHA cookies - YouTube biedt een \"beperkte modus\" aan; dit verbergt mogelijk materiaal voor volwassenen + YouTube biedt een \"Beperkte modus\" aan, dit verbergt mogelijk materiaal voor volwassenen Toon inhoud die mogelijk niet geschikt is voor kinderen omwille van een leeftijdslimiet (zoals 18+) Laat Android de kleur van de notificatie aanpassen, op basis van de meest voorkomende kleur in de thumbnail (let op: niet beschikbaar op elk apparaat) Notificatie kleur aanpassen @@ -675,7 +675,25 @@ Downloaden is gestart Je kan je favoriete nacht thema hier beneden selecteren Selecteer uw favoriete nacht thema — %s - Automatisch (apparaat thema) + Automatisch (toestel thema) Toon details van kanaal Nachtmodus + Intern + Privé + Niet vermeld + Openbaar + Miniatuur-URL + Host + Ondersteuning + Taal + Leeftijdslimiet + Privacy + Licentie + Tags + Categorie + Tekst selecteren in de beschrijving uitschakelen + Tekst selecteren in de beschrijving inschakelen + U kunt nu tekst in de beschrijving selecteren. Houd er rekening mee dat de pagina kan flikkeren en dat links mogelijk niet klikbaar zijn in de selectiemodus. + Media tunneling uitschakelen als u een zwart scherm ervaart of video hapert bij het afspelen + Media tunneling uitschakelen \ No newline at end of file diff --git a/app/src/main/res/values-or/strings.xml b/app/src/main/res/values-or/strings.xml index a6b3daec9..df3cc588c 100644 --- a/app/src/main/res/values-or/strings.xml +++ b/app/src/main/res/values-or/strings.xml @@ -1,2 +1,5 @@ - \ No newline at end of file + + %1$s ଭିଉଜ、 + ଆରମ୍ଭ କରିବା ପାଇଁ \"ସର୍ଚ୍ଚ\" ବଟନ କୁ ଦବାନ୍ତୁ + \ No newline at end of file diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 218bfd844..650694d5b 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -680,4 +680,20 @@ Mostrar detalhes do canal Desative o túnel de mídia se você tiver uma tela preta ou a reprodução do vídeo estiver engasgando Desativar túnel de mídia + Interno + Privado + Não Listado + Público + Limite de Idade + URL da Capa + Hospedado em + Suporte + Idioma + Privacidade + Licença + Tags + Categoria + Desativar seleção de texto na descrição + Ativar seleção de texto na descrição + Agora você pode selecionar o texto dentro da descrição. Observe que a página pode piscar e os links podem não ser clicáveis no modo de seleção. \ No newline at end of file diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 888fec2dc..6fcee1f23 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -691,4 +691,20 @@ Подробно о канале Отключите туннелирование медиа, если вы видите черный экран или подёргивание при воспроизведении видео Отключить туннелирование медиа + Теперь вы можете выделить текст внутри описания. Заметьте, что страница может мигать и ссылки могут быть некликабельны в режиме выделения. + Поддержка + Язык + Возрастное ограничение + Лицензия + Тэги + Категория + Отключить выделение текста в описании + Включить выделение текста в описании + Внутренняя + Приватная + Не в списке + Публичная + URL миниатюры + Сервер + Доступность \ No newline at end of file diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index d7d1399bf..e31aa4f10 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -26,7 +26,7 @@ Prehrať cez Kodi Nainštalovať chýbajúcu aplikáciu Kore\? Zobraziť možnosť \"Prehrať cez Kodi\" - Zobraziť možnosť \"Prehraj cez Kodi\" + Zobraziť možnosť \"Prehrať cez Kodi\" Zvuk Predvolený zvukový formát Téma @@ -128,7 +128,7 @@ Filter Obnoviť Vyčistiť - Neprehrá audio pri niektorých rozlíšeniach + Odstráni audio pri niektorých rozlíšeniach Zapamätať si parametre mini okna Zapamätať si posledné nastavenie veľkosti a pozície mini okna Ovládanie prehrávača gestami @@ -313,7 +313,7 @@ Odstrániť všetky údaje webových stránok vo vyrovnávacej pamäti Vyrovnávacia pamäť metadát bola vymazaná Automaticky zaradiť daľší stream - Končiaci neopakujúci sa zoznam prehrávania bude pokračovať súvisiacim streamom + Končiaci (neopakujúci sa) zoznam prehrávania bude pokračovať súvisiacim streamom Ladenie Súbor Neplatný adresár @@ -690,4 +690,20 @@ Nočná Téma Ak vám video pri prehrávaní seká alebo sa zobrazuje čierna obrazovka zakážte tunelovanie médií Zakázať tunelovanie médií + Interné + Súkromné + Nezaradené + URL miniatúry + Verejné + Hostiteľ + Podpora + Jazyk + Vekový limit + Ochrana osobných údajov + Licencia + Tagy + Kategória + Zakázať výber textu v popise + Povolenie výberu textu v popise + Teraz môžete vybrať text vo vnútri popisu. Upozorňujeme, že stránka môže blikať a odkazy nemusia byť klikateľné, keď je v režime výberu. \ No newline at end of file diff --git a/app/src/main/res/values-sr/strings.xml b/app/src/main/res/values-sr/strings.xml index bd9293f89..d607a3347 100644 --- a/app/src/main/res/values-sr/strings.xml +++ b/app/src/main/res/values-sr/strings.xml @@ -76,7 +76,7 @@ Пријавите грешку Извештај корисника Уживо - тапните на лупу да започнете + Тапните на лупу да започнете. Аутопуштање Пушта видео по позиву из друге апликације Почни @@ -139,10 +139,10 @@ Прати се Прати Главно - Претплате + Праћења Шта је ново Историјат претраге - Уписуј појмове претраге локално + Појмове претраге складишти локално Историја гледања Чувај историјат гледања Настави са репродукцијом @@ -166,9 +166,9 @@ Историјат Историјат је празан Историјат очишћен - Настави репродукцију након прекида (нпр. позива) + Настави пуштање након прекида (нпр. позива) Дозвољени знакови у називима - Слова и бројке + слова и бројке © %1$s од %2$s под %3$s Не могу да учитам лиценцу Одјављен са канала @@ -183,11 +183,11 @@ Обавештења за Њупајп плејере у позадини и искачућем прозору Нема резултата Нема ничега овде осим цврчака - Нема претплатника + Нема пратилаца - %s претплатник - %s претплатника - %s претплатника + %s пратилац + %s пратилаца + %s пратилаца Нема прегледа @@ -203,7 +203,7 @@ Неисправни знакови биће замењени овим Знак за замену - Посебни знакови + и посебни знакови Лиценце треће стране Лиценца Њупајпа Помоћ је увек добро дошла, било да имате идеју за превод, дизајн, козметичке или озбиљне измене кôда. Што се више уради, боље је! @@ -331,23 +331,23 @@ Тапните за преузимање Доступно је ажурирање за ЊуПајп! Промени приказ - Аутоматски - Мрежа - Листа + аутоматски + мрежа + листа Режим приказа листе - Никад - Само на бежичној - Покрени пуштање аутоматски — %s - Умањи на искачући плејер - Умањи на позадински плејер + никад + само на бежичној + Покрени аутоматски — %s + умањи на искачући плејер + умањи на позадински плејер ништа Радња при преласку на другу апликацију са главног видео плејера — %s Умањи при мењању апликације Прикажи обавештење када постоји нова верзија апликације Ажурирања - Ограничи резолуцију када користим мобилне податке + Ограничити резолуцију на мобилној мрежи Одбиј - Без органичења + без ограничења Прихвати Да бисмо били у складу са Европском општом уредбом о заштити података („GDPR“), скрећемо вам пажњу на политику приватности апликације ЊуПајпа. Пажљиво је прочитајте. \nМорате је прихватити да бисте нам послали извештај о грешци. @@ -484,7 +484,7 @@ %s гледалаца Нико не гледа - Број претплатника није доступан + Број пратилаца није доступан Мењај услугу, тренутно изабрана: Превуците за преуређивање Опис @@ -554,7 +554,7 @@ \n \nУкључите „%1$s“ у поставкама ако желите да га видите. Јутјуб омогућава „Ограничени режим“ који скрива потенцијални садржај за одрасле - Укључите Јутјубов „Ограничени режим“ + Укључити Јутјубов „Ограничени режим“ Приказ садржаја који можда није прикладан за децу јер има старосну границу (попут 18+) Обавештење Ажурирања @@ -611,7 +611,7 @@ Преузимање је започело Испод можете одабрати своју омиљену ноћну тему Изаберите своју омиљену ноћну тему — %s - Аутоматски (тема уређаја) + аутоматски (тема уређаја) Радио Истакнуто Овај садржај је доступан само корисницима који су платили, тако да га ЊуПајп не може стримовати или преузимати. diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 9f9a81990..3b06823f5 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -1,6 +1,6 @@ - Tryck på \"Sök\" för att komma igång + Tryck på förstoringsglaset för att komma igång Publicerad den %1$s Ingen strömspelare hittades. Vill du installera VLC? Installera diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 0c34781f8..ccc9f4b34 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -670,4 +670,20 @@ 顯示頻道詳細資訊 如果您遇到黑畫面或影片播放停頓的現象,請停用媒體隧道 停用媒體隧道 + 內部 + 私人 + 未列出 + 公開 + 縮圖 URL + 主機 + 支援 + 語言 + 年齡限制 + 隱私 + 授權條款 + 標籤 + 分類 + 停用選取描述中的文字 + 啟用選取描述中的文字 + 您現在可以選取描述中的文字了。請注意,在選取模式下,頁面可能會閃爍,連結也可能無法點擊。 \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c43ea85b6..4fb4019bd 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -732,4 +732,4 @@ Unlisted Private Internal - + \ No newline at end of file diff --git a/fastlane/metadata/android/de/changelogs/968.txt b/fastlane/metadata/android/de/changelogs/968.txt new file mode 100644 index 000000000..a619dc5c2 --- /dev/null +++ b/fastlane/metadata/android/de/changelogs/968.txt @@ -0,0 +1,7 @@ +Option "Kanaldetails" wurde zum Langdruckmenü hinzugefügt. +Funktion zum Umbenennen des Playlist-Namens von der Playlist-Oberfläche zugefügt. +Benutzer kann nun pausieren, während ein Video gepuffert wird. +Weiße Thema wurde aufpoliert. +Überlappende Schriftarten bei Verwendung einer größeren Schriftgröße behoben. +Kein Video auf Formuler- und Zephier-Geräten behoben. +Verschiedene Abstürze behoben. diff --git a/fastlane/metadata/android/de/changelogs/969.txt b/fastlane/metadata/android/de/changelogs/969.txt new file mode 100644 index 000000000..e6cfbdd84 --- /dev/null +++ b/fastlane/metadata/android/de/changelogs/969.txt @@ -0,0 +1,8 @@ +• Installation auf externen Speicher möglich +• [Bandcamp] Unterstützung für die Anzeige der ersten drei Kommentare in einem Stream +• Nur Hinweisanzeige "Download gestartet", wenn der Download gestartet wird +• Setzt kein reCaptcha-Cookie, wenn kein Cookie gespeichert wird +• Cache-Leistung verbessert +• Problem behoben, dass die Wiedergabe nicht automatisch abspielt wird +• Verwerfen früherer Snackbars beim Löschen von Downloads +• Fehler beim Löschen des Objekts, das nicht in der Liste enthalten ist diff --git a/fastlane/metadata/android/fr/changelogs/963.txt b/fastlane/metadata/android/fr/changelogs/963.txt new file mode 100644 index 000000000..0ea6c4274 --- /dev/null +++ b/fastlane/metadata/android/fr/changelogs/963.txt @@ -0,0 +1 @@ +• [YouTube] rétablissement des flux diff --git a/fastlane/metadata/android/fr/changelogs/967.txt b/fastlane/metadata/android/fr/changelogs/967.txt new file mode 100644 index 000000000..29bdde9f1 --- /dev/null +++ b/fastlane/metadata/android/fr/changelogs/967.txt @@ -0,0 +1 @@ +La réparation du flux YouTube ne fonctionnait pas correctement dans l'UE. Cela était dû à un nouveau système de cookies et de consentement à la confidentialité qui exige que NewPipe définisse un cookie CONSENT. diff --git a/fastlane/metadata/android/fr/changelogs/968.txt b/fastlane/metadata/android/fr/changelogs/968.txt new file mode 100644 index 000000000..06b84c7fd --- /dev/null +++ b/fastlane/metadata/android/fr/changelogs/968.txt @@ -0,0 +1,6 @@ +Ajout d'une option de détails sur les chaînes dans le menu de pression longue. +Ajout d'une fonctionnalité permettant de renommer le nom de la liste de lecture à partir de l'interface de la liste de lecture. +Permet à l'utilisateur de faire une pause pendant la mise en mémoire tampon d'une vidéo. +Le thème blanc a été amélioré. +Correction du chevauchement des polices lors de l'utilisation d'une taille de police plus grande. +Correction de l'absence de vidéo sur les appareils Formuler et Zephier. diff --git a/fastlane/metadata/android/id/changelogs/969.txt b/fastlane/metadata/android/id/changelogs/969.txt new file mode 100644 index 000000000..7f081aca2 --- /dev/null +++ b/fastlane/metadata/android/id/changelogs/969.txt @@ -0,0 +1,8 @@ +• Izinkan instalasi pada penyimpanan eksternal +• [Bandcamp] Penambahan dukungan untuk menampilkan tiga komentar pertama pada stream +• Hanya Tampilkan toast 'Unduh telah dimulai' saat mengunduh dimulai +• Jangan mengatur cookie reCaptcha ketika tidak ada cookie yang disimpan +• [Pemutar] Peningkatan kinerja cache +• [Pemutar] Tidak memutar secara otomatis +• Abaikan Snackbars sebelumnya saat menghapus unduhan +• Perbaikan mencoba menghapus objek tidak dalam daftar diff --git a/fastlane/metadata/android/lt/full_description.txt b/fastlane/metadata/android/lt/full_description.txt index e729e7221..07f081975 100644 --- a/fastlane/metadata/android/lt/full_description.txt +++ b/fastlane/metadata/android/lt/full_description.txt @@ -1 +1 @@ -NewPipe nenaudoja jokių Google paslaugų ar Youtube API. Jisai tiktai nuskanuoja svetaine dėl reikemos informacijos. Dėlto NewPipe nereikia įdiegtų Google paslaugų. Ir jums nereikia Youtube paskyros norint naudoti NewPipe taip pat yra FLOSS. +NewPipe nenaudoja jokių Google paslaugų ar Youtube API. Programa tik paima informaciją kurios jai reikia. Dėlto NewPipe nereikia įdiegtų Google paslaugų. Taipogi jums nereikia Youtube paskyros norint naudoti NewPipe, tai yra FLOSS. diff --git a/fastlane/metadata/android/lt/short_description.txt b/fastlane/metadata/android/lt/short_description.txt new file mode 100644 index 000000000..c5fd36f0a --- /dev/null +++ b/fastlane/metadata/android/lt/short_description.txt @@ -0,0 +1 @@ +Nemokama ir lengva "YouTube" sąsaja skirta "Android". diff --git a/fastlane/metadata/android/or/short_description.txt b/fastlane/metadata/android/or/short_description.txt index e1b83993b..83e4166bd 100644 --- a/fastlane/metadata/android/or/short_description.txt +++ b/fastlane/metadata/android/or/short_description.txt @@ -1 +1 @@ -ଏକ ମାଗଣା ହାଲୁକା Youtube ସେବା Android ପାଇଁ | +ଏକ ମାଗଣା ହାଲୁକା Youtube ସେବା Android ପାଇଁ diff --git a/fastlane/metadata/android/sk/changelogs/969.txt b/fastlane/metadata/android/sk/changelogs/969.txt new file mode 100644 index 000000000..b80399482 --- /dev/null +++ b/fastlane/metadata/android/sk/changelogs/969.txt @@ -0,0 +1,8 @@ +• Povoliť inštaláciu na externom úložisku + • [Bandcamp] Pridaná podpora pre zobrazovanie prvých troch komentárov v streame + • Zobraziť „sťahovanie začalo“ sa zobrazí až pri začatí sťahovania + • Nenastavovať súbor cookie reCaptcha, ak nie je uložený žiadny súbor cookie + • [Player] Zlepšenie výkonu medzipamäte + • [Prehrávač] Opravené automatické prehrávanie + • Zavrieť predchádzajúce Snackbary pri odstraňovaní sťahovaní + • Opravený pokus o odstránenie objektu, ktorý nie je na zozname diff --git a/fastlane/metadata/android/sr/full_description.txt b/fastlane/metadata/android/sr/full_description.txt index dd7b821a3..df0c3c3f9 100644 --- a/fastlane/metadata/android/sr/full_description.txt +++ b/fastlane/metadata/android/sr/full_description.txt @@ -1 +1 @@ -ЊуПајп не користи ниједну библиотеку Гугл оквира нити Јутјуб АПИ. Само скида са Јутјуба оно што му је потребно. Стога се ова апликација може користити на уређајима без инсталираних Гугл услуга. Такође, није вам потребан Јутјуб налог да бисте користили ЊуПајп, и још је ФЛОСС. +ЊуПајп не користи ниједну библиотеку Гугл оквира нити Јутјуб АПИ. Само скида са Јутјуба оно што му је потребно. Стога се ова апликација може користити на уређајима без инсталираних Гугл услуга. Такође, није вам потребан Јутјуб налог да бисте користили ЊуПајп, и још је слободан, бесплатан и отвореног кода. diff --git a/fastlane/metadata/android/uk/short_description.txt b/fastlane/metadata/android/uk/short_description.txt index f35a32646..f73a02288 100644 --- a/fastlane/metadata/android/uk/short_description.txt +++ b/fastlane/metadata/android/uk/short_description.txt @@ -1 +1 @@ -Безкоштовний та легкий YouTube інткрфейс для Android +Безкоштовний та легкий YouTube-інтерфейс для Android. diff --git a/fastlane/metadata/android/zh-Hans/changelogs/66.txt b/fastlane/metadata/android/zh-Hans/changelogs/66.txt index 86adf2d11..d555a70ca 100644 --- a/fastlane/metadata/android/zh-Hans/changelogs/66.txt +++ b/fastlane/metadata/android/zh-Hans/changelogs/66.txt @@ -1,2 +1,22 @@ v0.13.7 修复排序异常 +v0.13.6 +##改进 +禁用汉堡菜单图标动画 +刚删除的下载文件可恢复 +添加分享菜单中的下载选项 +添加分享选项至长按菜单 +退出时最小化主播放器 +库版本更新和数据库备份修复 +更新 ExoPlayer 至 2.8.2 +重新设计播放速度控制对话框,可支持不同的步长加快速度 +播放速度控制中增加沉默期间快进开关,给某些有声读物和音乐类型带来真正的无缝体验 +重构媒体源解析,允许在播放器内部将元数据与媒体一起传递,而非手动进行,因此成为单一元数据来源,在开始播放时直接可用 +修正在打开播放列表碎片且新的元数据可用时远程播放列表元数据未更新 +各种UI修复:后台播放器通知控件现在为白色,更容易通过滑动关闭悬浮窗播放器 +使用新的提取器,重构了多服务架构 +##修复 +修复异常视频信息页布局 +修复历史记录视图异常(更新元数据(缩略图,标题和数量)时恰访问播放列表;当从详情页从外部播放器上播放视频时,在数据库中注册一个视图) +修复悬浮窗下视频超时 +修复主视频播放器(修正当播放器活动处于后台时收到新意图后重复模式导致NPE;修正当未获得悬浮窗权限,切换悬浮窗时播放器异常) From 79efffe12f9a1f5c78eff6fd14ddcb45128eb392 Mon Sep 17 00:00:00 2001 From: TobiGr Date: Sat, 5 Jun 2021 01:15:56 +0200 Subject: [PATCH 59/72] Replace three dots with ellipsis symbol --- app/src/main/res/values-b+ast/strings.xml | 4 ++-- app/src/main/res/values-ca/strings.xml | 2 +- app/src/main/res/values-eu/strings.xml | 2 +- app/src/main/res/values-fr/strings.xml | 2 +- app/src/main/res/values-pt-rPT/strings.xml | 2 +- app/src/main/res/values-pt/strings.xml | 2 +- app/src/main/res/values-so/strings.xml | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/main/res/values-b+ast/strings.xml b/app/src/main/res/values-b+ast/strings.xml index 447de5676..287de7dba 100644 --- a/app/src/main/res/values-b+ast/strings.xml +++ b/app/src/main/res/values-b+ast/strings.xml @@ -30,7 +30,7 @@ Nun pudo analizase\'l sitiu web Los fluxos en direuto entá nun se sofiten Nun pudo consiguise nengún fluxu - Buff... Esto nun debió asoceder. + Buff… Esto nun debió asoceder. Perdona mas asocedió daqué malo. Información: Detalles: @@ -107,7 +107,7 @@ Llicencies Ver en GitHub Llicencia de NewPipe - Si tienes idees, quies traducir, facer dalgún cambéu nel diseñu, acuriosar poco o muncho\'l códigu... Agradecemos l\'ayuda. ¡Cuanto más se faiga, meyor! + Si tienes idees, quies traducir, facer dalgún cambéu nel diseñu, acuriosar poco o muncho\'l códigu… Agradecemos l\'ayuda. ¡Cuanto más se faiga, meyor! Lleer Collaboración Historial diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml index d84c14215..a35cf8847 100644 --- a/app/src/main/res/values-ca/strings.xml +++ b/app/src/main/res/values-ca/strings.xml @@ -553,7 +553,7 @@ \nEn definitiva, l\'elecció depèn de si preferiu rapidesa a assegurar-vos que l\'informació és precisa. Desactiva el mode ràpid Activa el mode ràpid - Disponible en alguns serveis, normalment és més ràpid, però podria només incloure un nombre limitat de contingut i sovint informació incomplerta (per exemple, sense durada, tipus...). + Disponible en alguns serveis, normalment és més ràpid, però podria només incloure un nombre limitat de contingut i sovint informació incomplerta (per exemple, sense durada, tipus…). Recupera des d\'un feed dedicat si és possible Actualitza sempre Temps que ha de passar perquè una subscripció es consideri obsoleta — %s diff --git a/app/src/main/res/values-eu/strings.xml b/app/src/main/res/values-eu/strings.xml index c84a3bf1b..cb9e06367 100644 --- a/app/src/main/res/values-eu/strings.xml +++ b/app/src/main/res/values-eu/strings.xml @@ -660,7 +660,7 @@ Iruzkinak Desaktibatu bideoaren deskribapena eta informazio gehigarria ezkutatzeko Erakutsi deskribapena - Ireki honekin... + Ireki honekin… Irratia Nabarmenduak Eduki hau ordaindu duten erabiltzaileentzat soilik dago eskuragarri, eta NewPipe-k ezin du tramsmititu edo deskargatu. diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 2205e5479..e6bf26f8c 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -97,7 +97,7 @@ Serveur non pris en charge Fichier déjà existant Lien malformé ou accès à Internet indisponible - NewPipe télécharge... + NewPipe télécharge… Appuyer pour plus de détails Veuillez patienter… Copié dans le presse-papiers diff --git a/app/src/main/res/values-pt-rPT/strings.xml b/app/src/main/res/values-pt-rPT/strings.xml index cda5c24f2..3f05b3909 100644 --- a/app/src/main/res/values-pt-rPT/strings.xml +++ b/app/src/main/res/values-pt-rPT/strings.xml @@ -623,7 +623,7 @@ Pedir confirmação antes de limpar uma fila Lembrar do último tamanho e posição do popup Nada - Processamento... + Processamento… Baralhar Repetir Pode selecionar, no máximo, três ações para mostrar na notificação compacta! diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 124d7bc92..7e91b1845 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -621,7 +621,7 @@ Iniciar reprodução automaticamente — %s Reproduzir fila Nunca - Processamento... + Processamento… A fila do reprodutor ativo será substituída URL não reconhecido. Abrir com outra aplicação\? Colocar na fila automaticamente diff --git a/app/src/main/res/values-so/strings.xml b/app/src/main/res/values-so/strings.xml index 93d14b571..ab7038b34 100644 --- a/app/src/main/res/values-so/strings.xml +++ b/app/src/main/res/values-so/strings.xml @@ -319,7 +319,7 @@ U ogolow app-ka inuu dul fuulo applicationada kale Ma rabtaa inaad sidii hore kuceliso\? Dib ugu celi sidii hore - Lama akhrin karo daaqadihii la kaydiyay, ...isticmaalaya kuwii app-ku kusoo baxay + Lama akhrin karo daaqadihii la kaydiyay, …isticmaalaya kuwii app-ku kusoo baxay Wax la dajiyo lama heli karo Khalad ayaa ka dhacay: %1$s Magaca shayga ma madhnaan karo From abc354f5160080a7daa891ddc92b5466007cec9d Mon Sep 17 00:00:00 2001 From: TobiGr Date: Sat, 5 Jun 2021 01:16:48 +0200 Subject: [PATCH 60/72] Use reqireContext(), requireActivity() instead of getters --- .../newpipe/local/subscription/ImportConfirmationDialog.java | 2 +- .../main/java/org/schabi/newpipe/util/StreamDialogEntry.java | 5 +++-- app/src/main/java/us/shandian/giga/io/StoredFileHelper.java | 2 +- .../subscription/services/ImportExportJsonHelperTest.java | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/local/subscription/ImportConfirmationDialog.java b/app/src/main/java/org/schabi/newpipe/local/subscription/ImportConfirmationDialog.java index 30142157e..602e418a0 100644 --- a/app/src/main/java/org/schabi/newpipe/local/subscription/ImportConfirmationDialog.java +++ b/app/src/main/java/org/schabi/newpipe/local/subscription/ImportConfirmationDialog.java @@ -40,7 +40,7 @@ public class ImportConfirmationDialog extends DialogFragment { @Override public Dialog onCreateDialog(@Nullable final Bundle savedInstanceState) { assureCorrectAppLanguage(getContext()); - return new AlertDialog.Builder(getContext()) + return new AlertDialog.Builder(requireContext()) .setMessage(R.string.import_network_expensive_warning) .setCancelable(true) .setNegativeButton(R.string.cancel, null) diff --git a/app/src/main/java/org/schabi/newpipe/util/StreamDialogEntry.java b/app/src/main/java/org/schabi/newpipe/util/StreamDialogEntry.java index b7629fac3..610f9f852 100644 --- a/app/src/main/java/org/schabi/newpipe/util/StreamDialogEntry.java +++ b/app/src/main/java/org/schabi/newpipe/util/StreamDialogEntry.java @@ -26,7 +26,8 @@ public enum StreamDialogEntry { show_channel_details(R.string.show_channel_details, (fragment, item) -> // For some reason `getParentFragmentManager()` doesn't work, but this does. - NavigationHelper.openChannelFragment(fragment.getActivity().getSupportFragmentManager(), + NavigationHelper.openChannelFragment( + fragment.requireActivity().getSupportFragmentManager(), item.getServiceId(), item.getUploaderUrl(), item.getUploaderName()) ), @@ -80,7 +81,7 @@ public enum StreamDialogEntry { play_with_kodi(R.string.play_with_kodi_title, (fragment, item) -> { final Uri videoUrl = Uri.parse(item.getUrl()); try { - NavigationHelper.playWithKore(fragment.getContext(), videoUrl); + NavigationHelper.playWithKore(fragment.requireContext(), videoUrl); } catch (final Exception e) { KoreUtil.showInstallKoreDialog(fragment.getActivity()); } diff --git a/app/src/main/java/us/shandian/giga/io/StoredFileHelper.java b/app/src/main/java/us/shandian/giga/io/StoredFileHelper.java index eba9437e1..21f6f2296 100644 --- a/app/src/main/java/us/shandian/giga/io/StoredFileHelper.java +++ b/app/src/main/java/us/shandian/giga/io/StoredFileHelper.java @@ -275,7 +275,7 @@ public class StoredFileHelper implements Serializable { if (!docTree.canRead() || !docTree.canWrite()) return false; try { docFile = createSAF(context, srcType, srcName); - if (docFile == null || docFile.getName() == null) return false; + if (docFile.getName() == null) return false; result = true; } catch (IOException e) { return false; diff --git a/app/src/test/java/org/schabi/newpipe/local/subscription/services/ImportExportJsonHelperTest.java b/app/src/test/java/org/schabi/newpipe/local/subscription/services/ImportExportJsonHelperTest.java index d3d1fa419..679c9da1d 100644 --- a/app/src/test/java/org/schabi/newpipe/local/subscription/services/ImportExportJsonHelperTest.java +++ b/app/src/test/java/org/schabi/newpipe/local/subscription/services/ImportExportJsonHelperTest.java @@ -91,7 +91,7 @@ public class ImportExportJsonHelperTest { final List itemsFromFile = ImportExportJsonHelper.readFrom( inputStream, null); - if (itemsFromFile == null || itemsFromFile.isEmpty()) { + if (itemsFromFile.isEmpty()) { fail("ImportExportJsonHelper.readFrom(input) returned a null or empty list"); } @@ -116,7 +116,7 @@ public class ImportExportJsonHelperTest { final List secondReadItems = ImportExportJsonHelper.readFrom( inputStream, null); - if (secondReadItems == null || secondReadItems.isEmpty()) { + if (secondReadItems.isEmpty()) { fail("second call to readFrom returned an empty list"); } From 7e3b3453c06e660d429066c1100ce335acd107e3 Mon Sep 17 00:00:00 2001 From: TobiGr Date: Sat, 5 Jun 2021 01:17:10 +0200 Subject: [PATCH 61/72] Suppress a warning --- app/src/main/java/org/schabi/newpipe/MainActivity.java | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/org/schabi/newpipe/MainActivity.java b/app/src/main/java/org/schabi/newpipe/MainActivity.java index 90db7bead..26ee261a4 100644 --- a/app/src/main/java/org/schabi/newpipe/MainActivity.java +++ b/app/src/main/java/org/schabi/newpipe/MainActivity.java @@ -95,6 +95,7 @@ import static org.schabi.newpipe.util.Localization.assureCorrectAppLanguage; public class MainActivity extends AppCompatActivity { private static final String TAG = "MainActivity"; + @SuppressWarnings("ConstantConditions") public static final boolean DEBUG = !BuildConfig.BUILD_TYPE.equals("release"); private ActivityMainBinding mainBinding; From f583dd47ac246c0ca2ce6ed42d0f58dc3429e929 Mon Sep 17 00:00:00 2001 From: TobiGr Date: Sat, 5 Jun 2021 16:34:22 +0200 Subject: [PATCH 62/72] Annotate StoredFileHelper.createSAF() as NonNull --- app/src/main/java/us/shandian/giga/io/StoredFileHelper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/us/shandian/giga/io/StoredFileHelper.java b/app/src/main/java/us/shandian/giga/io/StoredFileHelper.java index 21f6f2296..ad64042f1 100644 --- a/app/src/main/java/us/shandian/giga/io/StoredFileHelper.java +++ b/app/src/main/java/us/shandian/giga/io/StoredFileHelper.java @@ -354,7 +354,9 @@ public class StoredFileHelper implements Serializable { } } - private DocumentFile createSAF(@Nullable Context context, String mime, String filename) throws IOException { + @NonNull + private DocumentFile createSAF(@Nullable Context context, String mime, String filename) + throws IOException { DocumentFile res = StoredDirectoryHelper.findFileSAFHelper(context, docTree, filename); if (res != null && res.exists() && res.isDirectory()) { From 583a028529b357c4745ce1f6de37a20851db0013 Mon Sep 17 00:00:00 2001 From: TobiGr Date: Sat, 5 Jun 2021 17:22:32 +0200 Subject: [PATCH 63/72] Add changelog for 0.21.4 --- fastlane/metadata/android/en-US/changelogs/970.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 fastlane/metadata/android/en-US/changelogs/970.txt diff --git a/fastlane/metadata/android/en-US/changelogs/970.txt b/fastlane/metadata/android/en-US/changelogs/970.txt new file mode 100644 index 000000000..61497817b --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/970.txt @@ -0,0 +1,11 @@ +New +• Show content metadata (tags, categories, license, ...) below the description +• Added "Show channel details" option in remote (non-local) playlists +• Added "Open in browser" option to long-press menu + +Fixed +• Fixed rotation crash on video detail page +• Fixed "Play with Kodi" button in player always prompts to install Kore +• Fixed and improve setting import and export paths +• [YouTube] Fixed comment like count +And much more \ No newline at end of file From ded654042245caea0bf38925e3cfd0baa0e5ec36 Mon Sep 17 00:00:00 2001 From: TobiGr Date: Sat, 5 Jun 2021 17:26:16 +0200 Subject: [PATCH 64/72] Update extractor version --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index fc56e4f25..cccf78666 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -183,7 +183,7 @@ dependencies { /** NewPipe libraries **/ // You can use a local version by uncommenting a few lines in settings.gradle implementation 'com.github.TeamNewPipe:nanojson:1d9e1aea9049fc9f85e68b43ba39fe7be1c1f751' - implementation 'com.github.TeamNewPipe:NewPipeExtractor:ff11c2df2a22cc10d9fd7e59538d10ca7ccbaffb' + implementation 'com.github.TeamNewPipe:NewPipeExtractor:8c42a486736509e7d382f4c0d9c93ad020de6b79' /** Checkstyle **/ checkstyle "com.puppycrawl.tools:checkstyle:${checkstyleVersion}" From 81d00f2e97228e02052849f50a16d4552a477638 Mon Sep 17 00:00:00 2001 From: Tobi Date: Sat, 5 Jun 2021 17:34:27 +0200 Subject: [PATCH 65/72] Run CI on PRs which target the master branch This is a fix for the release PRs --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab816bd9a..676e46333 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,7 @@ on: pull_request: branches: - dev + - master push: branches: - dev From 69fc466323a1039efe3afe034ab54c795452a56a Mon Sep 17 00:00:00 2001 From: Tobi Date: Sat, 5 Jun 2021 23:37:47 +0200 Subject: [PATCH 66/72] Update 970.txt Fixed typo --- fastlane/metadata/android/en-US/changelogs/970.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastlane/metadata/android/en-US/changelogs/970.txt b/fastlane/metadata/android/en-US/changelogs/970.txt index 61497817b..f4ff5fe34 100644 --- a/fastlane/metadata/android/en-US/changelogs/970.txt +++ b/fastlane/metadata/android/en-US/changelogs/970.txt @@ -6,6 +6,6 @@ New Fixed • Fixed rotation crash on video detail page • Fixed "Play with Kodi" button in player always prompts to install Kore -• Fixed and improve setting import and export paths +• Fixed and improved setting import and export paths • [YouTube] Fixed comment like count -And much more \ No newline at end of file +And much more From 49b12ea4f804af9fae5a797e75a63b7e3c77707d Mon Sep 17 00:00:00 2001 From: TobiGr Date: Sun, 6 Jun 2021 11:56:15 +0200 Subject: [PATCH 67/72] Increase space for metadata typeview Some translations come with longer words causing them to wrap at strange positions --- app/src/main/res/layout/item_metadata.xml | 2 +- app/src/main/res/layout/item_metadata_tags.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/layout/item_metadata.xml b/app/src/main/res/layout/item_metadata.xml index b9015e603..43dce5cfb 100644 --- a/app/src/main/res/layout/item_metadata.xml +++ b/app/src/main/res/layout/item_metadata.xml @@ -12,7 +12,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:orientation="vertical" - app:layout_constraintGuide_percent="0.23" /> + app:layout_constraintGuide_percent="0.30" /> + app:layout_constraintGuide_percent="0.30" /> Date: Sun, 6 Jun 2021 11:56:38 +0200 Subject: [PATCH 68/72] Kotlin auto formatting --- .../newpipe/local/subscription/SubscriptionFragment.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionFragment.kt b/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionFragment.kt index 13643af15..8a235fa8a 100644 --- a/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionFragment.kt +++ b/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionFragment.kt @@ -294,8 +294,10 @@ class SubscriptionFragment : BaseStateFragment() { } private fun showLongTapDialog(selectedItem: ChannelInfoItem) { - val commands = arrayOf(getString(R.string.share), getString(R.string.open_in_browser), - getString(R.string.unsubscribe)) + val commands = arrayOf( + getString(R.string.share), getString(R.string.open_in_browser), + getString(R.string.unsubscribe) + ) val actions = DialogInterface.OnClickListener { _, i -> when (i) { From d921e2e61b3577469b26e361bd05483343f7b864 Mon Sep 17 00:00:00 2001 From: Douile <25043847+Douile@users.noreply.github.com> Date: Mon, 7 Jun 2021 02:10:44 +0100 Subject: [PATCH 69/72] Hide queue duration when displaying segment panel Fixes #6441 --- app/src/main/java/org/schabi/newpipe/player/Player.java | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/org/schabi/newpipe/player/Player.java b/app/src/main/java/org/schabi/newpipe/player/Player.java index 44d10df37..d51a25789 100644 --- a/app/src/main/java/org/schabi/newpipe/player/Player.java +++ b/app/src/main/java/org/schabi/newpipe/player/Player.java @@ -3029,6 +3029,7 @@ public final class Player implements buildSegments(); binding.itemsListHeaderTitle.setVisibility(View.VISIBLE); + binding.itemsListHeaderDuration.setVisibility(View.GONE); binding.shuffleButton.setVisibility(View.GONE); binding.repeatButton.setVisibility(View.GONE); From 8f027e274ed302766cdc91db17b5ed68216d3183 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Mon, 7 Jun 2021 20:37:26 +0200 Subject: [PATCH 70/72] Translated using Weblate (Chinese (Simplified)) Currently translated at 100.0% (51 of 51 strings) Translated using Weblate (German) Currently translated at 56.8% (29 of 51 strings) Translated using Weblate (Polish) Currently translated at 99.6% (655 of 657 strings) Translated using Weblate (Italian) Currently translated at 100.0% (657 of 657 strings) Translated using Weblate (French) Currently translated at 100.0% (657 of 657 strings) Translated using Weblate (German) Currently translated at 56.8% (29 of 51 strings) Translated using Weblate (Sardinian) Currently translated at 100.0% (657 of 657 strings) Translated using Weblate (Chinese (Simplified)) Currently translated at 100.0% (51 of 51 strings) Translated using Weblate (Interlingua) Currently translated at 40.1% (264 of 657 strings) Translated using Weblate (Chinese (Simplified)) Currently translated at 100.0% (657 of 657 strings) Translated using Weblate (French) Currently translated at 99.8% (656 of 657 strings) Translated using Weblate (German) Currently translated at 100.0% (657 of 657 strings) Co-authored-by: Ajeje Brazorf Co-authored-by: Eric Co-authored-by: Hosted Weblate Co-authored-by: J. Lavoie Co-authored-by: Michal L Co-authored-by: Software In Interlingua Co-authored-by: TiA4f8R Co-authored-by: TobiGr Co-authored-by: VfBFan Co-authored-by: chr56 Co-authored-by: nautilusx Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/de/ Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/zh_Hans/ Translation: NewPipe/Metadata --- app/src/main/res/values-b+zh+HANS+CN/strings.xml | 16 ++++++++-------- app/src/main/res/values-de/strings.xml | 4 ++-- app/src/main/res/values-fr/strings.xml | 5 +++-- app/src/main/res/values-ia/strings.xml | 1 + app/src/main/res/values-it/strings.xml | 2 +- app/src/main/res/values-pl/strings.xml | 14 ++++++++++++++ app/src/main/res/values-sc/strings.xml | 16 ++++++++++++++++ fastlane/metadata/android/de/changelogs/970.txt | 11 +++++++++++ .../metadata/android/zh-Hans/changelogs/970.txt | 10 ++++++++++ 9 files changed, 66 insertions(+), 13 deletions(-) create mode 100644 fastlane/metadata/android/de/changelogs/970.txt create mode 100644 fastlane/metadata/android/zh-Hans/changelogs/970.txt diff --git a/app/src/main/res/values-b+zh+HANS+CN/strings.xml b/app/src/main/res/values-b+zh+HANS+CN/strings.xml index 187ecda1c..52805a43c 100644 --- a/app/src/main/res/values-b+zh+HANS+CN/strings.xml +++ b/app/src/main/res/values-b+zh+HANS+CN/strings.xml @@ -678,20 +678,20 @@ 显示频道详情 如果遇到黑屏或视频播放卡顿的情况,请禁用媒体隧道 禁用媒体隧道 - 禁止选择描述中的文本 + 关闭简介中的文本选择功能 内部 - 私密 - 未列出 + 私享 + 未分类 公开 缩略图 URL - 主机 + 所在服务器 支持 语言 年龄限制 - 隐私 - 许可证 + 私有性 + 发行许可 标签 类别 - 允许选择描述中的文本 - 你现在可以选择描述中的文本。请注意,在选择模式下,页面可能会闪烁,链接可能变得无法点击。 + 开启简介中的文本选择功能 + 你现在可以选择简介中的文本,注意,在选择模式下,页面可能会闪烁,链接可能无法点击。 \ No newline at end of file diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index aff2c1e64..66f163bae 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -251,7 +251,7 @@ In den Hintergrund wechseln Zum Pop-up wechseln Zur normalen Wiedergabe wechseln - Externe Abspielprogramme unterstützen diese Art von Links nicht + Externe Player unterstützen diese Art von Links nicht Ungültige URL Keine Video-Streams gefunden Keine Audio-Streams gefunden @@ -632,7 +632,7 @@ Nichts Warteschlange abspielen Automatische Warteschlange - Der Wechsel von einem Abspielprogramm zu einem anderen kann Ihre Warteschlange überschreiben + Der Wechsel von einem Player zu einem anderen kann deine Warteschlange überschreiben Überschreiben der Warteschlange bestätigen Die aktive Player-Warteschlange wird ersetzt Eingereiht diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index e6bf26f8c..3476b8cfb 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -688,13 +688,14 @@ Privé Non répertorié Public - URL de la vignette + URL de la miniature Hôte Support Langue Limite d\'âge - Vie privée + Confidentialité Licence Étiquettes Catégorie + Vous pouvez maintenant sélectionner du texte à l\'intérieur de la description. Notez que la page peut scintiller et que les liens peuvent ne pas être cliquables en mode sélection. \ No newline at end of file diff --git a/app/src/main/res/values-ia/strings.xml b/app/src/main/res/values-ia/strings.xml index 28b0511b7..95703334b 100644 --- a/app/src/main/res/values-ia/strings.xml +++ b/app/src/main/res/values-ia/strings.xml @@ -256,4 +256,5 @@ Usar le recerca rapide e inexacte Thema nocturne Nihil + Monstrar le description \ No newline at end of file diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 5fc10029b..1efc03209 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -695,5 +695,5 @@ Categoria Disattiva la selezione del testo nella descrizione Attiva la selezione del testo nella descrizione - Ora puoi selezionare il testo all\'interno della descrizione. Nota che la pagina potrebbe sfarfallare e i link potrebbero non essere cliccabili mentre sei in modalità di selezione. + Ora puoi selezionare il testo all\'interno della descrizione. Nota che la pagina potrebbe sfarfallare e i collegamenti potrebbero non essere cliccabili mentre sei in modalità di selezione. \ No newline at end of file diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 716a96f85..8fb599aa2 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -690,4 +690,18 @@ Pokaż szczegóły kanału Wyłącz tunelowanie multimediów jeśli zaobserwowałeś czarny ekran bądź brak płynności odtwarzania wideo Wyłącz tunelowanie multimediów + Ograniczenie wieku + Wyłącz zaznaczanie tekstu w opisie + Włącz zaznaczanie tekstu w opisie + Wewnętrzny + Prywatny + Publiczny + Adres URL miniatury + Host + Wsparcie + Język + Prywatność + Licencja + Tagi + Kategoria \ No newline at end of file diff --git a/app/src/main/res/values-sc/strings.xml b/app/src/main/res/values-sc/strings.xml index 2d5597d90..955e4d5e0 100644 --- a/app/src/main/res/values-sc/strings.xml +++ b/app/src/main/res/values-sc/strings.xml @@ -680,4 +680,20 @@ Ammustra sos detàllios de su canale Disabìlita sa tunnellizatzione de sos elementos multimediales si durante sa riprodutzione bi sunt ischermadas nieddas o su flussu de su vìdeu no est regulare Disabìlita sa tunnellizatzione de sos mèdios + Internu + No elencadu + Privadu + Pùblicu + URL de sa miniadura + Istrangiadore + Suportu + Limba + Lìmite de edade + Riservadesa + Litzèntzia + Etichetas + Categoria + Disabìlita s\'ischerta de su testu in sa descritzione + Abìlita s\'ischerta de su testu in sa descritzione + Como podes ischertare su testu in intro de sa descritzione. Ammenta·ti chi sa pàgina diat pòdere trèmere e sos ligàmenes si diant pòdere no abèrrere cando ses in modalidade de ischerta. \ No newline at end of file diff --git a/fastlane/metadata/android/de/changelogs/970.txt b/fastlane/metadata/android/de/changelogs/970.txt new file mode 100644 index 000000000..301ea1e3f --- /dev/null +++ b/fastlane/metadata/android/de/changelogs/970.txt @@ -0,0 +1,11 @@ +Neu +• Inhaltsmetadaten (Tags, Kategorien, Lizenz, ...) unter der Beschreibung anzeigen +• Option "Kanaldetails anzeigen" in remote (nicht lokalen) Wiedergabelisten hinzugefügt +• Option "Im Browser öffnen" zum Langdruck-Menü hinzugefügt + +Behoben +• Rotationsabsturz auf der Videodetailseite +• "Mit Kodi spielen"-Button im Player fordert immer auf, Kore zu installieren +• Setzen von Import- und Exportpfaden wurde behoben und verbessert +• [YouTube] Anzahl Kommentar-Likes korrigiert +Und vieles mehr diff --git a/fastlane/metadata/android/zh-Hans/changelogs/970.txt b/fastlane/metadata/android/zh-Hans/changelogs/970.txt new file mode 100644 index 000000000..a29e44b31 --- /dev/null +++ b/fastlane/metadata/android/zh-Hans/changelogs/970.txt @@ -0,0 +1,10 @@ +新增 +• 在音视频简介下方显示元数据 (标签、类别、发行许可证...) +• 在远程(非本地)播放列表中添加"显示频道详情"选项 +• 在长按菜单中添加"在浏览器中打开"选项 +修复 +• 修复 视频详情页面旋转屏幕时崩溃 +• 修复 在播放器内"使用Kodi播放"按钮总是提示安装Kore +• 修复和改进了设置导出导入路径 +• [YouTube]修复 评论点赞计数 +• 以及修复其他细小问题 From 3fe03684864366e8f337e9312b0c0c592059c9e1 Mon Sep 17 00:00:00 2001 From: TobiGr Date: Mon, 7 Jun 2021 20:39:55 +0200 Subject: [PATCH 71/72] Update NewPIpe extractor to 0.21.4 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index cccf78666..8aee664fd 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -183,7 +183,7 @@ dependencies { /** NewPipe libraries **/ // You can use a local version by uncommenting a few lines in settings.gradle implementation 'com.github.TeamNewPipe:nanojson:1d9e1aea9049fc9f85e68b43ba39fe7be1c1f751' - implementation 'com.github.TeamNewPipe:NewPipeExtractor:8c42a486736509e7d382f4c0d9c93ad020de6b79' + implementation 'com.github.TeamNewPipe:NewPipeExtractor:v0.21.4' /** Checkstyle **/ checkstyle "com.puppycrawl.tools:checkstyle:${checkstyleVersion}" From f1e86679450655f51aebb4a61d5c7ca88fea4ec7 Mon Sep 17 00:00:00 2001 From: TobiGr Date: Sat, 5 Jun 2021 17:27:06 +0200 Subject: [PATCH 72/72] NewPipe 0.21.4 (970) --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 8aee664fd..ed9fad797 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -17,8 +17,8 @@ android { resValue "string", "app_name", "NewPipe" minSdkVersion 19 targetSdkVersion 29 - versionCode 969 - versionName "0.21.3" + versionCode 970 + versionName "0.21.4" multiDexEnabled true