From 164ef065de922dcdf2787d92a0459fb835f6028f Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Fri, 15 Apr 2022 15:22:40 +0200 Subject: [PATCH 01/18] Use NewPipeExtractor with changes --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 36bee05a0d1..c34206d2855 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -190,7 +190,7 @@ dependencies { // name and the commit hash with the commit hash of the (pushed) commit you want to test // This works thanks to JitPack: https://jitpack.io/ implementation 'com.github.TeamNewPipe:nanojson:1d9e1aea9049fc9f85e68b43ba39fe7be1c1f751' - implementation 'com.github.TeamNewPipe:NewPipeExtractor:ac1c22d81c65b7b0c5427f4e1989f5256d617f32' + implementation 'com.github.litetex:NewPipeExtractor:invidious-SNAPSHOT' /** Checkstyle **/ checkstyle "com.puppycrawl.tools:checkstyle:${checkstyleVersion}" From 04e6c5c60e6cdc70e821fc6ba7229c864e8ae7d7 Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Fri, 15 Apr 2022 16:09:51 +0200 Subject: [PATCH 02/18] Add YT-plugable API changes and support invidious * Reworked managing of instances * Made YT proxyable * Reworked UIs * Added UIs for management (still in progress) --- app/src/main/java/org/schabi/newpipe/App.java | 2 +- .../java/org/schabi/newpipe/MainActivity.java | 63 ++- .../org/schabi/newpipe/error/ErrorInfo.kt | 2 +- .../schabi/newpipe/error/ErrorPanelHelper.kt | 2 +- .../newpipe/fragments/MainFragment.java | 2 +- .../list/kiosk/DefaultKioskFragment.java | 2 +- .../list/playlist/PlaylistFragment.java | 6 +- .../fragments/list/search/SearchFragment.java | 4 +- .../SubscriptionsImportFragment.java | 2 +- .../subscription/item/FeedImportExportItem.kt | 2 +- .../newpipe/player/PlayQueueActivity.java | 2 +- .../player/playback/MediaSourceManager.java | 2 +- .../PeertubeInstanceListFragment.java | 431 ------------------ .../newpipe/settings/SelectKioskFragment.java | 5 +- .../AbstractInstanceTypeCreator.java | 39 ++ .../AbstractServiceInstanceListFragment.java | 427 +++++++++++++++++ .../serviceinstances/InstanceTypeCreator.java | 62 +++ .../UrlMultiInstanceTypeCreator.java | 128 ++++++ .../PeertubeInstanceListFragment.java | 32 ++ .../YouTubeLikeInstanceListFragment.java | 72 +++ .../org/schabi/newpipe/settings/tabs/Tab.java | 2 +- .../org/schabi/newpipe/util/InfoCache.java | 1 + .../schabi/newpipe/util/KioskTranslator.java | 1 + .../schabi/newpipe/util/PeertubeHelper.java | 71 --- .../services/AbstractInstanceManager.java | 113 +++++ .../util/services/InstanceManager.java | 19 + .../services/PeertubeInstanceManager.java | 51 +++ .../util/{ => services}/ServiceHelper.java | 16 +- .../services/YoutubeLikeInstanceManager.java | 69 +++ .../main/res/layout/dialog_add_instance.xml | 38 ++ .../main/res/layout/fragment_choose_tabs.xml | 2 +- .../res/layout/fragment_instance_list.xml | 60 ++- .../layout/instance_type_floating_item.xml | 40 ++ app/src/main/res/values-ar/strings.xml | 11 +- app/src/main/res/values-az/strings.xml | 1 - app/src/main/res/values-b+ast/strings.xml | 10 +- app/src/main/res/values-b+uz+Latn/strings.xml | 9 +- .../main/res/values-b+zh+HANS+CN/strings.xml | 11 +- app/src/main/res/values-be/strings.xml | 8 +- app/src/main/res/values-bg/strings.xml | 4 +- app/src/main/res/values-bn-rBD/strings.xml | 5 +- app/src/main/res/values-bn-rIN/strings.xml | 5 +- app/src/main/res/values-bn/strings.xml | 9 +- app/src/main/res/values-ca/strings.xml | 11 +- app/src/main/res/values-ckb/strings.xml | 11 +- app/src/main/res/values-cs/strings.xml | 11 +- app/src/main/res/values-da/strings.xml | 9 +- app/src/main/res/values-de/strings.xml | 11 +- app/src/main/res/values-el/strings.xml | 11 +- app/src/main/res/values-eo/strings.xml | 9 +- app/src/main/res/values-es/strings.xml | 11 +- app/src/main/res/values-et/strings.xml | 11 +- app/src/main/res/values-eu/strings.xml | 11 +- app/src/main/res/values-fa/strings.xml | 11 +- app/src/main/res/values-fi/strings.xml | 11 +- app/src/main/res/values-fr/strings.xml | 11 +- app/src/main/res/values-gl/strings.xml | 11 +- app/src/main/res/values-he/strings.xml | 11 +- app/src/main/res/values-hi/strings.xml | 9 +- app/src/main/res/values-hr/strings.xml | 11 +- app/src/main/res/values-hu/strings.xml | 12 +- app/src/main/res/values-ia/strings.xml | 7 +- app/src/main/res/values-in/strings.xml | 11 +- app/src/main/res/values-it/strings.xml | 11 +- app/src/main/res/values-ja/strings.xml | 11 +- app/src/main/res/values-kmr/strings.xml | 9 +- app/src/main/res/values-ko/strings.xml | 9 +- app/src/main/res/values-ku/strings.xml | 9 +- app/src/main/res/values-lt/strings.xml | 11 +- app/src/main/res/values-lv/strings.xml | 11 +- app/src/main/res/values-mk/strings.xml | 2 - app/src/main/res/values-ml/strings.xml | 11 +- app/src/main/res/values-nb-rNO/strings.xml | 11 +- app/src/main/res/values-ne/strings.xml | 9 +- app/src/main/res/values-nl-rBE/strings.xml | 11 +- app/src/main/res/values-nl/strings.xml | 11 +- app/src/main/res/values-pa/strings.xml | 9 +- app/src/main/res/values-pl/strings.xml | 11 +- app/src/main/res/values-pt-rBR/strings.xml | 11 +- app/src/main/res/values-pt-rPT/strings.xml | 11 +- app/src/main/res/values-pt/strings.xml | 11 +- app/src/main/res/values-ro/strings.xml | 11 +- app/src/main/res/values-ru/strings.xml | 11 +- app/src/main/res/values-sc/strings.xml | 11 +- app/src/main/res/values-sk/strings.xml | 11 +- app/src/main/res/values-sl/strings.xml | 9 +- app/src/main/res/values-so/strings.xml | 9 +- app/src/main/res/values-sq/strings.xml | 9 +- app/src/main/res/values-sr/strings.xml | 9 +- app/src/main/res/values-sv/strings.xml | 11 +- app/src/main/res/values-ta/strings.xml | 11 +- app/src/main/res/values-te/strings.xml | 11 +- app/src/main/res/values-tr/strings.xml | 11 +- app/src/main/res/values-uk/strings.xml | 11 +- app/src/main/res/values-ur/strings.xml | 9 +- app/src/main/res/values-vi/strings.xml | 13 +- app/src/main/res/values-zh-rCN/strings.xml | 9 +- app/src/main/res/values-zh-rHK/strings.xml | 5 +- app/src/main/res/values-zh-rTW/strings.xml | 11 +- app/src/main/res/values/donottranslate.xml | 1 + app/src/main/res/values/settings_keys.xml | 3 + app/src/main/res/values/strings.xml | 16 +- app/src/main/res/xml/content_settings.xml | 10 +- 103 files changed, 1455 insertions(+), 990 deletions(-) delete mode 100644 app/src/main/java/org/schabi/newpipe/settings/PeertubeInstanceListFragment.java create mode 100644 app/src/main/java/org/schabi/newpipe/settings/serviceinstances/AbstractInstanceTypeCreator.java create mode 100644 app/src/main/java/org/schabi/newpipe/settings/serviceinstances/AbstractServiceInstanceListFragment.java create mode 100644 app/src/main/java/org/schabi/newpipe/settings/serviceinstances/InstanceTypeCreator.java create mode 100644 app/src/main/java/org/schabi/newpipe/settings/serviceinstances/UrlMultiInstanceTypeCreator.java create mode 100644 app/src/main/java/org/schabi/newpipe/settings/serviceinstances/peertube/PeertubeInstanceListFragment.java create mode 100644 app/src/main/java/org/schabi/newpipe/settings/serviceinstances/youtubelike/YouTubeLikeInstanceListFragment.java delete mode 100644 app/src/main/java/org/schabi/newpipe/util/PeertubeHelper.java create mode 100644 app/src/main/java/org/schabi/newpipe/util/services/AbstractInstanceManager.java create mode 100644 app/src/main/java/org/schabi/newpipe/util/services/InstanceManager.java create mode 100644 app/src/main/java/org/schabi/newpipe/util/services/PeertubeInstanceManager.java rename app/src/main/java/org/schabi/newpipe/util/{ => services}/ServiceHelper.java (96%) create mode 100644 app/src/main/java/org/schabi/newpipe/util/services/YoutubeLikeInstanceManager.java create mode 100644 app/src/main/res/layout/dialog_add_instance.xml create mode 100644 app/src/main/res/layout/instance_type_floating_item.xml diff --git a/app/src/main/java/org/schabi/newpipe/App.java b/app/src/main/java/org/schabi/newpipe/App.java index 70c9474786a..b0e44c94025 100644 --- a/app/src/main/java/org/schabi/newpipe/App.java +++ b/app/src/main/java/org/schabi/newpipe/App.java @@ -21,8 +21,8 @@ import org.schabi.newpipe.settings.NewPipeSettings; import org.schabi.newpipe.util.Localization; import org.schabi.newpipe.util.PicassoHelper; -import org.schabi.newpipe.util.ServiceHelper; import org.schabi.newpipe.util.StateSaver; +import org.schabi.newpipe.util.services.ServiceHelper; import java.io.IOException; import java.io.InterruptedIOException; diff --git a/app/src/main/java/org/schabi/newpipe/MainActivity.java b/app/src/main/java/org/schabi/newpipe/MainActivity.java index fcb9d9725d0..26a044d1e11 100644 --- a/app/src/main/java/org/schabi/newpipe/MainActivity.java +++ b/app/src/main/java/org/schabi/newpipe/MainActivity.java @@ -63,10 +63,11 @@ import org.schabi.newpipe.databinding.InstanceSpinnerLayoutBinding; import org.schabi.newpipe.databinding.ToolbarLayoutBinding; import org.schabi.newpipe.error.ErrorUtil; +import org.schabi.newpipe.extractor.InstanceBasedStreamingService; import org.schabi.newpipe.extractor.NewPipe; import org.schabi.newpipe.extractor.StreamingService; import org.schabi.newpipe.extractor.exceptions.ExtractionException; -import org.schabi.newpipe.extractor.services.peertube.PeertubeInstance; +import org.schabi.newpipe.extractor.instance.Instance; import org.schabi.newpipe.fragments.BackPressable; import org.schabi.newpipe.fragments.MainFragment; import org.schabi.newpipe.fragments.detail.VideoDetailFragment; @@ -81,13 +82,15 @@ import org.schabi.newpipe.util.KioskTranslator; import org.schabi.newpipe.util.Localization; import org.schabi.newpipe.util.NavigationHelper; -import org.schabi.newpipe.util.PeertubeHelper; import org.schabi.newpipe.util.PermissionHelper; import org.schabi.newpipe.util.SerializedCache; -import org.schabi.newpipe.util.ServiceHelper; import org.schabi.newpipe.util.StateSaver; import org.schabi.newpipe.util.TLSSocketFactoryCompat; import org.schabi.newpipe.util.ThemeHelper; +import org.schabi.newpipe.util.services.InstanceManager; +import org.schabi.newpipe.util.services.PeertubeInstanceManager; +import org.schabi.newpipe.util.services.ServiceHelper; +import org.schabi.newpipe.util.services.YoutubeLikeInstanceManager; import org.schabi.newpipe.views.FocusOverlayView; import java.util.ArrayList; @@ -389,8 +392,14 @@ private void showServices() { .setIcon(ServiceHelper.getIcon(s.getServiceId())); // peertube specifics - if (s.getServiceId() == 3) { - enhancePeertubeMenu(s, menuItem); + InstanceManager instanceManager = null; + if (s.getServiceId() == 0) { + instanceManager = YoutubeLikeInstanceManager.MANAGER; + } else if (s.getServiceId() == 3) { + instanceManager = PeertubeInstanceManager.MANAGER; + } + if (instanceManager != null) { + enhanceServiceMenu(menuItem, instanceManager); } } drawerLayoutBinding.navigation.getMenu() @@ -398,15 +407,15 @@ private void showServices() { .setChecked(true); } - private void enhancePeertubeMenu(final StreamingService s, final MenuItem menuItem) { - final PeertubeInstance currentInstance = PeertubeHelper.getCurrentInstance(); - menuItem.setTitle(currentInstance.getName() + (ServiceHelper.isBeta(s) ? " (beta)" : "")); - final Spinner spinner = InstanceSpinnerLayoutBinding.inflate(LayoutInflater.from(this)) - .getRoot(); - final List instances = PeertubeHelper.getInstanceList(this); + private void enhanceServiceMenu(final MenuItem menuItem, + final InstanceManager manager) { + final I currentInstance = manager.getCurrentInstance(); + menuItem.setTitle(currentInstance.getName()); + + final List allInstances = manager.getInstanceList(getApplicationContext()); final List items = new ArrayList<>(); int defaultSelect = 0; - for (final PeertubeInstance instance : instances) { + for (final I instance : allInstances) { items.add(instance.getName()); if (instance.getUrl().equals(currentInstance.getUrl())) { defaultSelect = items.size() - 1; @@ -415,29 +424,34 @@ private void enhancePeertubeMenu(final StreamingService s, final MenuItem menuIt final ArrayAdapter adapter = new ArrayAdapter<>(this, R.layout.instance_spinner_item, items); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + + final Spinner spinner = + InstanceSpinnerLayoutBinding.inflate(LayoutInflater.from(this)).getRoot(); spinner.setAdapter(adapter); spinner.setSelection(defaultSelect, false); spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(final AdapterView parent, final View view, final int position, final long id) { - final PeertubeInstance newInstance = instances.get(position); - if (newInstance.getUrl().equals(PeertubeHelper.getCurrentInstance().getUrl())) { + final I newInstance = allInstances.get(position); + if (newInstance.getUrl().equals(manager.getCurrentInstance().getUrl())) { return; } - PeertubeHelper.selectInstance(newInstance, getApplicationContext()); + + manager.saveCurrentInstance(newInstance, getApplicationContext()); + changeService(menuItem); mainBinding.getRoot().closeDrawers(); new Handler(Looper.getMainLooper()).postDelayed(() -> { - getSupportFragmentManager().popBackStack(null, - FragmentManager.POP_BACK_STACK_INCLUSIVE); + getSupportFragmentManager() + .popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE); ActivityCompat.recreate(MainActivity.this); }, 300); } @Override public void onNothingSelected(final AdapterView parent) { - + // Do nothing } }); menuItem.setActionView(spinner); @@ -466,8 +480,17 @@ protected void onResume() { mainBinding.getRoot().closeDrawer(GravityCompat.START, false); try { final int selectedServiceId = ServiceHelper.getSelectedServiceId(this); - final String selectedServiceName = NewPipe.getService(selectedServiceId) - .getServiceInfo().getName(); + final StreamingService service = NewPipe.getService(selectedServiceId); + String selectedServiceName = service.getServiceInfo().getName(); + if (service instanceof InstanceBasedStreamingService) { + final Instance instance = + ((InstanceBasedStreamingService) service).getInstance(); + selectedServiceName = + (instance.getServiceName() != null + ? instance.getServiceName() + " / " + : "") + instance.getName(); + } + drawerHeaderBinding.drawerHeaderServiceView.setText(selectedServiceName); drawerHeaderBinding.drawerHeaderServiceIcon.setImageResource(ServiceHelper .getIcon(selectedServiceId)); diff --git a/app/src/main/java/org/schabi/newpipe/error/ErrorInfo.kt b/app/src/main/java/org/schabi/newpipe/error/ErrorInfo.kt index b2ba912ecfa..4b870d8dcc1 100644 --- a/app/src/main/java/org/schabi/newpipe/error/ErrorInfo.kt +++ b/app/src/main/java/org/schabi/newpipe/error/ErrorInfo.kt @@ -12,7 +12,7 @@ import org.schabi.newpipe.extractor.exceptions.AccountTerminatedException import org.schabi.newpipe.extractor.exceptions.ContentNotAvailableException import org.schabi.newpipe.extractor.exceptions.ContentNotSupportedException import org.schabi.newpipe.extractor.exceptions.ExtractionException -import org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeStreamExtractor.DeobfuscateException +import org.schabi.newpipe.extractor.services.youtube.youtube.extractors.YoutubeStreamExtractor.DeobfuscateException import org.schabi.newpipe.ktx.isNetworkRelated import java.io.PrintWriter import java.io.StringWriter diff --git a/app/src/main/java/org/schabi/newpipe/error/ErrorPanelHelper.kt b/app/src/main/java/org/schabi/newpipe/error/ErrorPanelHelper.kt index 692cb427afc..ee7cacf505a 100644 --- a/app/src/main/java/org/schabi/newpipe/error/ErrorPanelHelper.kt +++ b/app/src/main/java/org/schabi/newpipe/error/ErrorPanelHelper.kt @@ -30,7 +30,7 @@ import org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty import org.schabi.newpipe.ktx.animate import org.schabi.newpipe.ktx.isInterruptedCaused import org.schabi.newpipe.ktx.isNetworkRelated -import org.schabi.newpipe.util.ServiceHelper +import org.schabi.newpipe.util.services.ServiceHelper import java.util.concurrent.TimeUnit class ErrorPanelHelper( diff --git a/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java index de68269e954..eeec957dcfe 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java @@ -28,7 +28,7 @@ import org.schabi.newpipe.settings.tabs.Tab; import org.schabi.newpipe.settings.tabs.TabsManager; import org.schabi.newpipe.util.NavigationHelper; -import org.schabi.newpipe.util.ServiceHelper; +import org.schabi.newpipe.util.services.ServiceHelper; import java.util.ArrayList; import java.util.List; diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/kiosk/DefaultKioskFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/kiosk/DefaultKioskFragment.java index d0b9e3a3dd2..f664260d188 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/kiosk/DefaultKioskFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/kiosk/DefaultKioskFragment.java @@ -8,7 +8,7 @@ import org.schabi.newpipe.extractor.exceptions.ExtractionException; import org.schabi.newpipe.extractor.kiosk.KioskList; import org.schabi.newpipe.util.KioskTranslator; -import org.schabi.newpipe.util.ServiceHelper; +import org.schabi.newpipe.util.services.ServiceHelper; public class DefaultKioskFragment extends KioskFragment { 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 5bf20c144f3..c39cee46464 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 @@ -37,7 +37,7 @@ import org.schabi.newpipe.extractor.ListExtractor; import org.schabi.newpipe.extractor.ServiceList; import org.schabi.newpipe.extractor.playlist.PlaylistInfo; -import org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper; +import org.schabi.newpipe.extractor.services.youtube.shared.YoutubePlaylistHelper; import org.schabi.newpipe.extractor.stream.StreamInfoItem; import org.schabi.newpipe.fragments.list.BaseListInfoFragment; import org.schabi.newpipe.info_list.dialog.InfoItemDialog; @@ -286,8 +286,8 @@ public void handleResult(@NonNull final PlaylistInfo result) { final String avatarUrl = result.getUploaderAvatarUrl(); if (result.getServiceId() == ServiceList.YouTube.getServiceId() - && (YoutubeParsingHelper.isYoutubeMixId(result.getId()) - || YoutubeParsingHelper.isYoutubeMusicMixId(result.getId()))) { + && (YoutubePlaylistHelper.isYoutubeMixId(result.getId()) + || YoutubePlaylistHelper.isYoutubeMusicMixId(result.getId()))) { // this is an auto-generated playlist (e.g. Youtube mix), so a radio is shown final ShapeAppearanceModel model = ShapeAppearanceModel.builder() .setAllCorners(CornerFamily.ROUNDED, 0f) 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 055c277330f..9a8fc63b41a 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 @@ -53,7 +53,7 @@ import org.schabi.newpipe.extractor.search.SearchExtractor; import org.schabi.newpipe.extractor.search.SearchInfo; import org.schabi.newpipe.extractor.services.peertube.linkHandler.PeertubeSearchQueryHandlerFactory; -import org.schabi.newpipe.extractor.services.youtube.linkHandler.YoutubeSearchQueryHandlerFactory; +import org.schabi.newpipe.extractor.services.youtube.youtube.linkHandler.YoutubeSearchQueryHandlerFactory; import org.schabi.newpipe.fragments.BackPressable; import org.schabi.newpipe.fragments.list.BaseListFragment; import org.schabi.newpipe.ktx.AnimationType; @@ -65,7 +65,7 @@ import org.schabi.newpipe.util.ExtractorHelper; import org.schabi.newpipe.util.KeyboardUtil; import org.schabi.newpipe.util.NavigationHelper; -import org.schabi.newpipe.util.ServiceHelper; +import org.schabi.newpipe.util.services.ServiceHelper; import java.util.ArrayList; import java.util.Arrays; diff --git a/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionsImportFragment.java b/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionsImportFragment.java index 4737fa14fae..4e4cb807ba5 100644 --- a/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionsImportFragment.java +++ b/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionsImportFragment.java @@ -33,7 +33,7 @@ import org.schabi.newpipe.streams.io.NoFileManagerSafeGuard; import org.schabi.newpipe.streams.io.StoredFileHelper; import org.schabi.newpipe.util.Constants; -import org.schabi.newpipe.util.ServiceHelper; +import org.schabi.newpipe.util.services.ServiceHelper; import java.util.Collections; import java.util.List; diff --git a/app/src/main/java/org/schabi/newpipe/local/subscription/item/FeedImportExportItem.kt b/app/src/main/java/org/schabi/newpipe/local/subscription/item/FeedImportExportItem.kt index aacfc77adc4..34c277c971d 100644 --- a/app/src/main/java/org/schabi/newpipe/local/subscription/item/FeedImportExportItem.kt +++ b/app/src/main/java/org/schabi/newpipe/local/subscription/item/FeedImportExportItem.kt @@ -14,8 +14,8 @@ import org.schabi.newpipe.databinding.FeedImportExportGroupBinding import org.schabi.newpipe.extractor.NewPipe import org.schabi.newpipe.extractor.exceptions.ExtractionException import org.schabi.newpipe.ktx.animateRotation -import org.schabi.newpipe.util.ServiceHelper import org.schabi.newpipe.util.ThemeHelper +import org.schabi.newpipe.util.services.ServiceHelper import org.schabi.newpipe.views.CollapsibleView class FeedImportExportItem( 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 676d634584a..74fdea56325 100644 --- a/app/src/main/java/org/schabi/newpipe/player/PlayQueueActivity.java +++ b/app/src/main/java/org/schabi/newpipe/player/PlayQueueActivity.java @@ -40,7 +40,7 @@ import org.schabi.newpipe.util.Localization; import org.schabi.newpipe.util.NavigationHelper; import org.schabi.newpipe.util.PermissionHelper; -import org.schabi.newpipe.util.ServiceHelper; +import org.schabi.newpipe.util.services.ServiceHelper; import org.schabi.newpipe.util.ThemeHelper; public final class PlayQueueActivity extends AppCompatActivity diff --git a/app/src/main/java/org/schabi/newpipe/player/playback/MediaSourceManager.java b/app/src/main/java/org/schabi/newpipe/player/playback/MediaSourceManager.java index 9b13bb3d7d7..1cac66042a5 100644 --- a/app/src/main/java/org/schabi/newpipe/player/playback/MediaSourceManager.java +++ b/app/src/main/java/org/schabi/newpipe/player/playback/MediaSourceManager.java @@ -23,7 +23,7 @@ import org.schabi.newpipe.player.playqueue.events.PlayQueueEvent; import org.schabi.newpipe.player.playqueue.events.RemoveEvent; import org.schabi.newpipe.player.playqueue.events.ReorderEvent; -import org.schabi.newpipe.util.ServiceHelper; +import org.schabi.newpipe.util.services.ServiceHelper; import java.util.Collection; import java.util.Collections; diff --git a/app/src/main/java/org/schabi/newpipe/settings/PeertubeInstanceListFragment.java b/app/src/main/java/org/schabi/newpipe/settings/PeertubeInstanceListFragment.java deleted file mode 100644 index c7eb0be40fb..00000000000 --- a/app/src/main/java/org/schabi/newpipe/settings/PeertubeInstanceListFragment.java +++ /dev/null @@ -1,431 +0,0 @@ -package org.schabi.newpipe.settings; - -import android.annotation.SuppressLint; -import android.content.Context; -import android.content.SharedPreferences; -import android.os.Bundle; -import android.text.InputType; -import android.view.LayoutInflater; -import android.view.Menu; -import android.view.MenuInflater; -import android.view.MenuItem; -import android.view.MotionEvent; -import android.view.View; -import android.view.ViewGroup; -import android.widget.ImageView; -import android.widget.ProgressBar; -import android.widget.RadioButton; -import android.widget.TextView; -import android.widget.Toast; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.appcompat.app.AlertDialog; -import androidx.appcompat.widget.AppCompatImageView; -import androidx.fragment.app.Fragment; -import androidx.preference.PreferenceManager; -import androidx.recyclerview.widget.ItemTouchHelper; -import androidx.recyclerview.widget.LinearLayoutManager; -import androidx.recyclerview.widget.RecyclerView; - -import com.google.android.material.floatingactionbutton.FloatingActionButton; -import com.grack.nanojson.JsonStringWriter; -import com.grack.nanojson.JsonWriter; - -import org.schabi.newpipe.R; -import org.schabi.newpipe.databinding.DialogEditTextBinding; -import org.schabi.newpipe.extractor.services.peertube.PeertubeInstance; -import org.schabi.newpipe.util.Constants; -import org.schabi.newpipe.util.PeertubeHelper; -import org.schabi.newpipe.util.ThemeHelper; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers; -import io.reactivex.rxjava3.core.Single; -import io.reactivex.rxjava3.disposables.CompositeDisposable; -import io.reactivex.rxjava3.disposables.Disposable; -import io.reactivex.rxjava3.schedulers.Schedulers; - -public class PeertubeInstanceListFragment extends Fragment { - private final List instanceList = new ArrayList<>(); - private PeertubeInstance selectedInstance; - private String savedInstanceListKey; - private InstanceListAdapter instanceListAdapter; - - private ProgressBar progressBar; - private SharedPreferences sharedPreferences; - - private CompositeDisposable disposables = new CompositeDisposable(); - - /*////////////////////////////////////////////////////////////////////////// - // Lifecycle - //////////////////////////////////////////////////////////////////////////*/ - - @Override - public void onCreate(@Nullable final Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireContext()); - savedInstanceListKey = getString(R.string.peertube_instance_list_key); - selectedInstance = PeertubeHelper.getCurrentInstance(); - updateInstanceList(); - - setHasOptionsMenu(true); - } - - @Override - public View onCreateView(@NonNull final LayoutInflater inflater, final ViewGroup container, - final Bundle savedInstanceState) { - return inflater.inflate(R.layout.fragment_instance_list, container, false); - } - - @Override - public void onViewCreated(@NonNull final View rootView, - @Nullable final Bundle savedInstanceState) { - super.onViewCreated(rootView, savedInstanceState); - - initViews(rootView); - } - - private void initViews(@NonNull final View rootView) { - final TextView instanceHelpTV = rootView.findViewById(R.id.instanceHelpTV); - instanceHelpTV.setText(getString(R.string.peertube_instance_url_help, - getString(R.string.peertube_instance_list_url))); - - initButton(rootView); - - final RecyclerView listInstances = rootView.findViewById(R.id.instances); - listInstances.setLayoutManager(new LinearLayoutManager(requireContext())); - - final ItemTouchHelper itemTouchHelper = new ItemTouchHelper(getItemTouchCallback()); - itemTouchHelper.attachToRecyclerView(listInstances); - - instanceListAdapter = new InstanceListAdapter(requireContext(), itemTouchHelper); - listInstances.setAdapter(instanceListAdapter); - - progressBar = rootView.findViewById(R.id.loading_progress_bar); - } - - @Override - public void onResume() { - super.onResume(); - ThemeHelper.setTitleToAppCompatActivity(getActivity(), - getString(R.string.peertube_instance_url_title)); - } - - @Override - public void onPause() { - super.onPause(); - saveChanges(); - } - - @Override - public void onDestroy() { - super.onDestroy(); - if (disposables != null) { - disposables.clear(); - } - disposables = null; - } - - /*////////////////////////////////////////////////////////////////////////// - // Menu - //////////////////////////////////////////////////////////////////////////*/ - - @Override - public void onCreateOptionsMenu(@NonNull final Menu menu, - @NonNull final MenuInflater inflater) { - super.onCreateOptionsMenu(menu, inflater); - inflater.inflate(R.menu.menu_chooser_fragment, menu); - } - - @Override - public boolean onOptionsItemSelected(final MenuItem item) { - if (item.getItemId() == R.id.menu_item_restore_default) { - restoreDefaults(); - return true; - } - - return super.onOptionsItemSelected(item); - } - - /*////////////////////////////////////////////////////////////////////////// - // Utils - //////////////////////////////////////////////////////////////////////////*/ - - private void updateInstanceList() { - instanceList.clear(); - instanceList.addAll(PeertubeHelper.getInstanceList(requireContext())); - } - - private void selectInstance(final PeertubeInstance instance) { - selectedInstance = PeertubeHelper.selectInstance(instance, requireContext()); - sharedPreferences.edit().putBoolean(Constants.KEY_MAIN_PAGE_CHANGE, true).apply(); - } - - private void saveChanges() { - final JsonStringWriter jsonWriter = JsonWriter.string().object().array("instances"); - for (final PeertubeInstance instance : instanceList) { - jsonWriter.object(); - jsonWriter.value("name", instance.getName()); - jsonWriter.value("url", instance.getUrl()); - jsonWriter.end(); - } - final String jsonToSave = jsonWriter.end().end().done(); - sharedPreferences.edit().putString(savedInstanceListKey, jsonToSave).apply(); - } - - private void restoreDefaults() { - new AlertDialog.Builder(requireContext()) - .setTitle(R.string.restore_defaults) - .setMessage(R.string.restore_defaults_confirmation) - .setNegativeButton(R.string.cancel, null) - .setPositiveButton(R.string.ok, (dialog, which) -> { - sharedPreferences.edit().remove(savedInstanceListKey).apply(); - selectInstance(PeertubeInstance.DEFAULT_INSTANCE); - updateInstanceList(); - instanceListAdapter.notifyDataSetChanged(); - }) - .show(); - } - - private void initButton(final View rootView) { - final FloatingActionButton fab = rootView.findViewById(R.id.addInstanceButton); - fab.setOnClickListener(v -> - showAddItemDialog(requireContext())); - } - - private void showAddItemDialog(final Context c) { - final DialogEditTextBinding dialogBinding - = DialogEditTextBinding.inflate(getLayoutInflater()); - dialogBinding.dialogEditText.setInputType( - InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI); - dialogBinding.dialogEditText.setHint(R.string.peertube_instance_add_help); - - new AlertDialog.Builder(c) - .setTitle(R.string.peertube_instance_add_title) - .setIcon(R.drawable.place_holder_peertube) - .setView(dialogBinding.getRoot()) - .setNegativeButton(R.string.cancel, null) - .setPositiveButton(R.string.ok, (dialog1, which) -> { - final String url = dialogBinding.dialogEditText.getText().toString(); - addInstance(url); - }) - .show(); - } - - private void addInstance(final String url) { - final String cleanUrl = cleanUrl(url); - if (cleanUrl == null) { - return; - } - progressBar.setVisibility(View.VISIBLE); - final Disposable disposable = Single.fromCallable(() -> { - final PeertubeInstance instance = new PeertubeInstance(cleanUrl); - instance.fetchInstanceMetaData(); - return instance; - }).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) - .subscribe((instance) -> { - progressBar.setVisibility(View.GONE); - add(instance); - }, e -> { - progressBar.setVisibility(View.GONE); - Toast.makeText(getActivity(), R.string.peertube_instance_add_fail, - Toast.LENGTH_SHORT).show(); - }); - disposables.add(disposable); - } - - @Nullable - private String cleanUrl(final String url) { - String cleanUrl = url.trim(); - // if protocol not present, add https - if (!cleanUrl.startsWith("http")) { - cleanUrl = "https://" + cleanUrl; - } - // remove trailing slash - cleanUrl = cleanUrl.replaceAll("/$", ""); - // only allow https - if (!cleanUrl.startsWith("https://")) { - Toast.makeText(getActivity(), R.string.peertube_instance_add_https_only, - Toast.LENGTH_SHORT).show(); - return null; - } - // only allow if not already exists - for (final PeertubeInstance instance : instanceList) { - if (instance.getUrl().equals(cleanUrl)) { - Toast.makeText(getActivity(), R.string.peertube_instance_add_exists, - Toast.LENGTH_SHORT).show(); - return null; - } - } - return cleanUrl; - } - - private void add(final PeertubeInstance instance) { - instanceList.add(instance); - instanceListAdapter.notifyDataSetChanged(); - } - - private ItemTouchHelper.SimpleCallback getItemTouchCallback() { - return new ItemTouchHelper.SimpleCallback(ItemTouchHelper.UP | ItemTouchHelper.DOWN, - ItemTouchHelper.START | ItemTouchHelper.END) { - @Override - public int interpolateOutOfBoundsScroll(@NonNull final RecyclerView recyclerView, - final int viewSize, - final int viewSizeOutOfBounds, - final int totalSize, - final long msSinceStartScroll) { - final int standardSpeed = super.interpolateOutOfBoundsScroll(recyclerView, viewSize, - viewSizeOutOfBounds, totalSize, msSinceStartScroll); - final int minimumAbsVelocity = Math.max(12, - Math.abs(standardSpeed)); - return minimumAbsVelocity * (int) Math.signum(viewSizeOutOfBounds); - } - - @Override - public boolean onMove(@NonNull final RecyclerView recyclerView, - @NonNull final RecyclerView.ViewHolder source, - @NonNull final RecyclerView.ViewHolder target) { - if (source.getItemViewType() != target.getItemViewType() - || instanceListAdapter == null) { - return false; - } - - final int sourceIndex = source.getBindingAdapterPosition(); - final int targetIndex = target.getBindingAdapterPosition(); - instanceListAdapter.swapItems(sourceIndex, targetIndex); - return true; - } - - @Override - public boolean isLongPressDragEnabled() { - return false; - } - - @Override - public boolean isItemViewSwipeEnabled() { - return true; - } - - @Override - public void onSwiped(@NonNull final RecyclerView.ViewHolder viewHolder, - final int swipeDir) { - final int position = viewHolder.getBindingAdapterPosition(); - // do not allow swiping the selected instance - if (instanceList.get(position).getUrl().equals(selectedInstance.getUrl())) { - instanceListAdapter.notifyItemChanged(position); - return; - } - instanceList.remove(position); - instanceListAdapter.notifyItemRemoved(position); - - if (instanceList.isEmpty()) { - instanceList.add(selectedInstance); - instanceListAdapter.notifyItemInserted(0); - } - } - }; - } - - /*////////////////////////////////////////////////////////////////////////// - // List Handling - //////////////////////////////////////////////////////////////////////////*/ - - private class InstanceListAdapter - extends RecyclerView.Adapter { - private final LayoutInflater inflater; - private final ItemTouchHelper itemTouchHelper; - private RadioButton lastChecked; - - InstanceListAdapter(final Context context, final ItemTouchHelper itemTouchHelper) { - this.itemTouchHelper = itemTouchHelper; - this.inflater = LayoutInflater.from(context); - } - - public void swapItems(final int fromPosition, final int toPosition) { - Collections.swap(instanceList, fromPosition, toPosition); - notifyItemMoved(fromPosition, toPosition); - } - - @NonNull - @Override - public InstanceListAdapter.TabViewHolder onCreateViewHolder(@NonNull final ViewGroup parent, - final int viewType) { - final View view = inflater.inflate(R.layout.item_instance, parent, false); - return new InstanceListAdapter.TabViewHolder(view); - } - - @Override - public void onBindViewHolder(@NonNull final InstanceListAdapter.TabViewHolder holder, - final int position) { - holder.bind(position, holder); - } - - @Override - public int getItemCount() { - return instanceList.size(); - } - - class TabViewHolder extends RecyclerView.ViewHolder { - private final AppCompatImageView instanceIconView; - private final TextView instanceNameView; - private final TextView instanceUrlView; - private final RadioButton instanceRB; - private final ImageView handle; - - TabViewHolder(final View itemView) { - super(itemView); - - instanceIconView = itemView.findViewById(R.id.instanceIcon); - instanceNameView = itemView.findViewById(R.id.instanceName); - instanceUrlView = itemView.findViewById(R.id.instanceUrl); - instanceRB = itemView.findViewById(R.id.selectInstanceRB); - handle = itemView.findViewById(R.id.handle); - } - - @SuppressLint("ClickableViewAccessibility") - void bind(final int position, final TabViewHolder holder) { - handle.setOnTouchListener(getOnTouchListener(holder)); - - final PeertubeInstance instance = instanceList.get(position); - instanceNameView.setText(instance.getName()); - instanceUrlView.setText(instance.getUrl()); - instanceRB.setOnCheckedChangeListener(null); - if (selectedInstance.getUrl().equals(instance.getUrl())) { - if (lastChecked != null && lastChecked != instanceRB) { - lastChecked.setChecked(false); - } - instanceRB.setChecked(true); - lastChecked = instanceRB; - } - instanceRB.setOnCheckedChangeListener((buttonView, isChecked) -> { - if (isChecked) { - selectInstance(instance); - if (lastChecked != null && lastChecked != instanceRB) { - lastChecked.setChecked(false); - } - lastChecked = instanceRB; - } - }); - instanceIconView.setImageResource(R.drawable.place_holder_peertube); - } - - @SuppressLint("ClickableViewAccessibility") - private View.OnTouchListener getOnTouchListener(final RecyclerView.ViewHolder item) { - return (view, motionEvent) -> { - if (motionEvent.getActionMasked() == MotionEvent.ACTION_DOWN) { - if (itemTouchHelper != null && getItemCount() > 1) { - itemTouchHelper.startDrag(item); - return true; - } - } - return false; - }; - } - } - } -} diff --git a/app/src/main/java/org/schabi/newpipe/settings/SelectKioskFragment.java b/app/src/main/java/org/schabi/newpipe/settings/SelectKioskFragment.java index 38339050665..2fad8ff5a3a 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/SelectKioskFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/SelectKioskFragment.java @@ -19,8 +19,8 @@ import org.schabi.newpipe.extractor.NewPipe; import org.schabi.newpipe.extractor.StreamingService; import org.schabi.newpipe.util.KioskTranslator; -import org.schabi.newpipe.util.ServiceHelper; import org.schabi.newpipe.util.ThemeHelper; +import org.schabi.newpipe.util.services.ServiceHelper; import java.util.List; import java.util.Vector; @@ -116,10 +116,12 @@ private class SelectKioskAdapter } } + @Override public int getItemCount() { return kioskList.size(); } + @Override @NonNull public SelectKioskItemHolder onCreateViewHolder(final ViewGroup parent, final int type) { final View item = LayoutInflater.from(parent.getContext()) @@ -127,6 +129,7 @@ public SelectKioskItemHolder onCreateViewHolder(final ViewGroup parent, final in return new SelectKioskItemHolder(item); } + @Override public void onBindViewHolder(final SelectKioskItemHolder holder, final int position) { final Entry entry = kioskList.get(position); holder.titleView.setText(entry.kioskName); diff --git a/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/AbstractInstanceTypeCreator.java b/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/AbstractInstanceTypeCreator.java new file mode 100644 index 00000000000..0833ddcce94 --- /dev/null +++ b/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/AbstractInstanceTypeCreator.java @@ -0,0 +1,39 @@ +package org.schabi.newpipe.settings.serviceinstances; + +import androidx.annotation.DrawableRes; + +import org.schabi.newpipe.extractor.instance.Instance; + +public abstract class AbstractInstanceTypeCreator + implements InstanceTypeCreator { + + protected final String instanceServiceName; + @DrawableRes + protected final int icon; + protected final Class createdClass; + + protected AbstractInstanceTypeCreator( + final String instanceServiceName, + final int icon, + final Class createdClass + ) { + this.instanceServiceName = instanceServiceName; + this.icon = icon; + this.createdClass = createdClass; + } + + @Override + public Class createdClass() { + return createdClass; + } + + @Override + public String instanceServiceName() { + return instanceServiceName; + } + + @Override + public int icon() { + return icon; + } +} diff --git a/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/AbstractServiceInstanceListFragment.java b/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/AbstractServiceInstanceListFragment.java new file mode 100644 index 00000000000..2b6d4aca18e --- /dev/null +++ b/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/AbstractServiceInstanceListFragment.java @@ -0,0 +1,427 @@ +package org.schabi.newpipe.settings.serviceinstances; + +import android.annotation.SuppressLint; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; +import android.view.MotionEvent; +import android.view.View; +import android.view.ViewGroup; +import android.widget.RadioButton; +import android.widget.Toast; + +import androidx.annotation.DrawableRes; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.StringRes; +import androidx.appcompat.app.AlertDialog; +import androidx.fragment.app.Fragment; +import androidx.preference.PreferenceManager; +import androidx.recyclerview.widget.ItemTouchHelper; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import org.schabi.newpipe.R; +import org.schabi.newpipe.databinding.FragmentInstanceListBinding; +import org.schabi.newpipe.databinding.InstanceTypeFloatingItemBinding; +import org.schabi.newpipe.databinding.ItemInstanceBinding; +import org.schabi.newpipe.extractor.instance.Instance; +import org.schabi.newpipe.ktx.ViewUtils; +import org.schabi.newpipe.util.Constants; +import org.schabi.newpipe.util.ThemeHelper; +import org.schabi.newpipe.util.services.InstanceManager; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers; +import io.reactivex.rxjava3.core.Single; +import io.reactivex.rxjava3.disposables.CompositeDisposable; +import io.reactivex.rxjava3.disposables.Disposable; +import io.reactivex.rxjava3.schedulers.Schedulers; + +public abstract class AbstractServiceInstanceListFragment extends Fragment { + + protected static final int TYPES_CONTAINER_ANIMATION_DURATION = 500; + + @StringRes + protected final int title; + + protected final List> instanceTypeCreators; + protected final InstanceManager manager; + + protected final List currentInstances = new ArrayList<>(); + protected I selectedInstance; + + protected FragmentInstanceListBinding binding; + + protected InstanceListAdapter instanceListAdapter; + + protected CompositeDisposable disposables = new CompositeDisposable(); + + protected AbstractServiceInstanceListFragment( + @StringRes final int title, + @NonNull final InstanceManager manager, + @NonNull final List> instanceTypeCreators + ) { + this.title = title; + this.manager = manager; + this.instanceTypeCreators = instanceTypeCreators; + } + + @Override + public void onCreate(@Nullable final Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + selectedInstance = manager.getCurrentInstance(); + reloadInstanceListFromManager(); + + setHasOptionsMenu(true); + } + + @Nullable + @Override + public View onCreateView( + @NonNull final LayoutInflater inflater, + @Nullable final ViewGroup container, + @Nullable final Bundle savedInstanceState + ) { + binding = FragmentInstanceListBinding.inflate(inflater, container, false); + + return binding.getRoot(); + } + + @Override + public void onViewCreated( + @NonNull final View view, + @Nullable final Bundle savedInstanceState + ) { + super.onViewCreated(view, savedInstanceState); + + binding.instances.setLayoutManager(new LinearLayoutManager(requireContext())); + + final ItemTouchHelper itemTouchHelper = new ItemTouchHelper(getItemTouchCallback()); + itemTouchHelper.attachToRecyclerView(binding.instances); + + instanceListAdapter = new InstanceListAdapter(itemTouchHelper); + binding.instances.setAdapter(instanceListAdapter); + + binding.addInstanceButton.setOnClickListener(v -> onFABCreateButtonClicked()); + } + + @Override + public void onResume() { + super.onResume(); + ThemeHelper.setTitleToAppCompatActivity(getActivity(), getString(title)); + } + + @Override + public void onPause() { + super.onPause(); + saveChanges(); + } + + @Override + public void onDestroy() { + super.onDestroy(); + if (disposables != null) { + disposables.clear(); + } + disposables = null; + } + + /*////////////////////////////////////////////////////////////////////////// + // Menu + //////////////////////////////////////////////////////////////////////////*/ + + @Override + public void onCreateOptionsMenu(@NonNull final Menu menu, + @NonNull final MenuInflater inflater) { + super.onCreateOptionsMenu(menu, inflater); + inflater.inflate(R.menu.menu_chooser_fragment, menu); + } + + @Override + public boolean onOptionsItemSelected(final MenuItem item) { + if (item.getItemId() == R.id.menu_item_restore_default) { + restoreDefaults(); + return true; + } + + return super.onOptionsItemSelected(item); + } + + /*////////////////////////////////////////////////////////////////////////// + // Utils + //////////////////////////////////////////////////////////////////////////*/ + + protected void saveChanges() { + manager.saveInstanceList(currentInstances, requireContext()); + } + + protected void selectInstance(final I instance) { + selectedInstance = manager.saveCurrentInstance(instance, requireContext()); + PreferenceManager.getDefaultSharedPreferences(requireContext()) + .edit() + .putBoolean(Constants.KEY_MAIN_PAGE_CHANGE, true) + .apply(); + } + + private void reloadInstanceListFromManager() { + currentInstances.clear(); + currentInstances.addAll(manager.getInstanceList(requireContext())); + } + + protected void restoreDefaults() { + new AlertDialog.Builder(requireContext()) + .setTitle(R.string.restore_defaults) + .setMessage(R.string.restore_defaults_confirmation) + .setNegativeButton(R.string.cancel, null) + .setPositiveButton(R.string.ok, (dialog, which) -> { + manager.restoreDefaults(requireContext()); + reloadInstanceListFromManager(); + instanceListAdapter.notifyDataSetChanged(); + }) + .show(); + } + + protected void onFABCreateButtonClicked() { + final List> availableInstanceTypeCreators = + instanceTypeCreators.stream() + .filter(c -> c.canNewInstanceBeCreated(currentInstances)) + .collect(Collectors.toList()); + + binding.instanceTypesContainer.removeAllViews(); + // Only one instance type creator available -> Directly create instance on click + if (availableInstanceTypeCreators.size() == 1) { + availableInstanceTypeCreators.get(0) + .createNewInstance(requireContext(), currentInstances, this::addInstance); + return; + } + + final Runnable closeTypeContainersAndReset = () -> { + ViewUtils.animate( + binding.instanceTypesContainer, + false, + TYPES_CONTAINER_ANIMATION_DURATION); + ViewUtils.animateRotation( + binding.addInstanceButton, + TYPES_CONTAINER_ANIMATION_DURATION, + 0); + + binding.addInstanceButton.setOnClickListener(v2 -> onFABCreateButtonClicked()); + }; + + for (final InstanceTypeCreator config : availableInstanceTypeCreators) { + final InstanceTypeFloatingItemBinding itemBinding = + InstanceTypeFloatingItemBinding.inflate(LayoutInflater.from(requireContext())); + + itemBinding.desc.setText(config.instanceServiceName()); + itemBinding.floatingActionButton.setImageResource(config.icon()); + itemBinding.floatingActionButton.setOnClickListener(v -> { + config.createNewInstance(requireContext(), currentInstances, this::addInstance); + closeTypeContainersAndReset.run(); + }); + + binding.instanceTypesContainer.addView(itemBinding.getRoot()); + } + + ViewUtils.slideUp( + binding.instanceTypesContainer, + TYPES_CONTAINER_ANIMATION_DURATION, + 0, + 1F); + ViewUtils.animateRotation( + binding.addInstanceButton, + TYPES_CONTAINER_ANIMATION_DURATION, + 135); + binding.addInstanceButton.setOnClickListener(v -> closeTypeContainersAndReset.run()); + } + + protected void addInstance(final I createdInstance) { + binding.loadingProgressBar.setVisibility(View.VISIBLE); + final Disposable disposable = Single.fromCallable(() -> { + createdInstance.fetchMetadata(); + return createdInstance; + }).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) + .subscribe(instance -> { + binding.loadingProgressBar.setVisibility(View.GONE); + add(instance); + }, e -> { + binding.loadingProgressBar.setVisibility(View.GONE); + Toast.makeText(getActivity(), + R.string.could_not_validate_instance, + Toast.LENGTH_SHORT).show(); + }); + disposables.add(disposable); + } + + protected void add(final I instance) { + currentInstances.add(instance); + instanceListAdapter.notifyDataSetChanged(); + } + + protected ItemTouchHelper.SimpleCallback getItemTouchCallback() { + return new ItemTouchHelper.SimpleCallback(ItemTouchHelper.UP | ItemTouchHelper.DOWN, + ItemTouchHelper.START | ItemTouchHelper.END) { + @Override + public int interpolateOutOfBoundsScroll(@NonNull final RecyclerView recyclerView, + final int viewSize, + final int viewSizeOutOfBounds, + final int totalSize, + final long msSinceStartScroll) { + final int standardSpeed = super.interpolateOutOfBoundsScroll(recyclerView, viewSize, + viewSizeOutOfBounds, totalSize, msSinceStartScroll); + final int minimumAbsVelocity = Math.max(12, Math.abs(standardSpeed)); + return minimumAbsVelocity * (int) Math.signum(viewSizeOutOfBounds); + } + + @Override + public boolean onMove(@NonNull final RecyclerView recyclerView, + @NonNull final RecyclerView.ViewHolder source, + @NonNull final RecyclerView.ViewHolder target) { + if (source.getItemViewType() != target.getItemViewType() + || instanceListAdapter == null) { + return false; + } + + final int sourceIndex = source.getBindingAdapterPosition(); + final int targetIndex = target.getBindingAdapterPosition(); + instanceListAdapter.swapItems(sourceIndex, targetIndex); + return true; + } + + @Override + public boolean isLongPressDragEnabled() { + return false; + } + + @Override + public boolean isItemViewSwipeEnabled() { + return true; + } + + @Override + public void onSwiped(@NonNull final RecyclerView.ViewHolder viewHolder, + final int swipeDir) { + final int position = viewHolder.getBindingAdapterPosition(); + // do not allow swiping the selected instance + if (currentInstances.get(position).getUrl().equals(selectedInstance.getUrl())) { + instanceListAdapter.notifyItemChanged(position); + return; + } + currentInstances.remove(position); + instanceListAdapter.notifyItemRemoved(position); + + if (currentInstances.isEmpty()) { + currentInstances.add(selectedInstance); + instanceListAdapter.notifyItemInserted(0); + } + } + }; + } + + @DrawableRes + protected int getIconForInstance(final I instance) { + return instanceTypeCreators.stream() + .filter(c -> c.createdClass().isInstance(instance)) + .map(InstanceTypeCreator::icon) + .findFirst() + .orElse(R.drawable.place_holder_circle); + } + + /*////////////////////////////////////////////////////////////////////////// + // List Handling + //////////////////////////////////////////////////////////////////////////*/ + + protected class InstanceListAdapter + extends RecyclerView.Adapter { + private final ItemTouchHelper itemTouchHelper; + private RadioButton lastChecked; + + InstanceListAdapter(final ItemTouchHelper itemTouchHelper) { + this.itemTouchHelper = itemTouchHelper; + } + + public void swapItems(final int fromPosition, final int toPosition) { + Collections.swap(currentInstances, fromPosition, toPosition); + notifyItemMoved(fromPosition, toPosition); + } + + @NonNull + @Override + public InstanceListAdapter.TabViewHolder onCreateViewHolder( + @NonNull final ViewGroup parent, + final int viewType + ) { + return new InstanceListAdapter.TabViewHolder( + ItemInstanceBinding.inflate( + LayoutInflater.from(parent.getContext()), parent, false)); + } + + @Override + public void onBindViewHolder(@NonNull final InstanceListAdapter.TabViewHolder holder, + final int position) { + holder.bind(position, holder); + } + + @Override + public int getItemCount() { + return currentInstances.size(); + } + + protected class TabViewHolder extends RecyclerView.ViewHolder { + + private final ItemInstanceBinding binding; + + TabViewHolder(@NonNull final ItemInstanceBinding binding) { + super(binding.getRoot()); + this.binding = binding; + } + + @SuppressLint("ClickableViewAccessibility") + void bind(final int position, final InstanceListAdapter.TabViewHolder holder) { + binding.handle.setOnTouchListener(getOnTouchListener(holder)); + + final I instance = currentInstances.get(position); + binding.instanceName.setText(instance.getName()); + binding.instanceUrl.setText(instance.getUrl()); + binding.selectInstanceRB.setOnCheckedChangeListener(null); + if (selectedInstance.getUrl().equals(instance.getUrl())) { + if (lastChecked != null && lastChecked != binding.selectInstanceRB) { + lastChecked.setChecked(false); + } + binding.selectInstanceRB.setChecked(true); + lastChecked = binding.selectInstanceRB; + } + binding.selectInstanceRB.setOnCheckedChangeListener((buttonView, isChecked) -> { + if (isChecked) { + selectInstance(instance); + if (lastChecked != null && lastChecked != binding.selectInstanceRB) { + lastChecked.setChecked(false); + } + lastChecked = binding.selectInstanceRB; + } + }); + binding.instanceIcon.setImageResource(getIconForInstance(instance)); + } + + @SuppressLint("ClickableViewAccessibility") + private View.OnTouchListener getOnTouchListener(final RecyclerView.ViewHolder item) { + return (view, motionEvent) -> { + if (motionEvent.getActionMasked() == MotionEvent.ACTION_DOWN + && itemTouchHelper != null + && getItemCount() > 1) { + itemTouchHelper.startDrag(item); + return true; + } + return false; + }; + } + } + } +} diff --git a/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/InstanceTypeCreator.java b/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/InstanceTypeCreator.java new file mode 100644 index 00000000000..2b61ea86f43 --- /dev/null +++ b/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/InstanceTypeCreator.java @@ -0,0 +1,62 @@ +package org.schabi.newpipe.settings.serviceinstances; + +import android.content.Context; + +import androidx.annotation.DrawableRes; +import androidx.annotation.NonNull; + +import org.schabi.newpipe.extractor.instance.Instance; + +import java.util.List; +import java.util.function.Consumer; + +public interface InstanceTypeCreator { + + /** + * Type of the created class. + * + * @return the created class + */ + Class createdClass(); + + /** + * Get's the service name of the instance that's create. E.g. PeerTube or Invidious + * + * @return service name + */ + String instanceServiceName(); + + /** + * Returns a resource that represents the instance. + * + * @return icon + */ + @DrawableRes + int icon(); + + /** + * Determines if a new instance can be created, based on the list of existing instances. + * + * @param existingInstances List of existing instances + * @return true if a new instance of this type can be created + */ + default boolean canNewInstanceBeCreated( + @NonNull final List existingInstances + ) { + return true; + } + + + /** + * Creates a new instance. Using the UI for e.g. adding URLs is possible. + * + * @param context Context + * @param existingInstances List of existing instances + * @param onInstanceCreated Consumer that should be used when the instance is created + */ + void createNewInstance( + @NonNull Context context, + @NonNull List existingInstances, + @NonNull Consumer onInstanceCreated); + +} diff --git a/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/UrlMultiInstanceTypeCreator.java b/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/UrlMultiInstanceTypeCreator.java new file mode 100644 index 00000000000..81161add13d --- /dev/null +++ b/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/UrlMultiInstanceTypeCreator.java @@ -0,0 +1,128 @@ +package org.schabi.newpipe.settings.serviceinstances; + +import android.content.Context; +import android.view.LayoutInflater; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.annotation.StringRes; +import androidx.appcompat.app.AlertDialog; + +import org.schabi.newpipe.R; +import org.schabi.newpipe.databinding.DialogAddInstanceBinding; +import org.schabi.newpipe.extractor.instance.Instance; + +import java.util.List; +import java.util.Optional; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.stream.Collectors; + +public class UrlMultiInstanceTypeCreator + extends AbstractInstanceTypeCreator { + + protected final Function createNewInstanceFromUrl; + @StringRes + protected final int instanceListUrl; + + public UrlMultiInstanceTypeCreator( + final String instanceServiceName, + final int icon, + final Class createdClass, + final Function createNewInstanceFromUrl, + final int instanceListUrl + ) { + super(instanceServiceName, icon, createdClass); + this.createNewInstanceFromUrl = createNewInstanceFromUrl; + this.instanceListUrl = instanceListUrl; + } + + @Override + public void createNewInstance( + @NonNull final Context context, + @NonNull final List existingInstances, + @NonNull final Consumer onInstanceCreated + ) { + showAddInstanceUrlDialog(context, url -> + defaultValidateAndCleanUrl(url, context, existingInstances, createdClass()) + .map(createNewInstanceFromUrl) + .ifPresent(onInstanceCreated)); + } + + void showAddInstanceUrlDialog( + final Context c, + final Consumer onUrlCreated + ) { + final DialogAddInstanceBinding dialogBinding + = DialogAddInstanceBinding.inflate(LayoutInflater.from(c)); + dialogBinding.instanceHelp.setText( + c.getString( + R.string.publicly_available_instances_help, + c.getString(instanceListUrl))); + + new AlertDialog.Builder(c) + .setTitle(c.getString(R.string.add_instance, instanceServiceName())) + .setIcon(icon()) + .setView(dialogBinding.getRoot()) + .setNegativeButton(R.string.cancel, null) + .setPositiveButton(R.string.ok, (dialog1, which) -> + onUrlCreated.accept(dialogBinding.dialogEditText.getText().toString()) + ) + .show(); + } + + /** + * Validates and cleans an url. + *
+ * Does the following: + *
    + *
  • Adds "https://" if the url is not starting with "http"
  • + *
  • Removes trailing slashes
  • + *
  • Notifies the user if no "https://" url is used
  • + *
  • + * Checks if the url is already used by an instance of the same type (targetedClass) + *
  • + *
+ * + * + * @param url The inputted url + * @param context Context + * @param currentInstances Currently active instances + * @param targetedClass The targeted/created class + * @return The validated and cleaned url + */ + Optional defaultValidateAndCleanUrl( + final String url, + final Context context, + final List currentInstances, + final Class targetedClass + ) { + String cleanUrl = url.trim(); + // if protocol not present, add https + if (!cleanUrl.startsWith("http")) { + cleanUrl = "https://" + cleanUrl; + } + // remove trailing slash + cleanUrl = cleanUrl.replaceAll("/$", ""); + // consider using HTTPS + if (!cleanUrl.startsWith("https://")) { + Toast.makeText(context, + R.string.http_is_insecure_consider_using_https, + Toast.LENGTH_LONG).show(); + } + // only allow if not already exists (and it's the same instance) + for (final Instance instance : currentInstances + .stream() + .filter(targetedClass::isInstance) + .collect(Collectors.toList()) + ) { + if (instance.getUrl().equals(cleanUrl)) { + Toast.makeText(context, + R.string.instance_already_exists, + Toast.LENGTH_LONG).show(); + return Optional.empty(); + } + } + return Optional.of(cleanUrl); + } +} diff --git a/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/peertube/PeertubeInstanceListFragment.java b/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/peertube/PeertubeInstanceListFragment.java new file mode 100644 index 00000000000..e6b80e1c118 --- /dev/null +++ b/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/peertube/PeertubeInstanceListFragment.java @@ -0,0 +1,32 @@ +package org.schabi.newpipe.settings.serviceinstances.peertube; + +import org.schabi.newpipe.R; +import org.schabi.newpipe.extractor.services.peertube.PeertubeInstance; +import org.schabi.newpipe.settings.serviceinstances.AbstractServiceInstanceListFragment; +import org.schabi.newpipe.settings.serviceinstances.UrlMultiInstanceTypeCreator; +import org.schabi.newpipe.util.services.PeertubeInstanceManager; + +import java.util.Collections; + +public class PeertubeInstanceListFragment + extends AbstractServiceInstanceListFragment { + + public PeertubeInstanceListFragment() { + super( + R.string.peertube_instance_url_title, + PeertubeInstanceManager.MANAGER, + Collections.singletonList(new PeerTubeInstanceTypeCreator())); + } + + public static class PeerTubeInstanceTypeCreator + extends UrlMultiInstanceTypeCreator { + public PeerTubeInstanceTypeCreator() { + super( + PeertubeInstance.SERVICE_NAME, + R.drawable.place_holder_peertube, + PeertubeInstance.class, + PeertubeInstance::new, + R.string.peertube_instance_list_url); + } + } +} diff --git a/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/youtubelike/YouTubeLikeInstanceListFragment.java b/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/youtubelike/YouTubeLikeInstanceListFragment.java new file mode 100644 index 00000000000..a9bccffe456 --- /dev/null +++ b/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/youtubelike/YouTubeLikeInstanceListFragment.java @@ -0,0 +1,72 @@ +package org.schabi.newpipe.settings.serviceinstances.youtubelike; + +import android.content.Context; + +import androidx.annotation.NonNull; + +import org.schabi.newpipe.R; +import org.schabi.newpipe.extractor.instance.Instance; +import org.schabi.newpipe.extractor.services.youtube.YoutubeLikeInstance; +import org.schabi.newpipe.extractor.services.youtube.invidious.InvidiousInstance; +import org.schabi.newpipe.extractor.services.youtube.youtube.YoutubeInstance; +import org.schabi.newpipe.settings.serviceinstances.AbstractInstanceTypeCreator; +import org.schabi.newpipe.settings.serviceinstances.AbstractServiceInstanceListFragment; +import org.schabi.newpipe.settings.serviceinstances.UrlMultiInstanceTypeCreator; +import org.schabi.newpipe.util.services.YoutubeLikeInstanceManager; + +import java.util.Arrays; +import java.util.List; +import java.util.function.Consumer; + +public class YouTubeLikeInstanceListFragment + extends AbstractServiceInstanceListFragment> { + + public YouTubeLikeInstanceListFragment() { + super( + R.string.yt_like_instance_url_title, + YoutubeLikeInstanceManager.MANAGER, + Arrays.asList( + new YouTubeInstanceTypeCreator(), + new InvidiousInstanceTypeCreator())); + } + + + public static class YouTubeInstanceTypeCreator + extends AbstractInstanceTypeCreator { + public YouTubeInstanceTypeCreator() { + super( + YoutubeInstance.SERVICE_NAME, + R.drawable.place_holder_youtube, + YoutubeInstance.class); + } + + @Override + public boolean canNewInstanceBeCreated( + @NonNull final List existingInstances + ) { + return existingInstances.stream() + .noneMatch(createdClass()::isInstance); + } + + @Override + public void createNewInstance( + @NonNull final Context context, + @NonNull final List existingInstances, + @NonNull final Consumer onInstanceCreated + ) { + onInstanceCreated.accept(YoutubeInstance.YOUTUBE); + } + } + + public static class InvidiousInstanceTypeCreator + extends UrlMultiInstanceTypeCreator { + public InvidiousInstanceTypeCreator() { + super( + InvidiousInstance.SERVICE_NAME, + R.drawable.place_holder_circle, // TODO + InvidiousInstance.class, + InvidiousInstance::new, + R.string.invidious_instance_list_url); + } + } +} diff --git a/app/src/main/java/org/schabi/newpipe/settings/tabs/Tab.java b/app/src/main/java/org/schabi/newpipe/settings/tabs/Tab.java index 6b1d70a8668..a1ffae1fb45 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/tabs/Tab.java +++ b/app/src/main/java/org/schabi/newpipe/settings/tabs/Tab.java @@ -29,7 +29,7 @@ import org.schabi.newpipe.local.playlist.LocalPlaylistFragment; import org.schabi.newpipe.local.subscription.SubscriptionFragment; import org.schabi.newpipe.util.KioskTranslator; -import org.schabi.newpipe.util.ServiceHelper; +import org.schabi.newpipe.util.services.ServiceHelper; import java.util.Objects; diff --git a/app/src/main/java/org/schabi/newpipe/util/InfoCache.java b/app/src/main/java/org/schabi/newpipe/util/InfoCache.java index a07f05828fe..c4c6d1a5165 100644 --- a/app/src/main/java/org/schabi/newpipe/util/InfoCache.java +++ b/app/src/main/java/org/schabi/newpipe/util/InfoCache.java @@ -28,6 +28,7 @@ import org.schabi.newpipe.MainActivity; import org.schabi.newpipe.extractor.Info; import org.schabi.newpipe.extractor.InfoItem; +import org.schabi.newpipe.util.services.ServiceHelper; import java.util.Map; diff --git a/app/src/main/java/org/schabi/newpipe/util/KioskTranslator.java b/app/src/main/java/org/schabi/newpipe/util/KioskTranslator.java index b8c2ff23699..0fe59e6462a 100644 --- a/app/src/main/java/org/schabi/newpipe/util/KioskTranslator.java +++ b/app/src/main/java/org/schabi/newpipe/util/KioskTranslator.java @@ -60,6 +60,7 @@ public static String getTranslatedKioskName(final String kioskId, final Context public static int getKioskIcon(final String kioskId) { switch (kioskId) { case "Trending": + case "Popular": case "Top 50": case "New & hot": case "conferences": diff --git a/app/src/main/java/org/schabi/newpipe/util/PeertubeHelper.java b/app/src/main/java/org/schabi/newpipe/util/PeertubeHelper.java deleted file mode 100644 index dcc39eccf6d..00000000000 --- a/app/src/main/java/org/schabi/newpipe/util/PeertubeHelper.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.schabi.newpipe.util; - -import android.content.Context; -import android.content.SharedPreferences; - -import androidx.preference.PreferenceManager; - -import com.grack.nanojson.JsonArray; -import com.grack.nanojson.JsonObject; -import com.grack.nanojson.JsonParser; -import com.grack.nanojson.JsonParserException; -import com.grack.nanojson.JsonStringWriter; -import com.grack.nanojson.JsonWriter; - -import org.schabi.newpipe.R; -import org.schabi.newpipe.extractor.ServiceList; -import org.schabi.newpipe.extractor.services.peertube.PeertubeInstance; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -public final class PeertubeHelper { - private PeertubeHelper() { } - - public static List getInstanceList(final Context context) { - final SharedPreferences sharedPreferences = PreferenceManager - .getDefaultSharedPreferences(context); - final String savedInstanceListKey = context.getString(R.string.peertube_instance_list_key); - final String savedJson = sharedPreferences.getString(savedInstanceListKey, null); - if (null == savedJson) { - return Collections.singletonList(getCurrentInstance()); - } - - try { - final JsonArray array = JsonParser.object().from(savedJson).getArray("instances"); - final List result = new ArrayList<>(); - for (final Object o : array) { - if (o instanceof JsonObject) { - final JsonObject instance = (JsonObject) o; - final String name = instance.getString("name"); - final String url = instance.getString("url"); - result.add(new PeertubeInstance(url, name)); - } - } - return result; - } catch (final JsonParserException e) { - return Collections.singletonList(getCurrentInstance()); - } - - } - - public static PeertubeInstance selectInstance(final PeertubeInstance instance, - final Context context) { - final SharedPreferences sharedPreferences = PreferenceManager - .getDefaultSharedPreferences(context); - final String selectedInstanceKey - = context.getString(R.string.peertube_selected_instance_key); - final JsonStringWriter jsonWriter = JsonWriter.string().object(); - jsonWriter.value("name", instance.getName()); - jsonWriter.value("url", instance.getUrl()); - final String jsonToSave = jsonWriter.end().done(); - sharedPreferences.edit().putString(selectedInstanceKey, jsonToSave).apply(); - ServiceList.PeerTube.setInstance(instance); - return instance; - } - - public static PeertubeInstance getCurrentInstance() { - return ServiceList.PeerTube.getInstance(); - } -} diff --git a/app/src/main/java/org/schabi/newpipe/util/services/AbstractInstanceManager.java b/app/src/main/java/org/schabi/newpipe/util/services/AbstractInstanceManager.java new file mode 100644 index 00000000000..e7676fd5341 --- /dev/null +++ b/app/src/main/java/org/schabi/newpipe/util/services/AbstractInstanceManager.java @@ -0,0 +1,113 @@ +package org.schabi.newpipe.util.services; + +import android.content.Context; + +import androidx.annotation.StringRes; +import androidx.preference.PreferenceManager; + +import com.grack.nanojson.JsonObject; +import com.grack.nanojson.JsonParser; +import com.grack.nanojson.JsonParserException; +import com.grack.nanojson.JsonStringWriter; +import com.grack.nanojson.JsonWriter; + +import org.schabi.newpipe.extractor.InstanceBasedStreamingService; +import org.schabi.newpipe.extractor.instance.Instance; + +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public abstract class AbstractInstanceManager implements InstanceManager { + protected abstract InstanceBasedStreamingService getRelatedStreamingService(); + + protected abstract I createInstanceFromPersistence(JsonObject jsonObject); + + protected abstract void convertInstanceToPersist(JsonStringWriter jsonWriter, I instance); + + @StringRes + protected abstract int getListPersistenceKey(); + + + @Override + public List saveInstanceList(final List instances, final Context context) { + final JsonStringWriter jsonWriter = JsonWriter.string().object().array("instances"); + for (final I instance : instances) { + jsonWriter.object(); + convertInstanceToPersist(jsonWriter, instance); + jsonWriter.end(); + } + final String jsonToSave = jsonWriter.end().end().done(); + PreferenceManager.getDefaultSharedPreferences(context) + .edit() + .putString(context.getString(getListPersistenceKey()), jsonToSave) + .apply(); + return null; + } + + @Override + public List getInstanceList(final Context context) { + final String savedInstanceListKey = context.getString(getListPersistenceKey()); + final String savedJson = PreferenceManager.getDefaultSharedPreferences(context) + .getString(savedInstanceListKey, null); + if (null == savedJson) { + return getDefaultInstanceList(); + } + + try { + return JsonParser.object().from(savedJson) + .getArray("instances") + .stream() + .filter(JsonObject.class::isInstance) + .map(JsonObject.class::cast) + .map(this::createInstanceFromPersistence) + .collect(Collectors.toList()); + } catch (final JsonParserException e) { + return getDefaultInstanceList(); + } + } + + protected List getDefaultInstanceList() { + return Collections.singletonList(getDefaultInstance()); + } + + @StringRes + protected abstract int getSelectedInstancePersistenceKey(); + + @Override + public I saveCurrentInstance(final I instance, final Context context) { + getRelatedStreamingService().setInstance(instance); + + final String selectedInstanceKey = context.getString(getSelectedInstancePersistenceKey()); + final JsonStringWriter jsonWriter = JsonWriter.string().object(); + convertInstanceToPersist(jsonWriter, instance); + final String jsonToSave = jsonWriter.end().done(); + PreferenceManager.getDefaultSharedPreferences(context) + .edit() + .putString(selectedInstanceKey, jsonToSave) + .apply(); + + return instance; + } + + @Override + public I getCurrentInstance() { + try { + final I instance = getRelatedStreamingService().getInstance(); + if (instance != null) { + return instance; + } + } catch (final Exception ignored) { + // Fallthrough + } + return getDefaultInstance(); + } + + protected abstract I getDefaultInstance(); + + @Override + public void restoreDefaults(final Context context) { + saveInstanceList(getDefaultInstanceList(), context); + saveCurrentInstance(getDefaultInstance(), context); + } +} diff --git a/app/src/main/java/org/schabi/newpipe/util/services/InstanceManager.java b/app/src/main/java/org/schabi/newpipe/util/services/InstanceManager.java new file mode 100644 index 00000000000..587dba2e339 --- /dev/null +++ b/app/src/main/java/org/schabi/newpipe/util/services/InstanceManager.java @@ -0,0 +1,19 @@ +package org.schabi.newpipe.util.services; + +import android.content.Context; + +import org.schabi.newpipe.extractor.instance.Instance; + +import java.util.List; + +public interface InstanceManager { + List saveInstanceList(List instances, Context context); + + List getInstanceList(Context context); + + I getCurrentInstance(); + + I saveCurrentInstance(I instance, Context context); + + void restoreDefaults(Context context); +} diff --git a/app/src/main/java/org/schabi/newpipe/util/services/PeertubeInstanceManager.java b/app/src/main/java/org/schabi/newpipe/util/services/PeertubeInstanceManager.java new file mode 100644 index 00000000000..9908788f9bb --- /dev/null +++ b/app/src/main/java/org/schabi/newpipe/util/services/PeertubeInstanceManager.java @@ -0,0 +1,51 @@ +package org.schabi.newpipe.util.services; + +import com.grack.nanojson.JsonObject; +import com.grack.nanojson.JsonStringWriter; + +import org.schabi.newpipe.R; +import org.schabi.newpipe.extractor.InstanceBasedStreamingService; +import org.schabi.newpipe.extractor.ServiceList; +import org.schabi.newpipe.extractor.services.peertube.PeertubeInstance; + +public final class PeertubeInstanceManager extends AbstractInstanceManager { + + public static final PeertubeInstanceManager MANAGER = new PeertubeInstanceManager(); + + @Override + protected InstanceBasedStreamingService getRelatedStreamingService() { + return ServiceList.PeerTube; + } + + @Override + protected PeertubeInstance createInstanceFromPersistence(final JsonObject jsonObject) { + return new PeertubeInstance( + jsonObject.getString("url"), + jsonObject.getString("name") + ); + } + + @Override + protected void convertInstanceToPersist( + final JsonStringWriter jsonWriter, + final PeertubeInstance instance + ) { + jsonWriter.value("name", instance.getName()); + jsonWriter.value("url", instance.getUrl()); + } + + @Override + protected int getListPersistenceKey() { + return R.string.peertube_instance_list_key; + } + + @Override + protected int getSelectedInstancePersistenceKey() { + return R.string.peertube_selected_instance_key; + } + + @Override + protected PeertubeInstance getDefaultInstance() { + return PeertubeInstance.DEFAULT_INSTANCE; + } +} diff --git a/app/src/main/java/org/schabi/newpipe/util/ServiceHelper.java b/app/src/main/java/org/schabi/newpipe/util/services/ServiceHelper.java similarity index 96% rename from app/src/main/java/org/schabi/newpipe/util/ServiceHelper.java rename to app/src/main/java/org/schabi/newpipe/util/services/ServiceHelper.java index d41493a7fc2..20be1b81350 100644 --- a/app/src/main/java/org/schabi/newpipe/util/ServiceHelper.java +++ b/app/src/main/java/org/schabi/newpipe/util/services/ServiceHelper.java @@ -1,4 +1,6 @@ -package org.schabi.newpipe.util; +package org.schabi.newpipe.util.services; + +import static org.schabi.newpipe.extractor.ServiceList.SoundCloud; import android.content.Context; import android.content.SharedPreferences; @@ -20,8 +22,6 @@ import java.util.concurrent.TimeUnit; -import static org.schabi.newpipe.extractor.ServiceList.SoundCloud; - public final class ServiceHelper { private static final StreamingService DEFAULT_FALLBACK_SERVICE = ServiceList.YouTube; @@ -157,18 +157,12 @@ private static void setSelectedServicePreferences(final Context context, public static long getCacheExpirationMillis(final int serviceId) { if (serviceId == SoundCloud.getServiceId()) { return TimeUnit.MILLISECONDS.convert(5, TimeUnit.MINUTES); - } else { - return TimeUnit.MILLISECONDS.convert(1, TimeUnit.HOURS); } + return TimeUnit.MILLISECONDS.convert(1, TimeUnit.HOURS); } public static boolean isBeta(final StreamingService s) { - switch (s.getServiceInfo().getName()) { - case "YouTube": - return false; - default: - return true; - } + return !"YouTube".equals(s.getServiceInfo().getName()); } public static void initService(final Context context, final int serviceId) { diff --git a/app/src/main/java/org/schabi/newpipe/util/services/YoutubeLikeInstanceManager.java b/app/src/main/java/org/schabi/newpipe/util/services/YoutubeLikeInstanceManager.java new file mode 100644 index 00000000000..2ff960d2103 --- /dev/null +++ b/app/src/main/java/org/schabi/newpipe/util/services/YoutubeLikeInstanceManager.java @@ -0,0 +1,69 @@ +package org.schabi.newpipe.util.services; + +import com.grack.nanojson.JsonObject; +import com.grack.nanojson.JsonStringWriter; + +import org.schabi.newpipe.R; +import org.schabi.newpipe.extractor.InstanceBasedStreamingService; +import org.schabi.newpipe.extractor.ServiceList; +import org.schabi.newpipe.extractor.services.youtube.YoutubeLikeInstance; +import org.schabi.newpipe.extractor.services.youtube.invidious.InvidiousInstance; +import org.schabi.newpipe.extractor.services.youtube.youtube.YoutubeInstance; + +import java.util.Arrays; +import java.util.List; + +public final class YoutubeLikeInstanceManager + extends AbstractInstanceManager> { + + public static final YoutubeLikeInstanceManager MANAGER = new YoutubeLikeInstanceManager(); + + @Override + protected InstanceBasedStreamingService> getRelatedStreamingService() { + return ServiceList.YouTube; + } + + @Override + protected YoutubeLikeInstance createInstanceFromPersistence(final JsonObject jsonObject) { + if ("invidious".equals(jsonObject.getString("type"))) { + return new InvidiousInstance( + jsonObject.getString("url"), + jsonObject.getString("name") + ); + } + return getDefaultInstance(); + } + + @Override + protected void convertInstanceToPersist( + final JsonStringWriter jsonWriter, + final YoutubeLikeInstance instance) { + jsonWriter.value("type", instance instanceof InvidiousInstance ? "invidious" : "yt"); + if (instance instanceof InvidiousInstance) { + jsonWriter.value("name", instance.getName()); + jsonWriter.value("url", instance.getUrl()); + } + } + + @Override + protected int getListPersistenceKey() { + return R.string.yt_like_instance_list_key; + } + + @Override + protected int getSelectedInstancePersistenceKey() { + return R.string.yt_like_instance_selected_instance_key; + } + + @Override + protected List> getDefaultInstanceList() { + return Arrays.asList( + YoutubeInstance.YOUTUBE, + new InvidiousInstance("https://invidious.fdn.fr") /* TODO */); + } + + @Override + protected YoutubeLikeInstance getDefaultInstance() { + return YoutubeInstance.YOUTUBE; + } +} diff --git a/app/src/main/res/layout/dialog_add_instance.xml b/app/src/main/res/layout/dialog_add_instance.xml new file mode 100644 index 00000000000..2417723903f --- /dev/null +++ b/app/src/main/res/layout/dialog_add_instance.xml @@ -0,0 +1,38 @@ + + + + + + + + diff --git a/app/src/main/res/layout/fragment_choose_tabs.xml b/app/src/main/res/layout/fragment_choose_tabs.xml index d271923278c..9523298855d 100644 --- a/app/src/main/res/layout/fragment_choose_tabs.xml +++ b/app/src/main/res/layout/fragment_choose_tabs.xml @@ -14,7 +14,7 @@ android:gravity="center" android:paddingStart="8dp" android:paddingEnd="8dp" - android:text="@string/main_page_content_swipe_remove" + android:text="@string/swipe_items_to_remove_them" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> diff --git a/app/src/main/res/layout/fragment_instance_list.xml b/app/src/main/res/layout/fragment_instance_list.xml index aaf56fcc1ba..66d84387168 100644 --- a/app/src/main/res/layout/fragment_instance_list.xml +++ b/app/src/main/res/layout/fragment_instance_list.xml @@ -1,51 +1,75 @@ - + android:layout_height="match_parent"> + android:layout_marginTop="16dp" + android:gravity="center" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:text="@string/swipe_items_to_remove_them" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + - - + + + diff --git a/app/src/main/res/layout/instance_type_floating_item.xml b/app/src/main/res/layout/instance_type_floating_item.xml new file mode 100644 index 00000000000..db136dccc81 --- /dev/null +++ b/app/src/main/res/layout/instance_type_floating_item.xml @@ -0,0 +1,40 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index e7da4611ac8..11ed4d78b38 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -456,11 +456,9 @@ تسريع إلى الأمام/-ترجيع وقت البحث مثيلات خوادم پيرتيوب حدد مثيلات PeerTube المفضلة لديك - إضافة نموذج - أدخل عنوان للمثيل - لا يمكن التحقق من صحة المثال - يتم دعم عناوين URL HTTPS فقط - مثيل الخادم موجود بالفعل + أدخل عنوان للمثيل + لا يمكن التحقق من صحة المثال + مثيل الخادم موجود بالفعل محلي أُضيف مؤخرًا الأكثر إعجابًا @@ -468,7 +466,6 @@ استرد لا يمكن استرداد هذا التنزيل اختيار مثيل - ابحث عن مثيلات الخوادم التي تناسبك على %s تنظيف تاريخ التحميل حذف الملفات المحملة امنح الإذن بالعرض فوق التطبيقات الأخرى @@ -691,7 +688,7 @@ إظهار مؤشرات الصور اقتراحات البحث عن بعد اقتراحات البحث المحلية - اسحب العناصر لإزالتها + اسحب العناصر لإزالتها اكتمل %1$s تنزيل اكتمل %1$s تنزيل diff --git a/app/src/main/res/values-az/strings.xml b/app/src/main/res/values-az/strings.xml index 51683fb89db..d1cc582f87d 100644 --- a/app/src/main/res/values-az/strings.xml +++ b/app/src/main/res/values-az/strings.xml @@ -209,7 +209,6 @@ Mobil internet istifadə edərkən görüntü keyfiyyətini məhdudlaşdırın Limitsiz 1 element silindi. - Nümunə əlavə et Sevimli \"PeerTube\" nümunələrinizi seçin Yüklənmiş faylları sil Yükləmə tarixçənizi təmizləmək və ya yüklənmiş bütün faylları silmək istəyirsiniz\? diff --git a/app/src/main/res/values-b+ast/strings.xml b/app/src/main/res/values-b+ast/strings.xml index 611c2dd03df..554f1640f2a 100644 --- a/app/src/main/res/values-b+ast/strings.xml +++ b/app/src/main/res/values-b+ast/strings.xml @@ -240,7 +240,7 @@ Toca pa baxalu Perdióse\'l progresu porque se desanició\'l ficheru Instancies de PeerTube - La instancia yá esiste + La instancia yá esiste Llingua de l\'aplicación Lo predeterminao del sistema Vídeos @@ -260,7 +260,7 @@ Importóse Alvertencia: nun pudieron importase tolos ficheros. Anovamientos - Nun pudo validase la instancia + Nun pudo validase la instancia %d minutu %d minutos @@ -516,10 +516,8 @@ Activar el «Mou torgáu» de YouTube Amuesa\'l conteníu que quiciabes nun seya afayadizu pa guaḥes porque tien una llende d\'edá (como +18) Depuración - Namás se sofiten URLs HTTPS - Introduz la URL d\'una instancia - Amiestu d\'una instancia - Atopa les instancies que te presten en %s + + Introduz la URL d\'una instancia Esbilla les instancies de PeerTube que prefieras Nun pudo reconocese la URL. ¿Abrila con otra aplicación\? Amuesa\'l mensaxe al primir el nel botón «En segundu planu» o «Ventanu» nel «Details:» de los vídeos diff --git a/app/src/main/res/values-b+uz+Latn/strings.xml b/app/src/main/res/values-b+uz+Latn/strings.xml index 05ad40fa641..a2d9fccb7e9 100644 --- a/app/src/main/res/values-b+uz+Latn/strings.xml +++ b/app/src/main/res/values-b+uz+Latn/strings.xml @@ -143,12 +143,9 @@ Video va audio Xatti-harakat Ijro etish - Namuna allaqachon mavjud - Faqat HTTPS URL-lari qo\'llab-quvvatlanadi - Namunani tasdiqlab bo\'lmadi - Namuna URL manzilini kiriting - Namuna qo\'shish - %s da sizga yoqadigan misollarni toping + Namuna allaqachon mavjud + Namunani tasdiqlab bo\'lmadi + Namuna URL manzilini kiriting Sevimli PeerTube nusxalarini tanlang PeerTube misollari Standart kontent tili 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 9170166751a..87d483ec39a 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 @@ -430,12 +430,9 @@ 语言更改将在重启应用后生效 PeerTube 服务器 设置自定义 PeerTube 服务器 - 查找你需要的服务器 %s - 添加服务器 - 输入服务器网址(URL) - 无法验证服务器 - 仅支持 HTTPS URL - 该服务器已存在 + 输入服务器网址(URL) + 无法验证服务器 + 该服务器已存在 本地 最近添加 最受欢迎 @@ -647,7 +644,7 @@ 完成了 %s 个下载 - 滑动即可删除项目 + 滑动即可删除项目 若自动旋转被锁定,不在以小窗播放器形式中播放视频,而直接切换到全屏模式。仍可以通过退出全屏以切换至小窗播放器 以全屏启动主播放器 已添加为下一个播放 diff --git a/app/src/main/res/values-be/strings.xml b/app/src/main/res/values-be/strings.xml index 8254855f573..f3fa4f3642e 100644 --- a/app/src/main/res/values-be/strings.xml +++ b/app/src/main/res/values-be/strings.xml @@ -419,8 +419,6 @@ Пераключыць службу, выбраную ў дадзены момант: Выдаліць ўсе пазіцыі прайгравання Абмежаваны рэжым YouTube - Падтрымліваюцца толькі адрасы URL HTTPS - Дадаць экзэмпляр Экзэмпляры PeerTube Вынікі для: %s Мініяцюра відэа ў 1:1 @@ -436,9 +434,9 @@ Выдаліць загружаныя файлы Арыгінальныя тэксты з сэрвісаў будуць бачны ў ленце элементаў Ачысціце cookie, якія NewPipe захоўвае пры рашэнні reCAPTCHA - Экзэмпляр ужо існуе - Немагчыма праверыць экзэмпляр - Увесці URL экзэмпляра + Экзэмпляр ужо існуе + Немагчыма праверыць экзэмпляр + Увесці URL экзэмпляра Абярыце любімыя экзэмпляры PeerTube Актыўны плэер быў зменены Змена плэера можа замяніць вашу чаргу diff --git a/app/src/main/res/values-bg/strings.xml b/app/src/main/res/values-bg/strings.xml index dc13a16c292..134f6d4550e 100644 --- a/app/src/main/res/values-bg/strings.xml +++ b/app/src/main/res/values-bg/strings.xml @@ -461,7 +461,6 @@ Скрит Частен Предложения от сървъра - Добави инстанция Видеа Доклад в GitHub Копиране във форматиран вид @@ -516,7 +515,6 @@ Изтеглянето започна Действието отказано от системата Изберете любимите си PeerTube инстанции - Поддържат се само HTTPS хипервръзки %d минута %d минути @@ -535,7 +533,7 @@ Премахни изгледаните видеа\? Да, както и само частично изгледаните видеа Брой на абонати не е наличен - Инстанцията вече съществува + Инстанцията вече съществува Файлът е преместен или изтрит Известие за нова версия на NewPipe PeerTube инстанции diff --git a/app/src/main/res/values-bn-rBD/strings.xml b/app/src/main/res/values-bn-rBD/strings.xml index 6fa45249e4f..96ee5eb7c2a 100644 --- a/app/src/main/res/values-bn-rBD/strings.xml +++ b/app/src/main/res/values-bn-rBD/strings.xml @@ -258,9 +258,8 @@ গান গুলি ভিডিও গুলি YouTube নিষিদ্ধ মোড - শুধুমাত্র HTTPS URL গুলি সাপোর্ট করে - ইন্সটান্স এর ইউ আর এল - ইন্সটান্স যোগ করুন + + ইন্সটান্স এর ইউ আর এল আপনার পছন্দের পিয়ার টিউব ইন্সটান্স পিয়ার টিউব এর ইন্সটান্স সমূহ ছক diff --git a/app/src/main/res/values-bn-rIN/strings.xml b/app/src/main/res/values-bn-rIN/strings.xml index 24498f162c1..e34c5ef004e 100644 --- a/app/src/main/res/values-bn-rIN/strings.xml +++ b/app/src/main/res/values-bn-rIN/strings.xml @@ -205,7 +205,6 @@ অ্যাপ আপডেট এর সূচনা নিউ পাইপ এর সূচনা প্লেলিস্ট গুলি - ইন্সটান্স যোগ করুন ফাইল সব চালু করুন ফাইল ডিলিট হয়েছে @@ -234,7 +233,7 @@ শিল্পীরা ইভেন্টগুলি YouTube নিষিদ্ধ মোড চালু করুন - শুধুমাত্র HTTPS URL গুলি সাপোর্ট করে + বন্ধ করুন কোন সীমা নেই বুকমার্ক মুছুন @@ -261,7 +260,7 @@ পেছনে নিয়ে যান সেরা রেজুলিউসন গান গুলি - ইন্সটান্স এর ইউ আর এল + ইন্সটান্স এর ইউ আর এল আপনার পছন্দের পিয়ার টিউব ইন্সটান্স পিয়ার টিউব এর ইন্সটান্স সমূহ স্বয়ংক্রিয় diff --git a/app/src/main/res/values-bn/strings.xml b/app/src/main/res/values-bn/strings.xml index 0f1ea9c25dc..43ee7d838ec 100644 --- a/app/src/main/res/values-bn/strings.xml +++ b/app/src/main/res/values-bn/strings.xml @@ -201,9 +201,7 @@ ভিডিও এবং অডিও ব্যাবহার প্লেয়ার - শুধুমাত্র HTTPS URL গুলি সাপোর্ট করে - ইন্সটান্স এর ইউ আর এল - ইন্সটান্স যোগ করুন + ইন্সটান্স এর ইউ আর এল আপনার পছন্দের পিয়ার টিউব ইন্সটান্স পিয়ার টিউব এর ইন্সটান্স সমূহ কন্টেন্ট এর জন্য পছন্দসই ভাষা @@ -347,7 +345,7 @@ ঝিঝিপোকা ছাড়া কিছুই নেই এখানে এই ধরনের কোন ফাইল/বিষয়বস্তুর উৎস নেই অপুনরুদ্ধারযোগ্য প্লেয়ার ত্রুটি ঘটেছে - ইন্সট্যান্সটি যাচাই করা যায়নি + ইন্সট্যান্সটি যাচাই করা যায়নি রিক্যাপচা কুকিগুলো পরিষ্কার করা হয়েছে হ্যাঁ, এবং আংশিকভাবে দেখা ভিডিও ব্যবস্থা দ্বারা ক্রিয়া অস্বীকার করা হয়েছে @@ -422,7 +420,7 @@ সর্বোচ্চ চেষ্টা সাম্প্রতিক - ইন্সট্যান্স ইতোমধ্যে বিদ্যমান + ইন্সট্যান্স ইতোমধ্যে বিদ্যমান ডিফল্ট কন্টেন্টের দেশ সম্পর্কিত ভুক্তি বর্ণনা দেখাও @@ -516,7 +514,6 @@ পছন্দসমূহ কি আমদানি করতে চাও\? অবৈধ অক্ষরগুলো এই মান দ্বারা প্রতিস্থাপিত অন্য অ্যাপের উপরে দেখাতে অনুমতি দাও - %s-এ আপনার পছন্দের ইন্সট্যান্স খুঁজুন প্লে করা স্ট্রিমের ইতিহাস এবং প্লেব্যাক অবস্থানগুলি মুছে দেয় এই ভিডিওটি বয়সসীমাবদ্ধ । \n diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml index a42e6894089..61680a822f3 100644 --- a/app/src/main/res/values-ca/strings.xml +++ b/app/src/main/res/values-ca/strings.xml @@ -450,12 +450,9 @@ \n \nSi desitgeu visualitzar-lo, activeu \"%1$s\" a paràmetres. Activa el \"mode restringit\" de YouTube - La instància introduïda ja existeix - Només estàn soportades URLs HTTPS - No ha estat possible validar la instància - Introdueix l\'enllaç d\'una instància - Afegeix-hi una instància - Troba les instàncies que t\'agraden en %s + La instància introduïda ja existeix + No ha estat possible validar la instància + Introdueix l\'enllaç d\'una instància Selecciona les teves instàncies preferides del PeerTube Instàncies del PeerTube Avançar/-rebobinar duració cerca @@ -648,7 +645,7 @@ Marca com a vist Processant... Pot trigar un moment Inicia el reproductor principal en pantalla completa - Llisqueu els elements per eliminar-los + Llisqueu els elements per eliminar-los Si la rotació automàtica està bloquejada, no inicieu vídeos al mini reproductor, sinó que aneu directament al mode de pantalla completa. Podeu accedir igualment al mini reproductor sortint de pantalla completa Notificació d\'informe d\'error Tancar abruptament el reproductor diff --git a/app/src/main/res/values-ckb/strings.xml b/app/src/main/res/values-ckb/strings.xml index 399d2360e6c..3a360e2fb5e 100644 --- a/app/src/main/res/values-ckb/strings.xml +++ b/app/src/main/res/values-ckb/strings.xml @@ -90,7 +90,7 @@ نۆبه‌ت لێدان به‌ Kodi ناتوانرێت لێدوانەکان باربکرێن - بەستەری دۆخ دابنێ + بەستەری دۆخ دابنێ فایلی دەنگە دابه‌زێنراوەکان لێرەدا هەڵدەگیرێن ببورە، هەندێك کێشە ڕوویدا. هەناردە کردن بۆ @@ -197,7 +197,6 @@ كرتە بکە بۆ وردەکاری شوێنی هەموو کارپێکراوەکان بسڕدرێنەوە؟ باشترین ٥٠ - تەنها بەستەرەکانی https پشتگیریکراون پەیوەستبوونی پارێزراو هه‌ره‌سی هێنا ئەو ڤیدیۆیانەی پێشتر سەیرت کردوون و دواتر زیادت کردوون بۆ خشتەلێدان لادەدرێن. \nئایا دڵنیایت؟ ئەمە ناگەڕێنرێتەوە! @@ -227,7 +226,7 @@ ده‌نگ پیشاندانی کاتی بنچینەیی پێشوو لەسەر بابەتەکان وردەکارییەکان - هەمان دۆخ کاراکراوە + هەمان دۆخ کاراکراوە زمانی بنەڕەتی بابەت خشتەلێدانه‌ نیشانەکراوەکان سیاسەتی تایبەتی نیوپایپ @@ -335,14 +334,12 @@ گۆرانییەکان دابه‌زاندنی فایلی پەخش شێوازی پیشاندانی خشتە - زیادکردنی دۆخ پەسەند ئەم خشتەلێدانه‌ بسڕدرێتەوە؟ بێدەنگکردن سەردانی ماڵپەڕی نیوپایپ بکە بۆ زانیاری و هەواڵی نوێ. به‌رنامه‌یه‌كی خۆڕایی و کێشکەم بۆ پەخش لەسەر ئەندرۆید. بابەت به‌رده‌ست نییە - ئەو دۆخانە بدۆزەرەوە کە لەگەڵ خۆتدا دەگونجێن لە %s فایل نەدۆزرایەوە چارەسەردەکرێت @@ -478,7 +475,7 @@ هەڵە لە سكاڵا سڕینەوەی پاشماوەی هەموو ماڵپه‌ڕه‌كان بەرنامەکە نه‌دۆزرایه‌وه‌. دابمه‌زرێت؟ - ناتوانرێ پشتگیری دۆخەکە بکرێ + ناتوانرێ پشتگیری دۆخەکە بکرێ دامەزراندن ڤیدیۆکان بەستەرەکە پشتگیری نەکراوە @@ -658,7 +655,7 @@ دابەزاندن تەواوبوو %s دابەزاندن تەواوبوون - لادانی بابەتەکان بە سواندنیان + لادانی بابەتەکان بە سواندنیان لە حاڵەتێکدا کە لاربوونەوە ناکارا کرابوو ، ئەوا لەجیاتی لێدانی ڤیدیۆکان لە لێدەرێکی بچووکدا ، ڕاستەوخۆ ڤیدیۆکان لە دۆخی پڕ بە ڕوونمادا لێبدرێن. دەتوانیت بە دەرچوونت لەسەر ڤیدیۆکە بەردەوام بیت لەسەر لێدەرێکی بچووک دەستپێکردنی لێدەری سەرەکی لە ڕوونماپڕ لە نۆبەت دانان بۆ دواتر diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 9ba0d1e98ea..7ca0a8eae60 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -441,12 +441,9 @@ Délka přetočení vpřed/zpět Instance PeerTube Vybrat oblíbené instance PeerTube - Vyhledat instance, které se vám líbí, na %s - Přidat instanci - Zadat URL instance - Instanci nebylo možno potvrdit - Podporujeme pouze URL s HTTPS - Instance již existuje + Zadat URL instance + Instanci nebylo možno potvrdit + Instance již existuje Místní Přidány nedávno Nejoblíbenější @@ -674,7 +671,7 @@ Pokud je vypnuté automatické otáčení, nespouštějte video v mini přehrávači, ale přepněte se přímo do režimu celé obrazovky. Do mini přehrávače se lze i nadále dostat ukončením režimu celé obrazovky Další ve frontě Přidat do fronty (další) - Tažením položky odstraníte + Tažením položky odstraníte Spustit hlavní přehrávač na celé obrazovce Zpracovávám... může trvat moment Ručně zkontrolovat zda je k dispozici nová verze diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index 71bb83fb0ab..4ff147ed281 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -371,12 +371,9 @@ Maksimalt antal forsøg før downloaden opgives Sæt på pause ved skift til mobildata Downloads som ikke kan sættes på pause vil blive genstartet - Kun HTTPS URL-er understøttet - Instansen findes allerede - Kunde ikke bekræfte instans - Skriv ind instans-URL - Tilføj instans - Finn instanserne du liger på %s + Instansen findes allerede + Kunde ikke bekræfte instans + Skriv ind instans-URL Vælg dine favorit-PeerTube-instanser PeerTube-instanser Automatisk afspilning diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index ffc501c6351..39fbc30d66d 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -443,17 +443,14 @@ Die Sprache ändert sich, sobald die App neu gestartet wird PeerTube-Instanzen - Finde auf %s die Instanzen, die dir gefallen - Instanz hinzufügen - URL der Instanz eingeben - Validierung der Instanz fehlgeschlagen - Instanz existiert bereits + URL der Instanz eingeben + Validierung der Instanz fehlgeschlagen + Instanz existiert bereits Lokal Kürzlich hinzugefügt Auto-generiert (kein Autor gefunden) Eine Instanz wählen Bevorzugte Peertube-Instanzen auswählen - Es werden nur HTTPS-Adressen unterstützt Dauer der Suche bei schnellem Vor-/Zurückspulen Am beliebtesten Wiederherstellen @@ -661,7 +658,7 @@ Download abgeschlossen %s Downloads abgeschlossen - Wische über Elemente, um sie zu entfernen + Wische über Elemente, um sie zu entfernen Videos nicht im Miniplayer starten, sondern direkt in den Vollbildmodus schalten, wenn die automatische Drehung gesperrt ist. Du kannst immer noch auf den Miniplayer zugreifen, wenn du den Vollbildmodus verlässt Hauptplayer im Vollbildmodus starten Als Nächstes eingereiht diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index e202d2b34f0..41e8d0ae956 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -433,7 +433,6 @@ Η γλώσσα θα αλλάξει αφού επανεκκινηθεί η εφαρμογή Προεπιλεγμένο περίπτερο - Μόνο HTTPS σύνδεσμοι υποστηρίζονται Τοπικά Προστέθηκαν πρόσφατα Δημιουργήθηκε αυτόματα (δεν βρέθηκε χρήστης μεταφόρτωσης) @@ -562,11 +561,9 @@ Εκκαθάριση reCAPTCHA cookies Το YouTube διαθέτει «Περιορισμένη Λειτουργία» η οποία κρύβει πιθανώς ακατάλληλο περιεχόμενο Εμφάνιση πιθανώς ακατάλληλου περιεχομένου (18+) - Το instance υπάρχει ήδη - Αδυναμία πιστοποίησης του instance - Προσθέστε την URL του instance - Προσθήκη instance - Βρείτε τα instances που σας αρέσουν στο %s + Το instance υπάρχει ήδη + Αδυναμία πιστοποίησης του instance + Προσθέστε την URL του instance Επιλογή των αγαπημένων σας PeerTube instances Εμφάνιση αυθεντικού παρελθόντος χρόνου στα αντικείμενα Στιγμιότυπα PeerTube @@ -659,7 +656,7 @@ Η λήψη ολοκληρώθηκε %s λήψεις ολοκληρώθηκαν - Απομάκρυνση αντικειμένων με σύρσιμο + Απομάκρυνση αντικειμένων με σύρσιμο Εκκίνηση των βίντεο σε πλήρη οθόνη και όχι σε αναδυόμενο παράθυρο, αν η αυτόματη περιστροφή της οθόνης είναι ανενεργή. Μπορείτε να ενεργοποιήσετε το αναδυόμενο παράθυρο βγαίνοντας από την πλήρη οθόνη Εκκίνηση κύριου αναπαραγωγού σε πλήρη οθόνη Προστέθηκε το επόμενο στην ουρά diff --git a/app/src/main/res/values-eo/strings.xml b/app/src/main/res/values-eo/strings.xml index da1a040cb38..3cf8e140c0a 100644 --- a/app/src/main/res/values-eo/strings.xml +++ b/app/src/main/res/values-eo/strings.xml @@ -434,12 +434,9 @@ Daŭro de rapidpluiga/revolva serĉo Instancoj de PeerTube Elekti viajn preferitajn instancojn de PeerTube - Trovu la instancojn ke vi ŝatas ĉe %s - Aldoni instanco - Eniri la ligilon de la instanco - Ne povis validigi instanco - Nur HTTPS ligiloj estas subtenitaj - La instanco jam ekzistas + Eniri la ligilon de la instanco + Ne povis validigi instanco + La instanco jam ekzistas Lokaj Freŝe aldonitaj La plej ŝatitaj diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 9ab3b8ce954..8deb63747ad 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -441,12 +441,9 @@ Duración de búsqueda al avanzar y/o retroceder Instancias de PeerTube Selecciona tus instancias favoritas de PeerTube - Encuentra las instancias que te gusten en %s - Añadir instancia - Ingresar URL de la instancia - No se pudo validar la instancia - Solo se admiten URL HTTPS - La instancia ya existe + Ingresar URL de la instancia + No se pudo validar la instancia + La instancia ya existe Local Añadidos recientemente Más gustados @@ -662,7 +659,7 @@ Descarga finalizada %s descargas finalizadas - Desliza los elementos para removerlos + Desliza los elementos para removerlos Si la rotación automática está bloqueada, no inicie los videos en el mini reproductor, sino pase directamente a modo de pantalla completa. Aún podrá acceder al mini reproductor al salir del modo pantalla completa Iniciar reproductor principal en pantalla completa Añadido el siguiente vídeo a la cola diff --git a/app/src/main/res/values-et/strings.xml b/app/src/main/res/values-et/strings.xml index 029ff9878d2..8ef2c4df267 100644 --- a/app/src/main/res/values-et/strings.xml +++ b/app/src/main/res/values-et/strings.xml @@ -390,9 +390,7 @@ Kasulik mobiilsele andmesidele lülitumisel, kuigi mõningaid alla laadimisi ei saa peatada Kuvatakse otsingu tulemusi: %s Ava rakendusega - Sisesta isendi URL - Lisa isend - Otsi endale meeldivaid aadressilt %s + Sisesta isendi URL Vali PeerTube lemmikisendid PeerTube isendid URLi tuvastamine nurjus. Kas avada mõne teise rakendusega\? @@ -484,7 +482,6 @@ \nKui sa soovid seda näha, siis lülita seadistustest „%1$s“ sisse. YouTube\'is leiduv „Piiratud režiim“ peidab võimaliku täiskasvanutele mõeldud sisu Näita sisu, mis vanusepiirangu tõttu ilmselt ei sobi lastele (näiteks 18+) - Sa saad kasutada vaid HTTPS-urle Öine teema Ei iialgi Vaid Wi-Fi võrgus @@ -611,8 +608,8 @@ Kuva elementide algupärane aeg Kommentaarid on välja lülitatud Palun kontrolli kas sinu kogetud krahhi käsitlev vearaport on juba olemas. Luues korduvraporteid võtad meilt aega, mida saaksime kulutada tegelike vigade parandamiseks. - Instants on juba olemas - Instantsi valideerimine nurjus + Instants on juba olemas + Instantsi valideerimine nurjus Saadaval mõnedes teenustes. See on tavaliselt palju kiirem, kuid võib tagastada piiratud koguse elemente ja sageli osalise informatsiooni (nt. puudub kestus, elemendi tüüp, laiv olek) Sa saad nüüd valida kirjelduse tekstist. Pane tähele, et valikurežiimis võib leht vilkuda ja lingid ei pruugi olla klõpsatavd. Autor: %s @@ -651,7 +648,7 @@ Näita piltide allikat Kaugotsingu soovitused Kohaliku otsingu soovitused - Kirje eemaldamiseks viipa + Kirje eemaldamiseks viipa Kustutasin %1$s allalaadimise Kustutasin %1$s allalaadimist diff --git a/app/src/main/res/values-eu/strings.xml b/app/src/main/res/values-eu/strings.xml index d4bddf4a8e3..bade04d368f 100644 --- a/app/src/main/res/values-eu/strings.xml +++ b/app/src/main/res/values-eu/strings.xml @@ -436,12 +436,9 @@ Aurreratze/atzeratze bilaketaren iraupena PeerTube instantziak Hautatu zure gogoko PeerTube instantziak - Aurkitu gustuko instantziak hemen: %s - Gehitu instantzia - Sartu instantziaren URLa - Ezin izan da instantzia balioztatu - HTTPS URLak onartzen dira soilik - Instantzia badago aurretik + Sartu instantziaren URLa + Ezin izan da instantzia balioztatu + Instantzia badago aurretik Lokala Berriki gehitua Gogokoenak @@ -659,7 +656,7 @@ Urruneko bilaketaren iradokizunak Tokiko bilaketa-iradokizunak Ikusi gisa markatu - Lerratu elementuak aldetara ezabatzeko + Lerratu elementuak aldetara ezabatzeko Ez hasi bideoak mini erreproduzitzailean eta hasi bideoak pantaila osoan zuzenean, auto biraketa blokeatuta badago. Mini erreproduzitzailea erabili dezakezu pantaila osotik irtetzean Hasi erreproduzitzaile nagusia pantaila osoan Isatsari bideo hau erantsita diff --git a/app/src/main/res/values-fa/strings.xml b/app/src/main/res/values-fa/strings.xml index dac49883d88..1cb8d0e3de9 100644 --- a/app/src/main/res/values-fa/strings.xml +++ b/app/src/main/res/values-fa/strings.xml @@ -417,12 +417,9 @@ عملکرد هنگام تغییر به برنامه دیگر از پخش‌کننده اصلی فیلم — %s قطعه‌ها ویدیوها - این نمونه قبلا وجود دارد - تنها نشانی‌های دارای http پشتیبانی می‌شوند - ناتوانی در اعتبارسنجی نشانی نمونه - نشانی نمونه را وارد کنید - افزودن نمونه - نمونه‌های مورد علاقه خود را در %s پیدا کنید + این نمونه قبلا وجود دارد + ناتوانی در اعتبارسنجی نشانی نمونه + نشانی نمونه را وارد کنید نمونه پیرتیوب مورد علاقه خود در را انتخاب کنید نمونه‌های پیرتیوب مدت زمان حرکت سریع به جلو یا عقب @@ -659,7 +656,7 @@ به کار انداختن گزینش متن در شرح از کار انداختن گزینش متن در شرح - برای برداشتن موارد، بکشیدشان + برای برداشتن موارد، بکشیدشان اگر چرخش خودکار قفل باشد، ویدیوها را در پخش‌کنندهٔ کوچک آغاز نمی‌کند، بلکه مستقیماً به تمام‌صفحه می‌رود. همچنان می‌توانید با خروج از تمام‌صفحه به پخش‌کنندهٔ کوچک دسترسی داشته باشید آغاز پخش‌کنندهٔ اصلی در تمام‌صفحه بعدی در صف گذاشته شد diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index b4e807e5efd..80f25498059 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -381,12 +381,9 @@ \nSalli ”%1$s” asetuksissa katsoaksesi.
Ota käyttöön YouTuben ”Rajoitettu tila” Päivitykset - Instanssi on jo olemassa - Vain HTTPS-URL:t ovat tuettuja - Instanssia ei voitu vahvistaa - Syötä instanssin URL - Lisää instanssi - Hae instansseja, joista pidät, osoitteesta %s + Instanssi on jo olemassa + Instanssia ei voitu vahvistaa + Syötä instanssin URL Valitse PeerTube-suosikki-instanssisi PeerTube-instanssit Automaattinen toisto @@ -658,7 +655,7 @@ %s latausta valmiina Käynnistä pääsoitin koko näytössä - Pyyhkäise kohteita poistaaksesi ne + Pyyhkäise kohteita poistaaksesi ne Älä käynnistä videoita minisoittimessa, vaan siirry suoraan koko näytön tilaan, jos automaattinen kierto on lukittu. Voit silti käyttää minisoitinta poistumalla koko näytön tilasta Poistettu %1$s lataus diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 1716cc06b06..05a553c2191 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -436,12 +436,9 @@ Durée de l’avance et retour rapide Instances PeerTube Veuillez choisir vos instances PeerTube préférées - Trouvez les instances que vous aimez sur %s - Ajouter une instance - Veuillez saisir l’URL de l’instance - Impossible de valider l’instance - Seules les URL en HTTPS sont prises en charge - L’instance existe déjà + Veuillez saisir l’URL de l’instance + Impossible de valider l’instance + L’instance existe déjà Local Ajoutées récemment Les plus aimées @@ -661,7 +658,7 @@ Téléchargement terminé %s téléchargements terminés - Balayez un élément pour le supprimer + Balayez un élément pour le supprimer Ne pas lancer les vidéos dans le mini lecteur mais directement en plein écran si la rotation automatique est verrouillée. Vous pouvez toujours accéder au mini-lecteur en quittant le mode plein écran Lancer le lecteur principal en plein écran Ajouter à la liste de lecture diff --git a/app/src/main/res/values-gl/strings.xml b/app/src/main/res/values-gl/strings.xml index 7b49adc6d45..436035c2254 100644 --- a/app/src/main/res/values-gl/strings.xml +++ b/app/src/main/res/values-gl/strings.xml @@ -333,7 +333,6 @@ Minimizar ao reprodutor en segundo plano Minimizar o reprodutor popup Limitado - Só son compatibles os URLs HTTPS Control xestual do volume Desactíveo para agochar os comentarios Retomar a reprodución @@ -521,11 +520,9 @@ \nSe desexa visualizalo, habilite \"%1$s\" nas opcións.
Activar modo restrinxido de YouTube Actualizacións - A instancia xa existe - Non se puido validar a instancia - Introduza o URL da instancia - Engadir instancia - Atopar as instancias que lle gustan en %s + A instancia xa existe + Non se puido validar a instancia + Introduza o URL da instancia Selecciona as instancias favoritas de PeerTube Instancias de PeerTube Idioma do contido predeterminado @@ -656,7 +653,7 @@ Enfileirar o seguinte vídeo Inciar reprodutor principal en pantalla completa Non iniciar vídeos no reprodutor mini, mais cambiar a pantalla completa directamente, se a rotación estiver bloqueada. Aínda pode acceder o reprodutor mini ao saír da pantalla completa - Deslice os elementos para removelos + Deslice os elementos para removelos Non foi atopado ningún xestor de arquivos adecuado para esta acción. \nPor favor instale un ou tente deshabilitar \'%s\' nas opcións de descarregamento. Non foi atopado ningún xestor de arquivos adecuado para esta acción. diff --git a/app/src/main/res/values-he/strings.xml b/app/src/main/res/values-he/strings.xml index 4d4350f077d..a4d41a97b1a 100644 --- a/app/src/main/res/values-he/strings.xml +++ b/app/src/main/res/values-he/strings.xml @@ -446,12 +446,9 @@ משך קפיצה מהירה קדימה/אחורה מופעים של PeerTube נא לבחור את מופעי ה־PeerTube המועדפים עליך - איתור המופעים האהובים עליך תחת %s - הוספת מופע - נא להכניס כתובת מופע - לא ניתן לאמת את המופע - יש תמיכה בכתובות HTTPS בלבד - המופע כבר קיים + נא להכניס כתובת מופע + לא ניתן לאמת את המופע + המופע כבר קיים מקומי נוספו לאחרונה האהובים ביותר @@ -683,7 +680,7 @@ %s הורדות הסתיימו %s הורדות הסתיימו - ניתן להחליק פריטים להסרתם + ניתן להחליק פריטים להסרתם לא להפעיל סרטונים בנגן המוקטן, לעבור למצב מסך מלא ישירות במקום זאת, אם הטיה אוטומטית מושבתת. עדיין ניתן לגשת לנגן המוקטן על ידי יציאה ממסך מלא הפעלת הנגן הראשי במסך מלא נוסף כהבא בתור diff --git a/app/src/main/res/values-hi/strings.xml b/app/src/main/res/values-hi/strings.xml index 1d76be613a8..03c6d2b5a57 100644 --- a/app/src/main/res/values-hi/strings.xml +++ b/app/src/main/res/values-hi/strings.xml @@ -463,7 +463,6 @@ यूट्यूब एक \"प्रतिबंधित मोड\" प्रदान करता है जो संभावित रूप से परिपक्व सामग्री को छुपाता है यूट्यूब का \"प्रतिबंधित मोड\" चालू करें बच्चों के लिए अनुपयुक्त सामग्री दिखाएं क्योंकि इसकी आयु सीमा है (जैसे 18) - केवल HTTPS यूआरएल ही समर्थित हैं URL की पहचान नहीं हो सकी। दूसरे ऐप से खोलें\? ऑटोमैटिकली कतार करे कतार को मिटाने से पहले सत्यापन के लिए पूछें @@ -546,11 +545,9 @@ हैश की गणना स्वरूपित रिपोर्ट कॉपी करें कुकी साफ़ करें जिसे न्यूपाइप आपके द्वारा रीकैप्चा हल करने पर संग्रहीत करता है - उदाहरण पहले से मौजूद है - उदाहरण मान्य नहीं किया जा सका - उदाहरण URL दर्ज करें - उदाहरण जोड़ें - %s . पर अपनी पसंद के उदाहरण ढूँढ़ें + उदाहरण पहले से मौजूद है + उदाहरण मान्य नहीं किया जा सका + उदाहरण URL दर्ज करें अपने पसंदीदा PeerTube उदाहरण चुनें मुख्य प्लेयर को पूर्ण स्क्रीन में शुरू करें मिनी प्लेयर में वीडियो शुरू न करें, लेकिन ऑटो रोटेशन लॉक होने पर सीधे फुल स्क्रीन मोड पर जाएं। आप अब भी फ़ुलस्क्रीन से बाहर निकलकर मिनी प्लेयर तक पहुंच सकते हैं। diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml index 0ca0c75dc1f..eead621c29b 100644 --- a/app/src/main/res/values-hr/strings.xml +++ b/app/src/main/res/values-hr/strings.xml @@ -417,7 +417,6 @@ Nitko ne sluša Jezik će se promijeniti nakon ponovnog pokretanja programa Zadani Kiosk - Podržani su samo HTTP URL-ovi Lokalno Nedavno dodano Autogenerirano (prenositelj nedefiniran) @@ -548,11 +547,9 @@ YouTube nudi postavku „Ograničeni način rada”, čime se skriva sadržaj za odrasle Uključi YouTube postavku „Ograničeni način rada” Prikaži sadržaj koji vjerojatno nije prikladan za djecu, jer je dobno ograničen (kategorija 18) - Primjerak već postoji - Neuspjela provjera primjerka - Upiši URL primjerka - Dodaj primjerak - Pronađi omiljene primjerke na %s + Primjerak već postoji + Neuspjela provjera primjerka + Upiši URL primjerka Odaberi tvoje omiljene PeerTube primjerke PeerTube primjerci Vrijeme premotavanja prema naprijed ili natrag @@ -658,7 +655,7 @@ Sada možeš odabrati tekst u opisu. Napomena: stranica će možda treperiti i možda nećeš moći kliknuti poveznice u načinu rada za odabir teksta. %s daje ovaj razlog: Obrada... Pričekajte trenutak - Povucite stavke da biste ih uklonili + Povucite stavke da biste ih uklonili Prikazati indikatore slike Dovršeno %s preuzimanje diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index e5457d3e104..1b9cb906bcb 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -485,7 +485,7 @@ \n \nEngedélyezze a(z) „%1$s” beállítást, ha meg szeretné tekinteni. Gyermekek számára esetlegesen nem megfelelő, korhatáros tartalom megjelenítése (például 18+) - Csak a HTTPS URL-ek támogatottak + Metainformációk megjelenítése A jelenleg aktív lejátszási sor le lesz cserélve Megerősítés kérése a lejátszási sor törlése előtt @@ -545,11 +545,9 @@ Videó ujjlenyomat-készítési értesítése A YouTube biztosít egy „Korlátozott módot”, amely elrejti a lehetséges felnőtteknek szóló tartalmat A YouTube „Korlátozott módjának” bekapcsolása - A példány már létezik - A példány érvényesítése nem sikerült - Adja meg a példány URL-ét - Példány hozzáadása - Találjon önnek tetsző példányokat itt: %s + A példány már létezik + A példány érvényesítése nem sikerült + Adja meg a példány URL-ét Válassza ki a kedvenc PeerTube példányait PeerTube példányok Életciklusából kifutott hibák jelentése @@ -573,7 +571,7 @@ A videókat ne a kis lejátszóban indítsa el, hanem kapcsolja be a teljes képernyős módot, ha az automatikus forgatás zárolva van. Továbbra is elérheti a kis lejátszót, ha kilép a teljes képernyőből. Szolgáltatás be/ki, jelenleg kiválasztott: A megjegyzések ki vannak kapcsolva - Húzza oldalra az elemeket az eltávolításukhoz + Húzza oldalra az elemeket az eltávolításukhoz A következő sorba állítása A következő sorba állítva Feldolgozás… Ez eltarthat egy ideig. diff --git a/app/src/main/res/values-ia/strings.xml b/app/src/main/res/values-ia/strings.xml index d5bc90e6f55..9e4676c5012 100644 --- a/app/src/main/res/values-ia/strings.xml +++ b/app/src/main/res/values-ia/strings.xml @@ -63,9 +63,8 @@ Lingua predefinite del contento Instantias de PeerTube Selige tu instantias favorite de PeerTube - Adder instantia - Insere URL de instantia - Le instantia jam existe + Insere URL de instantia + Le instantia jam existe Reproductor Comportamento Video e audio @@ -232,5 +231,5 @@ Monstrante resultatos pro: %s Solmente alicun apparatos pote reproducer videos 2K/4K Initiar le reproductor principal in schermo plen - Solmente le URLs HTTPS es supportate + \ 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 1a88bb7471e..df9d2bedc9f 100644 --- a/app/src/main/res/values-in/strings.xml +++ b/app/src/main/res/values-in/strings.xml @@ -429,12 +429,9 @@ Bahasa akan diterapkan setelah aplikasi dimulai ulang Situs PeerTube Pilih situs PeerTube favorit Anda - Temukan situs yang Anda suka di %s - Tambah situs - Masukkan URL situs - Tidak bisa memvalidasi situs - Hanya mendukung URL HTTPS - Situs sudah ada + Masukkan URL situs + Tidak bisa memvalidasi situs + Situs sudah ada Lokal Baru ditambahkan Disukai terbanyak @@ -640,7 +637,7 @@ %s unduhan selesai - Geser item untuk membuangnya + Geser item untuk membuangnya Disukai oleh kreator Saran pencarian lokal Saran pencarian remote diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 1726c32c30a..3adbb87df59 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -436,12 +436,9 @@ Durata avanzamento e riavvolgimento rapidi Istanze PeerTube Seleziona le istanze PeerTube preferite - Trova altre istanze su %s - Aggiungi istanza - Inserisci l\'URL dell\'istanza - Impossibile convalidare l\'istanza - Sono supportati solo gli URL HTTPS - L\'istanza esiste già + Inserisci l\'URL dell\'istanza + Impossibile convalidare l\'istanza + L\'istanza esiste già Locale Aggiunti di recente Più piaciuti @@ -659,7 +656,7 @@ Download completato %s download completati - Scorri gli elementi per rimuoverli + Scorri gli elementi per rimuoverli Se la rotazione automatica è bloccata, i video non saranno avviati nel mini player, ma direttamente a schermo intero. È comunque possibile accedere al mini player uscendo dalla modalità a schermo intero Avvia il lettore principale a schermo intero Aggiunto alla coda come prossimo diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 9a15b25d121..cfdd54c6ae2 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -431,12 +431,9 @@ 高速早送り/巻き戻し時間 PeerTube インスタンス PeerTube インスタンスを選択する - あなたに最適なインスタンスを探す: %s - インスタンスを追加 - インスタンスの URL を入力 - インスタンスを検証することができませんでした - HTTPS の URL のみに対応しています - インスタンスはすでに存在しています + インスタンスの URL を入力 + インスタンスを検証することができませんでした + インスタンスはすでに存在しています ローカル 最近追加された 高評価 @@ -638,7 +635,7 @@ 視聴済みとしてマーク リモート検索候補 ローカル検索候補 - アイテムをスワイプして削除 + アイテムをスワイプして削除 直接フルスクリーンモードに切り替えて、ミニプレイヤーで動画を開始しません。自動回転がロックされている場合でも、フルスクリーンを終了することでミニプレイヤーにアクセスできます フルスクリーンでメインプレイヤーを開始 diff --git a/app/src/main/res/values-kmr/strings.xml b/app/src/main/res/values-kmr/strings.xml index c93a111f120..e279653f2d1 100644 --- a/app/src/main/res/values-kmr/strings.xml +++ b/app/src/main/res/values-kmr/strings.xml @@ -200,12 +200,9 @@ Video û deng Xwenîşandinî Lîstikvan - Mînak jixwe heye - Tenê URL-yên HTTPS têne piştgirî kirin - Mînak nehate pejirandin - URL-ya mînakê binivîse - Mînak zêde bikin - Mînakên ku hûn dixwazin li %s bibînin + Mînak jixwe heye + Mînak nehate pejirandin + URL-ya mînakê binivîse Mînakên xweyên bijare yên PeerTube hilbijêrin Mînakên PeerTube Zimanê naveroka bixweber diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index d0d54c62d9d..8fa96d30260 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -431,12 +431,9 @@ 빠른-감기/되감기 찾는 시간 피어튜브 인스턴스 당신이 선호하는 피어튜브 인스턴스를 선택하세요. - %s에서 당신이 좋아하는 인스턴스를 찾으세요. - 인스턴스 추가하기 - 인스턴스 URL을 입력하세요. - 인스턴스를 검증할 수 없습니다. - 오직 HTTPS URL들만 지원합니다. - 인스턴스가 이미 존재합니다. + 인스턴스 URL을 입력하세요. + 인스턴스를 검증할 수 없습니다. + 인스턴스가 이미 존재합니다. 로컬 최근에 추가됨. 가장 선호하는 diff --git a/app/src/main/res/values-ku/strings.xml b/app/src/main/res/values-ku/strings.xml index 09a4ad96a86..cfb84712566 100644 --- a/app/src/main/res/values-ku/strings.xml +++ b/app/src/main/res/values-ku/strings.xml @@ -413,12 +413,9 @@ ماوەی خێرا بردنە پێشەوە\\ گێڕانەوە بۆ دواوە دۆخی پێرتووبی دۆخە دڵخوازەکانی پێرتووبی دیاریبکە - ئەو دۆخانە بدۆزەرەوە کە لەگەڵ خۆتدا دەگونجێن لە %s - زیادکردنی دۆخ - بەستەری دۆخ دابنێ - ناتوانرێ پشتگیری دۆخەکە بکرێ - تەنها بەستەرەکانی https پشتگیریکراون - هەمان دۆخ کاراکراوە + بەستەری دۆخ دابنێ + ناتوانرێ پشتگیری دۆخەکە بکرێ + هەمان دۆخ کاراکراوە نەدۆزرایەوە چارەسەرکردن شکستی هێنا ڕاگرتن diff --git a/app/src/main/res/values-lt/strings.xml b/app/src/main/res/values-lt/strings.xml index e3ffbb03a16..85007f9f484 100644 --- a/app/src/main/res/values-lt/strings.xml +++ b/app/src/main/res/values-lt/strings.xml @@ -331,10 +331,7 @@ Įjungti YouTube „apribotą režimą“ Rodyti turinį kuris gali būti netinkamas vaikams (18+) Atnaujinimai - Kopija jau yra - Palaikomi tik HTTPS adresai - Pridėti kopiją - Pasirinkite patikusias kopijas %s + Kopija jau yra Pasirinkite mėgiamiausias PeerTube kopijas PeerTube kopijos URL neatpažintas. Atverti kita programa\? @@ -374,8 +371,8 @@ Pakeisti miniatiūrų dydi 1:1 santykiu Atkūrimo vietos pašalintos Pašalinti visas atkūrimo vietas\? - Netinkama kopija - Įveskite kopijos URL + Netinkama kopija + Įveskite kopijos URL Atstatyti paskutinį atkūrimo laiką Tęsti atkūrimą Rodyti aprašymą @@ -671,7 +668,7 @@ %s atsiuntimai baigti %s atsiuntimų baigta - Perbraukite elementus, kad juos pašalintumėte + Perbraukite elementus, kad juos pašalintumėte Nepradėti vaizdo įrašų naudojant mini grotuvą, o iškart įjungti viso ekrano režimą, jei automatinis pasukimas yra užrakintas. Vis tiek galėsite pasiekti mini grotuvą išėję iš viso ekrano rėžimo Paleisti pagrindinį grotuvą viso ekrano režimu Sekantis pridėtas į eilę diff --git a/app/src/main/res/values-lv/strings.xml b/app/src/main/res/values-lv/strings.xml index c28c80f383a..3f43fbfe960 100644 --- a/app/src/main/res/values-lv/strings.xml +++ b/app/src/main/res/values-lv/strings.xml @@ -267,12 +267,9 @@ Video un audio Uzvedība Atskaņotājs - Instance jau eksistē - Tikai HTTPS saišu URL ir atbalstīti - Nevarēja apstiprināt instanci - Ievadīt instances saites URL - Pievienot instanci - Atrodiet instances, kas jums patīk ar %s + Instance jau eksistē + Nevarēja apstiprināt instanci + Ievadīt instances saites URL Izvēlaties jūsu mīļāko PeerTube instanci PeerTube instances Valoda nomainīsies, kad aplikāciju restartēs @@ -639,7 +636,7 @@ “Krātuves Piekļuves Sistēma” ir neatbalstīta uz Android KitKat un zemākām versijām Ieslēgt teksta atlasīšanu video aprakstā Nav izvēlēts noklusējuma lejupielādes mape, izvēlaties to tagad - Pārvelciet objektus, lai tos noņemtu + Pārvelciet objektus, lai tos noņemtu Rādīt noskatītos video Lokālie meklēšanas ieteikumi Rādīt attēlu indikatorus diff --git a/app/src/main/res/values-mk/strings.xml b/app/src/main/res/values-mk/strings.xml index 0aaa8d54647..9619c29d5de 100644 --- a/app/src/main/res/values-mk/strings.xml +++ b/app/src/main/res/values-mk/strings.xml @@ -405,6 +405,4 @@ Брзо премотување напред Примери на PeerTube Одберете ги вашите омилени PeerTube пример - Пронајдете ги примерите кои ви се допаѓаат на %s - Додадете пример \ No newline at end of file diff --git a/app/src/main/res/values-ml/strings.xml b/app/src/main/res/values-ml/strings.xml index c38e5667167..d99d821db22 100644 --- a/app/src/main/res/values-ml/strings.xml +++ b/app/src/main/res/values-ml/strings.xml @@ -298,12 +298,9 @@ വീഡിയോയും ഓഡിയോയും സ്വഭാവം പ്ലെയർ - സന്ദർഭം നേരത്തെ നിലവിലുണ്ട് - HTTPS URL കൾ മാത്രമേ പിന്തുണക്കുകയുള്ളൂ - സന്ദർഭം സാധൂകരിക്കാൻ സാധിച്ചില്ല - സന്ദർഭത്തിന്റെ URL കൂട്ടിച്ചേർക്കുക - സന്ദർഭം ചേർക്കുക - %s-ൽ നിങ്ങൾ ഇഷ്ടപ്പെടുന്ന സന്ദർഭങ്ങളെ കണ്ടെത്തുക + സന്ദർഭം നേരത്തെ നിലവിലുണ്ട് + സന്ദർഭം സാധൂകരിക്കാൻ സാധിച്ചില്ല + സന്ദർഭത്തിന്റെ URL കൂട്ടിച്ചേർക്കുക നിങ്ങളുടെ പ്രിയപ്പെട്ട പിയർട്യൂബ് സന്ദർഭങ്ങളെ തിരഞ്ഞെടുക്കുക പിയർട്യൂബ് സന്ദർഭങ്ങൾ സ്ഥിര കന്റെന്റ്‌ ഭാഷ @@ -651,6 +648,6 @@ ലോക്കൽ സെർച്ച്‌ നിർദേശങ്ങൾ കണ്ടതാണെന്ന് അടയാളപ്പെടുത്തുക തുടങ്ങുന്ന പ്രേധാന പേജ് മുഴുവന്‍ സ്ക്രീനില്‍ കാണിക്കുക - ഐറ്റം കളയണം എന്നുണ്ടെല്‍ സ്വൈപ്പ് ചൈയ്യുക + ഐറ്റം കളയണം എന്നുണ്ടെല്‍ സ്വൈപ്പ് ചൈയ്യുക മിനി പ്ലേയര്‍ -ല്‍ വീഡിയോ -ക്കള്‍ ഒരിക്കലും സ്റ്റാര്‍ട്ട് ചൈയ്യരുത് , പക്ഷേ നേരെ ഫുള്‍ സ്ക്രീന്‍ മോഡിലെക് മാറും .ഓട്ടോ റൊട്ടേഷന്‍ ലോക്ക് ചെയിത്തിട്ടുണ്ടെങ്കില്‍ നിലവിലെ ഫുള്‍ സ്ക്രീന്‍ നില്‍ നിന്നും മിനി പ്ലായേറിലെക് മാറാന്‍ ആകും \ No newline at end of file diff --git a/app/src/main/res/values-nb-rNO/strings.xml b/app/src/main/res/values-nb-rNO/strings.xml index b2829ba27c7..cdf57fe63c7 100644 --- a/app/src/main/res/values-nb-rNO/strings.xml +++ b/app/src/main/res/values-nb-rNO/strings.xml @@ -439,12 +439,9 @@ Tøm nedlastingshistorikk Slett nedlastede filer Velg dine favoritter blant PeerTube-instansene - Finn instansene du liker på %s - Legg til instans - Skriv inn nettadresse til instans - Kunne ikke bekrefte instans - Kun HTTPS-nettadresser støttes - Instansen finnes allerede + Skriv inn nettadresse til instans + Kunne ikke bekrefte instans + Instansen finnes allerede Autogenerert (fant ingen opplaster) gjenoppretter Kan ikke gjenopprette denne nedlastingen @@ -658,7 +655,7 @@ Vis Picasso-fargede bånd på toppen av bilder for å indikere kilde: Rød for nettverk, blå for disk, og grønn for minne Hjertemerket av skaper Vis bildeindikatorer - Dra elementer for å fjerne dem + Dra elementer for å fjerne dem Start hovedspiller i fullskjerm Spill etterpå Spill etterpå diff --git a/app/src/main/res/values-ne/strings.xml b/app/src/main/res/values-ne/strings.xml index 9cbad12ab68..f5c99bf781d 100644 --- a/app/src/main/res/values-ne/strings.xml +++ b/app/src/main/res/values-ne/strings.xml @@ -430,12 +430,9 @@ छिटो-अगाडि /-पछाडी खोज्न अवधि PeerTube उदाहरणहरू आफ्नो मनपर्ने PeerTube उदाहरणहरू चयन - %s मा तपाईंलाई मनपर्ने ईन्स्टान्सहरू फेला पार्नुहोस् - उदाहरण थप्नुहोस् - उदाहरणका URL प्रविष्ट गर्नुहोस् - उदाहरणका मान्य सकेन - HTTPS URL हरू मात्र समर्थित - उदाहरणका पहिले नै अवस्थित + उदाहरणका URL प्रविष्ट गर्नुहोस् + उदाहरणका मान्य सकेन + उदाहरणका पहिले नै अवस्थित स्थानिय हालसालै थपिएको सबैभन्दा धेरै मनपराइएको diff --git a/app/src/main/res/values-nl-rBE/strings.xml b/app/src/main/res/values-nl-rBE/strings.xml index 376b4331985..c7315584062 100644 --- a/app/src/main/res/values-nl-rBE/strings.xml +++ b/app/src/main/res/values-nl-rBE/strings.xml @@ -537,12 +537,9 @@ YouTube biedt een \"beperkte modes\" aan, dit verbergt mogelijk materiaal voor volwassenen YouTube \"beperkte modus\" aanzetten Toon inhoud die mogelijk niet geschikt is voor kinderen omwille van een leeftijdslimiet (zoals 18+) - Kanaal bestaat al - Alleen HTTPS URL\'s worden ondersteund - Kon kanaal niet valideren - Kanaal URL invoeren - Kanaal toevoegen - Vind het kanaal dat u leuk vindt op %s + Kanaal bestaat al + Kon kanaal niet valideren + Kanaal URL invoeren Selecteer je favoriete PeerTube kanaal PeerTube kanaal Kon de URL niet herkennen. In een andere app openen\? @@ -612,7 +609,7 @@ Hoge kwaliteit (groter) Lage kwaliteit (kleiner) Start hoofdspeler in volledig scherm - Veeg items om ze te verwijderen + Veeg items om ze te verwijderen Zoekbalk miniatuurvoorbeeld Markeer als bekeken Lokale zoeksuggesties diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 3a943d2cad1..c46439fc111 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -434,12 +434,9 @@ Duur voor-/achteruit spoelen PeerTube kanaal Selecteer je favorite PeerTube kanaal - Vind het kanaal dat je leuk vindt op %s - Kanaal toevoegen - Kanaal URL invoeren - Kon kanaal niet valideren - Alleen HTTPS URL\'s worden ondersteund - Kanaal bestaat al + Kanaal URL invoeren + Kon kanaal niet valideren + Kanaal bestaat al Lokaal Recentelijk toegevoegd Automatisch gegenereerd (geen uploader gevonden) @@ -661,7 +658,7 @@ Volgende item in de wachtrij geplaatst Plaats volgende item in de wachtrij - Veeg items om ze te verwijderen + Veeg items om ze te verwijderen Start geen video\'s in de minispeler, maar ga direct naar de volledige schermmodus, als automatisch draaien is vergrendeld. Je hebt nog steeds toegang tot de minispeler door de volledige schermmodus af te sluiten Start hoofdspeler als volledig scherm Verwerken... Dit kan even duren diff --git a/app/src/main/res/values-pa/strings.xml b/app/src/main/res/values-pa/strings.xml index 2b08ebb32d6..7107c6e4610 100644 --- a/app/src/main/res/values-pa/strings.xml +++ b/app/src/main/res/values-pa/strings.xml @@ -584,12 +584,9 @@ ਯੂਟਿਊਬ \"ਪਾਬੰਦੀਸ਼ੁਦਾ ਮੋਡ\" ਉਪਲਬਧ ਕਰਾਉਂਦਾ ਹੈ ਜੋ ਬਾਲਗਾਂ ਵਾਲ਼ੀ ਸਮੱਗਰੀ ਲੁਕਾਉਂਦਾ ਹੈ ਯੂਟਿਊਬ ਦਾ ਪਾਬੰਦੀਸ਼ੁਦਾ ਮੋਡ ਚਾਲੂ ਕਰੋ ਉਹ ਸਮੱਗਰੀ ਵੀ ਵਿਖਾਓ ਜੋ ਉਮਰ-ਸੀਮਾ ਕਰਕੇ ਬੱਚਿਆਂ ਲਈ ਸ਼ਾਇਦ ਸਹੀ ਨਾ ਹੋਵੇ (ਜਿਵੇਂ 18+) - ਸਥਿਤੀ ਪਹਿਲਾਂ ਨੂੰ ਮੌਜੂਦ ਹੈ - ਸਿਰਫ਼ HTTP URLs ਹੀ ਮਾਣਨਯੋਗ ਹਨ - ਸਥਿਤੀ ਦੀ ਜਾਇਜ਼ਗੀ ਤਸਦੀਕ ਨਹੀਂ ਹੋ ਸਕੀ - ਸਥਿਤੀ URL ਦਾਖ਼ਲ ਕਰੋ - ਸਥਿਤੀਆਂ ਜੋੜੋ - ਤੁਹਾਡੀਆਂ ਪਸੰਦੀਦਾ ਸਥਿਤੀਆਂ %s \'ਤੇ ਲੱਭੋ + ਸਥਿਤੀ ਪਹਿਲਾਂ ਨੂੰ ਮੌਜੂਦ ਹੈ + ਸਥਿਤੀ ਦੀ ਜਾਇਜ਼ਗੀ ਤਸਦੀਕ ਨਹੀਂ ਹੋ ਸਕੀ + ਸਥਿਤੀ URL ਦਾਖ਼ਲ ਕਰੋ ਆਪਣੀ ਪਸੰਦੀਦਾ ਪੀਰਟਿਊਬ ਸਥਿਤੀਆਂ ਚੁਣੋ ਪੀਰਟਿਊਬ ਸਥਿਤੀਆਂ URL ਪਛਾਣ ਨਹੀਂ ਹੋਇਆ। ਕਿਸੇ ਹੋਰ ਐਪ ਨਾਲ਼ ਖੋਲ੍ਹਣਾ ਹੈ\? diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 6e2c95119a8..2594459dae2 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -445,12 +445,9 @@ Wielkość skoku przy przewijaniu Serwery PeerTube Wybierz swoje ulubione serwery PeerTube - Znajdź serwery, które lubisz, na %s - Dodaj serwer - Wprowadź adres URL serwera - Nie udało się sprawdzić poprawności serwera - Obsługiwane są tylko adresy HTTPS - Serwer już istnieje + Wprowadź adres URL serwera + Nie udało się sprawdzić poprawności serwera + Serwer już istnieje Lokalne Ostatnio dodane Najbardziej lubiane @@ -678,7 +675,7 @@ %s ukończonych pobrań %s ukończonych pobrań - Przesuń w bok elementy, aby je usunąć + Przesuń w bok elementy, aby je usunąć Nie uruchamiaj wideo w miniodtwarzaczu, ale przełączaj się bezpośrednio na tryb pełnoekranowy, jeśli automatyczne obracanie jest zablokowane. Nadal możesz uzyskać dostęp do miniodtwarzacza, wychodząc z trybu pełnoekranowego Uruchamiaj główny odtwarzacz w trybie pełnoekranowym Dodano do kolejki (następny) diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index d19196c0644..8895d142765 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -436,12 +436,9 @@ Duração do salto para avançar/retroceder Instâncias do PeerTube Escolha suas instâncias do PeerTube favoritas - Encontre as instâncias que gosta em %s - Adicionar instância - Insira o link da instância - Erro ao validar a instância - Apenas links HTTPS são suportados - A instância já existe + Insira o link da instância + Erro ao validar a instância + A instância já existe Local Recentes Mais curtidos @@ -659,7 +656,7 @@ Exibir indicadores com imagem Adicionado na próxima posição da fila Adicionar a próxima posição da fila - Deslize items para remove-los + Deslize items para remove-los Não inicia os vídeos no player reduzido, mas muda direto para o modo de tela cheia, se a rotação automática estiver travada. Você ainda consegue acessar o player reduzido saindo da tela cheia Iniciar o player principal em tela cheia Sugestões de busca remotas diff --git a/app/src/main/res/values-pt-rPT/strings.xml b/app/src/main/res/values-pt-rPT/strings.xml index aa3862b6be0..872bb6d276b 100644 --- a/app/src/main/res/values-pt-rPT/strings.xml +++ b/app/src/main/res/values-pt-rPT/strings.xml @@ -76,8 +76,7 @@ \nPara o poder ver, tem que ativar \"%1$s\" nas definições.
Ver licença Ajuda - Apenas os URL HTTPS são suportados - Falha ao validar a instância + Falha ao validar a instância Limpar histórico de descargas Remover todas as posições de reprodução\? Limitar fila de descargas @@ -181,7 +180,7 @@ Ativar reprodutor em segundo plano Desafio reCAPTCHA solicitado Reprodução automática - Instância já existe + Instância já existe NewPipe é desenvolvido por voluntários que utilizam o seu tempo livre para nos proporcionar a melhor experiência. Retribua para ajudar os programadores a tornarem NewPipe ainda melhor. Continuar (sem repetição) a fila de reprodução anexando um vídeo relacionado Sempre @@ -301,7 +300,7 @@ Instâncias PeerTube Reprodutor Depuração - Digite o URL da instância + Digite o URL da instância Ação de \'Abrir\' preferida Vídeo e áudio Letras e dígitos @@ -389,7 +388,6 @@ Participar Segundo plano [Desconhecido] - Encontre as instâncias que gosta em %s Selecione um \"kiosk\" Canais Tentativas máximas @@ -528,7 +526,6 @@ Ação recusada pelo sistema Músicas O idioma será alterado assim que reiniciar a app - Adicionar instância Faixas Reproduzir no Kodi Armazenamento externo indisponível @@ -659,7 +656,7 @@ Descarga concluída %s descargas concluídas - Deslizar itens para removê-los + Deslizar itens para removê-los Não iniciar vídeos no reprodutor mini, mas ir diretamente ao ecrã completo se a rotação automática estiver bloqueada. Ainda pode aceder o reprodutor mini se sair do modo de ecrã completo Iniciar reprodutor principal em ecrã completo Enfileirado o próximo diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 9563c9a6fe9..d5c3d45bb53 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -436,12 +436,9 @@ Duração da pesquisa de avanço/recuo rápido Instâncias PeerTube Defina as suas instâncias favoritas PeerTube - Encontre as instâncias que gosta em %s - Adicionar instância - Digite o URL da instância - Falha ao validar a instância - Apenas os URL HTTPS são suportados - Instância já existe + Digite o URL da instância + Falha ao validar a instância + Instância já existe Local Recentes Mais apreciados @@ -659,7 +656,7 @@ Descarga concluída %s descargas concluídas - Deslizar itens para removê-los + Deslizar itens para removê-los Não iniciar vídeos no reprodutor mini, mas ir diretamente ao ecrã completo se a rotação automática estiver bloqueada. Ainda pode aceder o reprodutor mini se sair do modo de ecrã completo Iniciar reprodutor principal em ecrã completo Enfileirado o próximo diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml index 67108b500cb..995665083ce 100644 --- a/app/src/main/res/values-ro/strings.xml +++ b/app/src/main/res/values-ro/strings.xml @@ -336,12 +336,9 @@ Ștergeți toate pozițiile din playback\? Ștergeți toate pozițiile de redare Videoclipuri - Instanța există deja - Sunt acceptate numai URL-urile HTTPS - Nu s-a putut valida instanța - Introduceți URL-ul instanței - Adăugați o instanță - Găsiți instanțele care vă plac pe %s + Instanța există deja + Nu s-a putut valida instanța + Introduceți URL-ul instanței Selectați instanțele PeerTube preferate Instanțe PeerTube Durată derulare rapidă înainte/înapoi @@ -662,7 +659,7 @@ %s de descărcări finalizate Dezactivați tunelarea media - Glisați elementele pentru a le elimina + Glisați elementele pentru a le elimina Încă nu este setat niciun folder de descărcare, alegeți acum folderul de descărcare implicit Comentariile sunt dezactivate Nu porniți videoclipurile în mini player, ci treceți direct la modul ecran complet, dacă rotația automată este blocată. Puteți accesa în continuare mini playerul ieșind din modul fullscreen diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 2a16a45731f..9f2893197c4 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -447,12 +447,9 @@ Шаг перемотки Серверы PeerTube Выберите предпочтительные серверы - Каталог серверов: %s - Новый сервер - URL сервера - Не удалось проверить сервер - Поддерживается только HTTPS - Сервер уже существует + URL сервера + Не удалось проверить сервер + Сервер уже существует Локальное Новое Популярное @@ -681,7 +678,7 @@ %s загрузок завершено %s загрузок завершено - Удаление элементов — смахиванием + Удаление элементов — смахиванием Запускать видео во весь экран, если отключён автоповорот. Мини-плеер доступен при выходе из полноэкранного режима Начинать просмотр в полноэкранном режиме Добавлено следующим diff --git a/app/src/main/res/values-sc/strings.xml b/app/src/main/res/values-sc/strings.xml index 7c6120832b6..09d2543e3f2 100644 --- a/app/src/main/res/values-sc/strings.xml +++ b/app/src/main/res/values-sc/strings.xml @@ -441,12 +441,9 @@ Vìdeos e àudio Cumportamentu Riproduidore - S\'istàntzia esistit giai - Petzi sos URL HTTPS sunt suportados - Impossìbile cunvalidare s\'istàntzia - Inserta s\'URL de s\'istàntzia - Annanghe un\'istàntzia - Agata sas istàntzias chi t\'agradant in %s + S\'istàntzia esistit giai + Impossìbile cunvalidare s\'istàntzia + Inserta s\'URL de s\'istàntzia Ischerta sas istàntzias de PeerTube preferidas tuas Istàntzias de PeerTube Limba predefinida pro sos cuntenutos @@ -659,7 +656,7 @@ Iscarrigamentu acabadu %s iscarrigamentos acabados - Trìsina sos elementos pro los bogare + Trìsina sos elementos pro los bogare Si sa rotatzione automàtica est blocada no avies sos vìdeos in su riproduidore mini ma diretamente in sa modalidade a ischermu intreu. Podes atzèdere su matessi a su riproduidore mini essende dae s\'ischermu intreu Allughe su letore printzipale a ischermu intreu Postu in lista comente imbeniente diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index c47562bb00e..3a60541a79d 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -441,12 +441,9 @@ Dĺžka rýchleho pretáčania Inštancie PeerTube Vyberte si svoje obľúbené inštancie PeerTube - Nájdite inštancie, ktoré chcete na %s - Pridať inštanciu - Vložiť URL inštancie - Nepodarilo sa overiť inštanciu - Podporované sú iba adresy URL s HTTPS - Inštancia už existuje + Vložiť URL inštancie + Nepodarilo sa overiť inštanciu + Inštancia už existuje Miestne Nedávno pridané Najobľúbenejšie @@ -668,7 +665,7 @@ Náhľad miniatúry pri vyhľadávaní Zobraziť farebné stužky Picassa na obrázkoch podľa ich zdroja: červená pre sieť, modrá pre disk a zelená pre pamäť Zobraziť indikátory obrázka - Potiahnutím vymazať + Potiahnutím vymazať Komentáre sú zakázané Pri zamknutej auto-rotácií nespúšťať videá v mini prehrávači, ale prepnúť sa priamo do režimu celej obrazovky. Prístup k mini prehrávaču bude po ukončení režimu celej obrazovky Hlavný prehrávač na celej obrazovke diff --git a/app/src/main/res/values-sl/strings.xml b/app/src/main/res/values-sl/strings.xml index a0314b710e3..d38913c4fb4 100644 --- a/app/src/main/res/values-sl/strings.xml +++ b/app/src/main/res/values-sl/strings.xml @@ -286,7 +286,6 @@ Seznami predvajanja Kanali Posodobitve - Samo HTTPS URL-ji so podprti Prikaži namig \"drži za dodajanje\" Počisti podatke Pozicija v seznamih @@ -425,11 +424,9 @@ Youtube ponuja \"omejeni način\", ki skrije potencialno vsebino za odrasle Vklop YouTubovega \"omejenega načina\" Prikaz vsebin, ki so morda neprimerne za otroke zaradi omejitve starosti (kot na primer 18+) - Instanca že obstaja - Validacija instance ni bila mogoča - Vnesite URL instance - Dodaj instanco - Najdite instance, ki so vam všeč na %s + Instanca že obstaja + Validacija instance ni bila mogoča + Vnesite URL instance Izberite vaše najljubše instance PeerTuba Instance PeerTube Privzeta država vsebine diff --git a/app/src/main/res/values-so/strings.xml b/app/src/main/res/values-so/strings.xml index f8be2c8a5cf..e1f3be6268b 100644 --- a/app/src/main/res/values-so/strings.xml +++ b/app/src/main/res/values-so/strings.xml @@ -367,12 +367,9 @@ Muuqaalada & Dhagaysiga Daareha Dabeecada - Qaybtan horay ayay ujirtay - Kaliya waxaa la taageeraa tixraacyada HTTPS-ka ah - Lama ansixin karo qaybtan - Gali tixraaca qaybta - Ku dar qayb - Ka hel qaybaha aad jeceshahay %s + Qaybtan horay ayay ujirtay + Lama ansixin karo qaybtan + Gali tixraaca qaybta Dooro qaybaha aad jeceshahay ee PeerTube-ka Qaybaha PeerTube Luuqada muuqaalka/dhagaysiga diff --git a/app/src/main/res/values-sq/strings.xml b/app/src/main/res/values-sq/strings.xml index c5b016dd498..48111af8d4c 100644 --- a/app/src/main/res/values-sq/strings.xml +++ b/app/src/main/res/values-sq/strings.xml @@ -461,12 +461,9 @@ Duke luajtur në sfond Përditësimet Rregullo - Instanca ekziston tashmë - Vetëm URL-të HTTPS janë të mbështetura - Nuk arriti të vërtetësohej instanca - Vendosni URL e instancës - Shtoni instancë - Gjeni instancat që ju pëlqeni në %s + Instanca ekziston tashmë + Nuk arriti të vërtetësohej instanca + Vendosni URL e instancës Zgjidhni instancat tuaja të preferuara të PeerTube Instancat PeerTube Shteti i parazgjedhur i përmbajtjes diff --git a/app/src/main/res/values-sr/strings.xml b/app/src/main/res/values-sr/strings.xml index 3b170795bc3..c4b0c539f4a 100644 --- a/app/src/main/res/values-sr/strings.xml +++ b/app/src/main/res/values-sr/strings.xml @@ -485,12 +485,9 @@ Укључити Јутјубов „Ограничени режим“ Приказ садржаја који можда није прикладан за децу јер има старосну границу (попут 18+) Ажурирања - Инстанца већ постоји - Подржане су само HTTPS УРЛ адресе - Не могу да потврдим инстанцу - Унесите УРЛ инстанце - Додајте инстанцу - Пронађите инстанце које вам се свиђају на %s + Инстанца већ постоји + Не могу да потврдим инстанцу + Унесите УРЛ инстанце PeerTube инстанца Изаберите своје омиљене инстанце PeerTube УРЛ није препознат. Отворити другом апликацијом\? diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index b7e66a85baa..0497ba2d946 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -392,12 +392,9 @@ Ta bort uppspelningspositioner PeerTube-instanser Välj dina favoritpeertube-instanser - Hitta de instanser du gillar på %s - Lägg till instans - Ange instansens URL - Det gick inte att validera instansen - Endast HTTPS-URL:er stöds - Instansen finns redan + Ange instansens URL + Det gick inte att validera instansen + Instansen finns redan Videor Hjälp Ta bort alla uppspelningspositioner\? @@ -661,7 +658,7 @@ Starta huvudspelaren i helskärmsläge Bearbetar… Kan ta en stund Senaste - Svep objekt för att ta bort dem + Svep objekt för att ta bort dem Förslag via fjärrsökning Starta inte videor i minispelaren, utan byt till helskärmsläge direkt, om auto-rotation är låst. Du kan fortfarande komma åt minispelaren genom att gå ut ur helskärmsläge Visa Picasso färgade band ovanpå bilderna som anger deras källa: rött för nätverk, blått för disk och grönt för minne diff --git a/app/src/main/res/values-ta/strings.xml b/app/src/main/res/values-ta/strings.xml index 827da452a6f..3d953c7d6ef 100644 --- a/app/src/main/res/values-ta/strings.xml +++ b/app/src/main/res/values-ta/strings.xml @@ -235,7 +235,7 @@ உறவுடைய உருப்படிகள் reCAPTCHAஐ தீர்க்கையில் NewPipe சேமிக்கும் நினைவிகளைத் துடை முதன்மை இயக்கியை முழுதிரையில் துவக்கு - நிகழ்வை செல்லுபடுயாக்க முடியவில்லை + நிகழ்வை செல்லுபடுயாக்க முடியவில்லை எல்லா இயக்கக குறியிடங்களையும் அழிக்கும் எல்லா இயக்கக குறியிடங்களையும் அழிக்கவா\? இயக்கக குறியிடங்கள் அழிக்கப்பட்டன @@ -244,15 +244,12 @@ உதவி கலைஞர்கள் காணொளிகள் - HTTPS உரலிகள் மட்டுமே ஆதரிக்கப்படுகின்றன - நிகழ்வு உரலியை உள்ளிடு - நிகழ்வைச் சேர் - உமக்குப் பிடித்த நிகழ்வை கண்டுபிடி இங்கு %s + நிகழ்வு உரலியை உள்ளிடு உம் அபிமான பியர்டியூப் நிகழ்வுகளைத் தேர்ந்தெடு உள்ளடக்க இயல்பிருப்பு மொழி இயக்குதலைத் மறுதொடர் நி - நிகழ்வு ஏற்கனவே உள்ளது + நிகழ்வு ஏற்கனவே உள்ளது யூடியூபின் \"கட்டுப்பாடு பயன்முறை\"ஐ இயக்கு பாடல்கள் பிழைகளைப் புகாரளிக்க அறிவிப்புகள் @@ -315,7 +312,7 @@ முகப்புப்பக்க உள்ளடக்கம் உம் அபிமான இருண்ட தோற்றத்தைக் கீழே தேர்ந்தெடுக்கலாம் இப்பதிவிறக்கத்தை மீட்டெடுக்க முடியவில்லை - உருப்படிகளை அகற்ற அவற்றைத் தேய் + உருப்படிகளை அகற்ற அவற்றைத் தேய் பிழை அறிவிப்பைப் படை NewPipe புதுப்பிப்பு கிடைக்கிறது! அருகலையில் மட்டும் diff --git a/app/src/main/res/values-te/strings.xml b/app/src/main/res/values-te/strings.xml index 3958e02b005..c4a8d09b203 100644 --- a/app/src/main/res/values-te/strings.xml +++ b/app/src/main/res/values-te/strings.xml @@ -168,7 +168,6 @@ సూక్ష్మచిత్రాలను లోడ్ చేయండి వ్యాఖ్యలను చూపించు వ్యాఖ్యలను దాచడాన్ని ఆఫ్ చేయండి - %sలో మీకు నచ్చిన సందర్భాలను కనుగొనండి పీర్‌ట్యూబ్ ఉదాహరణలు మూడవ చర్య బటన్ థంబ్‌నెయిల్‌లను లోడ్ చేయడం, డేటాను సేవ్ చేయడం మరియు మెమరీ వినియోగాన్ని నిరోధించడానికి ఆఫ్ చేయండి. మార్పులు ఇన్-మెమరీ మరియు ఆన్-డిస్క్ ఇమేజ్ కాష్ రెండింటినీ క్లియర్ చేస్తాయి @@ -192,9 +191,7 @@ మీకు ఇష్టమైన పీర్‌ట్యూబ్ సందర్భాలను ఎంచుకోండి వీక్షించిన వీడియోలను ట్రాక్ చేయండి మినీ ప్లేయర్‌లో వీడియోలను ప్రారంభించవద్దు, ఆటో రొటేషన్ లాక్ చేయబడితే, నేరుగా పూర్తి స్క్రీన్ మోడ్‌కి మారండి. మీరు పూర్తి స్క్రీన్ నుండి నిష్క్రమించడం ద్వారా ఇప్పటికీ మినీ ప్లేయర్‌ని యాక్సెస్ చేయవచ్చు - సందర్భాన్ని జోడించండి నవీకరణలు - HTTPS URLలకు మాత్రమే మద్దతు ఉంది రెండవ చర్య బటన్ నాల్గవ చర్య బటన్ ప్లేయర్ క్రాష్ చేయండి @@ -226,9 +223,9 @@ డేటాను క్లియర్ చేయండి ప్లే చేయడం కొనసాగించండి డిఫాల్ట్ కంటెంట్ దేశం - ఉదాహరణ URLని నమోదు చేయండి - ఉదాహరణను ధృవీకరించడం సాధ్యపడలేదు - ఉదాహరణ ఇప్పటికే ఉంది + ఉదాహరణ URLని నమోదు చేయండి + ఉదాహరణను ధృవీకరించడం సాధ్యపడలేదు + ఉదాహరణ ఇప్పటికే ఉంది వినియోగదారులు ఈవెంట్స్ కొత్త NewPipe వెర్షన్ కోసం నోటిఫికేషన్‌లు @@ -325,7 +322,7 @@ లోపాలు నివేదించడానికి నోటిఫికేషన్‌లు లోపనివేదన నోటిఫికేషన్ చెరుపు - వాటిని తీసివేయడానికి వాటిని స్వైప్ చేయండి + వాటిని తీసివేయడానికి వాటిని స్వైప్ చేయండి ఈ ఫైల్‌ని ప్లే చేయడానికి యాప్ ఏదీ ఇన్‌స్టాల్ చేయబడలేదు మరింత సమాచారం మరియు వార్తల కోసం NewPipe వెబ్‌సైట్‌ని సందర్శించండి. NewPipe ప్రాజెక్ట్ మీ గోప్యతను చాలా తీవ్రంగా పరిగణిస్తుంది. కాబట్టి, మీ సమ్మతి లేకుండా యాప్ ఎలాంటి డేటాను సేకరించదు. diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 0f405f13216..82c5c9d92e4 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -436,12 +436,9 @@ Hızlı ileri/geri konumlama süresi PeerTube örnekleri Favori PeerTube örneklerinizi seçin - %s adresinde beğendiğiniz örnekleri bulun - Örnek ekle - Örnek URL\'sini girin - Örnek doğrulanamadı - Yalnızca HTTPS URL\'leri desteklenmektedir - Örnek zaten var + Örnek URL\'sini girin + Örnek doğrulanamadı + Örnek zaten var Yerel Son eklenen En çok beğenilen @@ -659,7 +656,7 @@ İndirme tamamlandı %s indirme tamamlandı - Ögeleri kaldırmak için kaydır + Ögeleri kaldırmak için kaydır Videoları küçük oynatıcıda başlatma, kendiliğinden döndürme kilitliyse doğrudan tam ekran kipine geç. Tam ekrandan çıkarak küçük oynatıcıya erişmeye devam edebilirsiniz Ana oynatıcıyı tam ekranda başlat Sonrakini sıraya ekle diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index 0768f241b44..a728617cc7c 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -441,11 +441,8 @@ Швидке перемотування Екземпляри PeerTube Виберіть сервер PeerTube - Каталог серверів: %s - Додати екземпляр - Введіть URL екземпляра - Підтримуються лише HTTPS-посилання - Екземпляр уже існує + Введіть URL екземпляра + Екземпляр уже існує Недавно додані Найвподобаніші відновлення @@ -487,7 +484,7 @@ Локальне Допомога Відео - Не вдалося перевірити сервер + Не вдалося перевірити сервер NewPipe ще не підтримує цей вміст. \n \nМожливо, підтримка з\'явиться в наступних версіях. @@ -675,7 +672,7 @@ %s завантажень завершено %s завантажень завершено - Проведіть пальцем по елементах, щоб вилучити їх + Проведіть пальцем по елементах, щоб вилучити їх Не запускати відео в мініпрогравачі, а перемикати в повноекранний режим безпосередньо, якщо автообертання заблоковано. Ви все одно можете отримати доступ до мініпрогравача, вийшовши з повноекранного режиму Запустити основний програвач у повноекранному режимі Заплановано наступним diff --git a/app/src/main/res/values-ur/strings.xml b/app/src/main/res/values-ur/strings.xml index b58f0946dae..6e541487cc6 100644 --- a/app/src/main/res/values-ur/strings.xml +++ b/app/src/main/res/values-ur/strings.xml @@ -431,12 +431,9 @@ آگے بھگانے /- پیچھے کرنے کی مدت پیر ٹیوب واقعات اپنے پسندیدہ پیر ٹیوب کی مثالیں منتخب کریں - ایسی مثالوں کی تلاش کریں جو آپ %s پر پسند کرتے ہیں - مثال شامل کریں - مثال کا URL درج کریں - مثال کی توثیق نہیں کی جا سکی - صرف HTTPS URLs موافق ہیں - مثال پہلے سے موجود ہے + مثال کا URL درج کریں + مثال کی توثیق نہیں کی جا سکی + مثال پہلے سے موجود ہے مقامی حال ہی میں شامل زیادہ پسندیدہ diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml index 08bf7cae08b..c1eaa4e89d5 100644 --- a/app/src/main/res/values-vi/strings.xml +++ b/app/src/main/res/values-vi/strings.xml @@ -417,11 +417,9 @@ Xác nhận xóa toàn bộ vị trí phát\? Nhóm kênh Chọn thực thể - Thực thể đã tồn tại - Không thể xác nhận thực thể - Nhập URL thực thể - Thêm thực thể - Tìm thực thể bạn thích trên %s + Thực thể đã tồn tại + Không thể xác nhận thực thể + Nhập URL thực thể %d ngày @@ -472,8 +470,7 @@ Video này bị giới hạn độ tuổi. \n \nBật \"%1$s\" trong cài đặt nếu bạn muốn xem video này. - Bật chế độ hạn chế Youtube - Chỉ URL HTTPS được hỗ trợ + hế độ giới hạn YouTube Chọn thực thể PeerTube ưa thích Thực thể PeerTube Thời lượng tua video @@ -647,7 +644,7 @@ %s lượt tải xuống đã hoàn tất - Vuốt các mục để xóa chúng + Vuốt các mục để xóa chúng Không bắt đầu video ở trình phát mini, mà chuyển trực tiếp thành chế độ toàn màn hình, nếu tự động xoay bị khóa. Bạn vẫn có thể truy cập trình phát mini bằng cách thoát khỏi toàn màn hình Khởi động trình phát chính ở toàn màn hình Đã cho mục tiếp vào hàng đợi diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 6794d6bbdd2..827c8231b74 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -425,12 +425,9 @@ 重新启动应用后,语言将更改。 PeerTube 服务器 设置自己喜欢的PeerTube服务器 - 查找最适合你的服务器%s - 添加服务器 - 输入服务器网址(URL) - 无法验证服务器 - 仅支持 HTTPS和URL - 该服务器已存在 + 输入服务器网址(URL) + 无法验证服务器 + 该服务器已存在 本地 最近添加 最喜欢的 diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 277fa693716..808a7f9412a 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -178,7 +178,7 @@ 內容預設國家 演出者 專輯 - 淨係支援 HTTPS 嘅 URL + 除錯 復原 刪除咗個檔案 @@ -334,7 +334,7 @@ 最常播放 頭版內容 頭版要擺放邊啲分頁 - 打橫掃走啲項目去剷走佢 + 打橫掃走啲項目去剷走佢 空白頁 重新開過個 app 之後就會轉新語言 時興 @@ -412,7 +412,6 @@ 自動輪候接續落串流 排隊播要完嘅時候 (又未設定循環播放) 就追加一條咁上下嘅串流 PeerTube 站 - 去 %s 發掘啱您心水嘅站 播放清單 問題報告通知 報告問題嘅通知 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 8b5a246611d..7f3357c1e66 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -431,12 +431,9 @@ 快轉/快退搜尋持續時間 PeerTube 站臺 選取您最愛的 PeerTube 站臺 - 在 %s 上找到您喜愛的站臺 - 新增站臺 - 輸入站臺 URL - 無法驗證站臺 - 僅支援 HTTPS URL - 站臺已存在 + 輸入站臺 URL + 無法驗證站臺 + 站臺已存在 本機 最近新增 最喜歡 @@ -647,7 +644,7 @@ %s 下載已完成 - 滑動項目即可移除 + 滑動項目以刪除它們 如果自動旋轉被鎖定,請不要在迷你播放器中啟動影片,而是直接切換到全螢幕模式。您仍然可以透過結束全螢幕存取迷你播放器 以全螢幕開始主播放器 已將下一個加入佇列 diff --git a/app/src/main/res/values/donottranslate.xml b/app/src/main/res/values/donottranslate.xml index c3cc487261d..f3e3ef0eba2 100644 --- a/app/src/main/res/values/donottranslate.xml +++ b/app/src/main/res/values/donottranslate.xml @@ -4,6 +4,7 @@ RSS org.xbmc.kore https://joinpeertube.org/instances#instances-list + https://docs.invidious.io/instances/ newpipe newpipeAppUpdate newpipeHash diff --git a/app/src/main/res/values/settings_keys.xml b/app/src/main/res/values/settings_keys.xml index bf42aaf0e51..cc437eee801 100644 --- a/app/src/main/res/values/settings_keys.xml +++ b/app/src/main/res/values/settings_keys.xml @@ -269,6 +269,9 @@ peertube_instance_setup peertube_selected_instance peertube_instance_list + yt_like_instance_setup + yt_like_instance_selected_instance + yt_like_instance_list content_country show_age_restricted_content youtube_restricted_mode_enabled diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 80f79cfdd97..33b175578a3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -130,12 +130,14 @@ Default content language PeerTube instances Select your favorite PeerTube instances - Find the instances you like on %s - Add instance - Enter instance URL - Could not validate instance - Only HTTPS URLs are supported - Instance already exists + YouTube-Like instances + Manage YouTube-Like instances + A list of publicly available instances can be found on %s + Add %s instance + Enter instance URL + Could not validate instance + Instance already exists + Communication via HTTP is insecure. Consider using HTTPS instead Player Behavior Video and audio @@ -374,7 +376,7 @@ Content of main page What tabs are shown on the main page - Swipe items to remove them + Swipe items to remove them Blank Page Kiosk Page Default Kiosk diff --git a/app/src/main/res/xml/content_settings.xml b/app/src/main/res/xml/content_settings.xml index e754b3a3001..30c4d730513 100644 --- a/app/src/main/res/xml/content_settings.xml +++ b/app/src/main/res/xml/content_settings.xml @@ -42,7 +42,15 @@ app:iconSpaceReserved="false" /> + + Date: Sun, 20 Mar 2022 17:21:55 +0100 Subject: [PATCH 03/18] Converted placeholders to svg * Required for SubscriptionFragment (otherwise the PopUp-menu uses half of the screen) * Size reduction * Fixed/Improved some images: * Bandcamp: Was facing in the wrong direction and used an incorrect logo * Media CCC: Update logo * YT: Added NewPipe logo so that it's not just a rectangle --- .../newpipe/util/services/ServiceHelper.java | 12 ++++++------ .../res/drawable-nodpi/place_holder_bandcamp.png | Bin 2677 -> 0 bytes .../res/drawable-nodpi/place_holder_circle.png | Bin 5323 -> 0 bytes .../res/drawable-nodpi/place_holder_cloud.png | Bin 3660 -> 0 bytes .../res/drawable-nodpi/place_holder_gadse.png | Bin 8827 -> 0 bytes .../res/drawable-nodpi/place_holder_peertube.png | Bin 8340 -> 0 bytes .../res/drawable-nodpi/place_holder_youtube.png | Bin 1744 -> 0 bytes .../res/drawable/ic_placeholder_bandcamp.xml | 10 ++++++++++ .../main/res/drawable/ic_placeholder_circle.xml | 10 ++++++++++ .../main/res/drawable/ic_placeholder_cloud.xml | 10 ++++++++++ .../res/drawable/ic_placeholder_media_ccc.xml | 10 ++++++++++ .../res/drawable/ic_placeholder_peertube.xml | 9 +++++++++ app/src/main/res/drawable/ic_placeholder_yt.xml | 10 ++++++++++ app/src/main/res/layout/drawer_header.xml | 2 +- app/src/main/res/layout/item_instance.xml | 2 +- 15 files changed, 67 insertions(+), 8 deletions(-) delete mode 100644 app/src/main/res/drawable-nodpi/place_holder_bandcamp.png delete mode 100644 app/src/main/res/drawable-nodpi/place_holder_circle.png delete mode 100644 app/src/main/res/drawable-nodpi/place_holder_cloud.png delete mode 100644 app/src/main/res/drawable-nodpi/place_holder_gadse.png delete mode 100644 app/src/main/res/drawable-nodpi/place_holder_peertube.png delete mode 100644 app/src/main/res/drawable-nodpi/place_holder_youtube.png create mode 100644 app/src/main/res/drawable/ic_placeholder_bandcamp.xml create mode 100644 app/src/main/res/drawable/ic_placeholder_circle.xml create mode 100644 app/src/main/res/drawable/ic_placeholder_cloud.xml create mode 100644 app/src/main/res/drawable/ic_placeholder_media_ccc.xml create mode 100644 app/src/main/res/drawable/ic_placeholder_peertube.xml create mode 100644 app/src/main/res/drawable/ic_placeholder_yt.xml diff --git a/app/src/main/java/org/schabi/newpipe/util/services/ServiceHelper.java b/app/src/main/java/org/schabi/newpipe/util/services/ServiceHelper.java index 20be1b81350..382be581231 100644 --- a/app/src/main/java/org/schabi/newpipe/util/services/ServiceHelper.java +++ b/app/src/main/java/org/schabi/newpipe/util/services/ServiceHelper.java @@ -31,17 +31,17 @@ private ServiceHelper() { } public static int getIcon(final int serviceId) { switch (serviceId) { case 0: - return R.drawable.place_holder_youtube; + return R.drawable.ic_placeholder_yt; case 1: - return R.drawable.place_holder_cloud; + return R.drawable.ic_placeholder_cloud; case 2: - return R.drawable.place_holder_gadse; + return R.drawable.ic_placeholder_media_ccc; case 3: - return R.drawable.place_holder_peertube; + return R.drawable.ic_placeholder_peertube; case 4: - return R.drawable.place_holder_bandcamp; + return R.drawable.ic_placeholder_bandcamp; default: - return R.drawable.place_holder_circle; + return R.drawable.ic_placeholder_circle; } } diff --git a/app/src/main/res/drawable-nodpi/place_holder_bandcamp.png b/app/src/main/res/drawable-nodpi/place_holder_bandcamp.png deleted file mode 100644 index 13c44b64900320ad5b6986e89095999c97738075..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2677 zcmb`Je^8p|0moglUD6o!E2q5T0dCvXspE1_@g|V61ENBMuH}H&PTE{wnrc zyTMQ*&nDDbA0j2O_@g|FKlK`Oz=9=?+&;y9O7sNL3QzPMFy0XfC1=a$M~I4!Ln`)F zF-8=@o|jODg-(g#etw}%xc?e!#`*^dW%)1^+?DNBs7O%+98$^3c7veAVxAy#We8Ug zp%Br{6V%L@xw%^dsH$9OZNrf)h2KePVbz3AW`)U4Or_)LF)CO>h%{FI(~YIfPv8pD zhQTkj3;b6&e|BR>GVnKMS^7_h%v!s8K#r5by<6`=YeRNYWN*yEXQamoDmYsvVv1X} z|1JX`lB9wI*>urp=wct;Os3vEGGO_W zzUem3xLNBFd(o!jlRCafyTC`0qd;&k+6_BtxW`$nZqKjc3DO48GZw^7T5e};zlQD) zq;{o9pcAmkBjI0sbaBt!S~BlF5}Vm z&y1B1fCAiAtfsLNRj|$*yhocA<#KaPtA={7!W+iTy8Ag{vgqU-{PHOkd~B->S_6jT ziZZ>)fx@y~{d*+>&}QLp=m6SqYm;4FBukLOAzP);+HHWg^VeRqXH+m>9;5rZMW=5{ zNHT5~`HSi1V7t0mcAh4BFJp9oEw`ZT>P!77 z0&eCOI-r+s{=1=_>42~Fqm((&E>~}I@(Z569{Vv#?5!z!FI$kYJp(9ZMy~!d4%=WS^@>^Bq5FZoVXmo>3fimQ#u+Qu-PrxsWV?DAOih`~j43xi z0k%#&3tq_+bo8UA=6k(peeG)N_h_@BwU7UU7F2Ou4uZFY{9+`|tqCJ43gk=3N$u7Jo2M(>Pby2R19K~ELSIW8QX-fHzD$lo zx(UWQ64o4G-0j-eNUut>c|I?Bl~(xPouiNn%>9jP6>+{z9LZ0zUT4O0rX`feoum)S zX_2Sh8egI!nK2?c+wS@VaSl?C&R63n&aH3Um{^oS4JdDt-v^A?x5~Idk~zS-Q$S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cgh>DPCrg4?RL< zxOy#5a>+85`v$Qb459&Yy_Y zl`L|d6UR~_U>-_0p%Td`UtZ4Mb8(nPe=ZJFQZDw=pkIJolJid1tPD#Lm6hrlan{bi zA~69Ta-8wg;d%zpk=((%vh)KNsE}7LWF+*I%Nql2_>UU?r{Dbi%T$OcFtYsRF6Rb6FHvHou=6fk z7nG6wM-Ag~bC~i)@!W>+Pb$nmg&RG7N5?8IuYWv7IK7Y{oZ*J9uN$VzKBy< zfuu4`XlZQ;;FO6Q+JwJmzVBtqHDKj)&)%7cUR@ab~AS=}|AB&G6M^a+` zl$bmFW$x04AN$8N4vCPe$9sno^&Q#AzhpMgs%X-lwjZ24rH&@wCbX*P)LHJykVi^3 zIfLxI$qzyCWkxX}7u)09_YV6-;Cz^T?xBL)c2jmS?LXT*WD1qC8T!+f z)cNClYLY%i_y)tvBggfw@Ml{ICgllBBEyjk_CfvAetfKzy zgAEsITGD*B)>fv=gZ`w#&Ckle{+i3RX+hZ+cXCUnFi9Ji`~7~@y6t;I=A8HIOP{f= z&x~+iwaEAx#2}l8>ZAQp^~l${=T7%CTP2ywsMnNT(FMqu*Ei0bcZw>mRn|1lG}k*X zYgfpsY&tVw1WYr;xh%%$#%g#br;m^v-TH6tRla+`r0YQNP@AllKHp?LEs)JHFyZ~e ec)rv7A0vV_mp60>`oP^k2m0DZS{0g@uzvuz$wrj` diff --git a/app/src/main/res/drawable-nodpi/place_holder_cloud.png b/app/src/main/res/drawable-nodpi/place_holder_cloud.png deleted file mode 100644 index c4ba2a6f4c94fa8bcb7adbaf6202c41b53096192..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3660 zcmcIni93|t`}ek363RLl!b}*M?E6;6@I0fTd783hSN2_-vaiiB%#4w>1rOod9xC}- zvJIt|Nuf6{SsNjysbu}?fB60G>pIuxKKFI*bMM!=4&|higV;WWeF6dkVjy4#2?*@k zVRs1#@7V#bXk_%CU92rg78X9eVE;!b5(T)$3jAgM^UwOr{IQG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}d)Jk~ReBixkL}(4T-z{7}YZJ{?WtB9r9@NgJK$g4%(Mnq#eHLj;nws>MqP8=ABc zPKIVx>aBD<)?7BMDNg12v`P_5!Re}$tU{ao!?&Q=1JI#J|I>tEwYLNhsIwendAT&z zvnD}8dX+xIFa#hBJ``F5G)Ae%ZI!<{B0_Ic8qp8430SVG#DhkI`Q_O7nfns5`e3bg z`ntkdi8dEDAc3d4%eR^Wa+C=kkuR4)!{ye-#7l=1zk~mzl^E(Sj~1`w0VN>^62)^x zByX>$4i~y5%|_&l$MKS$h`63<@DvN1jsafsd`C;?OW8;+r@4T=R5g9w5KO%|t_MAN zd+(_OZzP*CQ-^}>f5=p*B&|szI)bf=TjtilaK3*Jj*#kN*oUE_if!GJ)*8S^mEIT{ zx0lj|nv7}{kRA4s&bO8Vgg{9Lf^n%9cp0 z{eKYMHAxL0D%>?i2QzBcEI8lQ5f2|a-noPtC+VKeORoX0T9p6P&l|K;3vZ}>+m7Qr);7{= I)^vdV4{t6qfdBvi diff --git a/app/src/main/res/drawable-nodpi/place_holder_peertube.png b/app/src/main/res/drawable-nodpi/place_holder_peertube.png deleted file mode 100644 index 81dfdb8cc116df86618571e1391492ab6b6b070b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8340 zcma)ic{r8Z7ymv^C}X$DJaikBE)f|sbnBXFASAOgM97>BrxXo_Zps+WEmLOKkWLvQ zluY3uT^WmWN~l8;`K|rx`~3d;JK=xl z@aOxXC*cT5Zr4A2&@5=+(|-~F%3j#e`1)z(fJ)BKlS5)}E6@Gkzvk^meTIHTn`bXZ zi4Ble1t9c?<^P`kA3s}7J=Y;>;)U_Q@}9IO>$0OxXJq|o(PgfNc{{(gkc331IqNF& z!zKE>@^Z|ic+qf>7W#Q&`H9t{fq&Uqz$e2|*JYQlY&LPS?Q1qdRy>rf40Ha6ItZPE zH&S`|h5G_^xRE{jW4Scg!GF<}jDTg@EHGIiE_w^9LzauWbLq^{{0r}dWe|l_!urV6 z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/ic_placeholder_circle.xml b/app/src/main/res/drawable/ic_placeholder_circle.xml new file mode 100644 index 00000000000..dc0a218b8db --- /dev/null +++ b/app/src/main/res/drawable/ic_placeholder_circle.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_placeholder_cloud.xml b/app/src/main/res/drawable/ic_placeholder_cloud.xml new file mode 100644 index 00000000000..15a682b76e5 --- /dev/null +++ b/app/src/main/res/drawable/ic_placeholder_cloud.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_placeholder_media_ccc.xml b/app/src/main/res/drawable/ic_placeholder_media_ccc.xml new file mode 100644 index 00000000000..cdc743cb2de --- /dev/null +++ b/app/src/main/res/drawable/ic_placeholder_media_ccc.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_placeholder_peertube.xml b/app/src/main/res/drawable/ic_placeholder_peertube.xml new file mode 100644 index 00000000000..263d92d701d --- /dev/null +++ b/app/src/main/res/drawable/ic_placeholder_peertube.xml @@ -0,0 +1,9 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_placeholder_yt.xml b/app/src/main/res/drawable/ic_placeholder_yt.xml new file mode 100644 index 00000000000..ba8c694405d --- /dev/null +++ b/app/src/main/res/drawable/ic_placeholder_yt.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/layout/drawer_header.xml b/app/src/main/res/layout/drawer_header.xml index d2e936870d0..109c123fcf5 100644 --- a/app/src/main/res/layout/drawer_header.xml +++ b/app/src/main/res/layout/drawer_header.xml @@ -86,7 +86,7 @@ android:scaleType="fitCenter" app:tint="@color/drawer_header_font_color" tools:ignore="ContentDescription" - tools:srcCompat="@drawable/place_holder_youtube" /> + tools:srcCompat="@drawable/ic_placeholder_yt" /> + tools:src="@drawable/ic_placeholder_peertube" /> Date: Fri, 15 Apr 2022 16:24:48 +0200 Subject: [PATCH 04/18] Fixed conflicts from cherry picking --- .../serviceinstances/AbstractServiceInstanceListFragment.java | 2 +- .../peertube/PeertubeInstanceListFragment.java | 2 +- .../youtubelike/YouTubeLikeInstanceListFragment.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/AbstractServiceInstanceListFragment.java b/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/AbstractServiceInstanceListFragment.java index 2b6d4aca18e..663f6d7585f 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/AbstractServiceInstanceListFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/AbstractServiceInstanceListFragment.java @@ -331,7 +331,7 @@ protected int getIconForInstance(final I instance) { .filter(c -> c.createdClass().isInstance(instance)) .map(InstanceTypeCreator::icon) .findFirst() - .orElse(R.drawable.place_holder_circle); + .orElse(R.drawable.ic_placeholder_circle); } /*////////////////////////////////////////////////////////////////////////// diff --git a/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/peertube/PeertubeInstanceListFragment.java b/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/peertube/PeertubeInstanceListFragment.java index e6b80e1c118..f236be6a227 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/peertube/PeertubeInstanceListFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/peertube/PeertubeInstanceListFragment.java @@ -23,7 +23,7 @@ public static class PeerTubeInstanceTypeCreator public PeerTubeInstanceTypeCreator() { super( PeertubeInstance.SERVICE_NAME, - R.drawable.place_holder_peertube, + R.drawable.ic_placeholder_peertube, PeertubeInstance.class, PeertubeInstance::new, R.string.peertube_instance_list_url); diff --git a/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/youtubelike/YouTubeLikeInstanceListFragment.java b/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/youtubelike/YouTubeLikeInstanceListFragment.java index a9bccffe456..e057507ac0b 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/youtubelike/YouTubeLikeInstanceListFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/youtubelike/YouTubeLikeInstanceListFragment.java @@ -36,7 +36,7 @@ public static class YouTubeInstanceTypeCreator public YouTubeInstanceTypeCreator() { super( YoutubeInstance.SERVICE_NAME, - R.drawable.place_holder_youtube, + R.drawable.ic_placeholder_yt, YoutubeInstance.class); } @@ -63,7 +63,7 @@ public static class InvidiousInstanceTypeCreator public InvidiousInstanceTypeCreator() { super( InvidiousInstance.SERVICE_NAME, - R.drawable.place_holder_circle, // TODO + R.drawable.ic_placeholder_circle, // TODO InvidiousInstance.class, InvidiousInstance::new, R.string.invidious_instance_list_url); From 0e8d859cfc9815efe1e5f4c0fecd87383e9bc91a Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Fri, 15 Apr 2022 16:55:51 +0200 Subject: [PATCH 05/18] Added invidious icon + Show it when instance is selected --- .../main/java/org/schabi/newpipe/MainActivity.java | 14 +++++++++++--- .../YouTubeLikeInstanceListFragment.java | 2 +- .../newpipe/util/services/ServiceHelper.java | 10 ++++++++++ .../main/res/drawable/ic_placeholder_invidious.xml | 13 +++++++++++++ 4 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 app/src/main/res/drawable/ic_placeholder_invidious.xml diff --git a/app/src/main/java/org/schabi/newpipe/MainActivity.java b/app/src/main/java/org/schabi/newpipe/MainActivity.java index 26a044d1e11..b60789678fa 100644 --- a/app/src/main/java/org/schabi/newpipe/MainActivity.java +++ b/app/src/main/java/org/schabi/newpipe/MainActivity.java @@ -96,6 +96,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.OptionalInt; public class MainActivity extends AppCompatActivity { private static final String TAG = "MainActivity"; @@ -481,19 +482,26 @@ protected void onResume() { try { final int selectedServiceId = ServiceHelper.getSelectedServiceId(this); final StreamingService service = NewPipe.getService(selectedServiceId); + String selectedServiceName = service.getServiceInfo().getName(); + int icon = ServiceHelper.getIcon(selectedServiceId); + if (service instanceof InstanceBasedStreamingService) { final Instance instance = - ((InstanceBasedStreamingService) service).getInstance(); + ((InstanceBasedStreamingService) service).getInstance(); selectedServiceName = (instance.getServiceName() != null ? instance.getServiceName() + " / " : "") + instance.getName(); + + final OptionalInt overrideIcon = ServiceHelper.getOverrideIconForInstance(instance); + if (overrideIcon.isPresent()) { + icon = overrideIcon.getAsInt(); + } } drawerHeaderBinding.drawerHeaderServiceView.setText(selectedServiceName); - drawerHeaderBinding.drawerHeaderServiceIcon.setImageResource(ServiceHelper - .getIcon(selectedServiceId)); + drawerHeaderBinding.drawerHeaderServiceIcon.setImageResource(icon); drawerHeaderBinding.drawerHeaderServiceView.post(() -> drawerHeaderBinding .drawerHeaderServiceView.setSelected(true)); diff --git a/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/youtubelike/YouTubeLikeInstanceListFragment.java b/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/youtubelike/YouTubeLikeInstanceListFragment.java index e057507ac0b..844ece6b85d 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/youtubelike/YouTubeLikeInstanceListFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/youtubelike/YouTubeLikeInstanceListFragment.java @@ -63,7 +63,7 @@ public static class InvidiousInstanceTypeCreator public InvidiousInstanceTypeCreator() { super( InvidiousInstance.SERVICE_NAME, - R.drawable.ic_placeholder_circle, // TODO + R.drawable.ic_placeholder_invidious, InvidiousInstance.class, InvidiousInstance::new, R.string.invidious_instance_list_url); diff --git a/app/src/main/java/org/schabi/newpipe/util/services/ServiceHelper.java b/app/src/main/java/org/schabi/newpipe/util/services/ServiceHelper.java index 382be581231..e9dac2f8d81 100644 --- a/app/src/main/java/org/schabi/newpipe/util/services/ServiceHelper.java +++ b/app/src/main/java/org/schabi/newpipe/util/services/ServiceHelper.java @@ -18,8 +18,11 @@ import org.schabi.newpipe.extractor.ServiceList; import org.schabi.newpipe.extractor.StreamingService; import org.schabi.newpipe.extractor.exceptions.ExtractionException; +import org.schabi.newpipe.extractor.instance.Instance; import org.schabi.newpipe.extractor.services.peertube.PeertubeInstance; +import org.schabi.newpipe.extractor.services.youtube.invidious.InvidiousInstance; +import java.util.OptionalInt; import java.util.concurrent.TimeUnit; public final class ServiceHelper { @@ -45,6 +48,13 @@ public static int getIcon(final int serviceId) { } } + public static OptionalInt getOverrideIconForInstance(final Instance instance) { + if (instance instanceof InvidiousInstance) { + return OptionalInt.of(R.drawable.ic_placeholder_invidious); + } + return OptionalInt.empty(); + } + public static String getTranslatedFilterString(final String filter, final Context c) { switch (filter) { case "all": diff --git a/app/src/main/res/drawable/ic_placeholder_invidious.xml b/app/src/main/res/drawable/ic_placeholder_invidious.xml new file mode 100644 index 00000000000..9f3bbe2c759 --- /dev/null +++ b/app/src/main/res/drawable/ic_placeholder_invidious.xml @@ -0,0 +1,13 @@ + + + + + From df8a134c3d28bd37453b6dffb2e834a284f99863 Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Fri, 15 Apr 2022 16:56:00 +0200 Subject: [PATCH 06/18] Minor cleanup --- app/src/main/res/layout/fragment_instance_list.xml | 2 -- app/src/main/res/layout/item_instance.xml | 6 ++++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/res/layout/fragment_instance_list.xml b/app/src/main/res/layout/fragment_instance_list.xml index 66d84387168..80872a248b5 100644 --- a/app/src/main/res/layout/fragment_instance_list.xml +++ b/app/src/main/res/layout/fragment_instance_list.xml @@ -18,8 +18,6 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> - - - - From 7cb91217a6ad8378891127b225832ad62ccee4f2 Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Fri, 15 Apr 2022 16:57:13 +0200 Subject: [PATCH 07/18] Fixed sonar warning --- .../org/schabi/newpipe/util/services/ServiceHelper.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/util/services/ServiceHelper.java b/app/src/main/java/org/schabi/newpipe/util/services/ServiceHelper.java index e9dac2f8d81..33e57522b5e 100644 --- a/app/src/main/java/org/schabi/newpipe/util/services/ServiceHelper.java +++ b/app/src/main/java/org/schabi/newpipe/util/services/ServiceHelper.java @@ -114,12 +114,10 @@ public static int getImportInstructions(final int serviceId) { */ @StringRes public static int getImportInstructionsHint(final int serviceId) { - switch (serviceId) { - case 1: - return R.string.import_soundcloud_instructions_hint; - default: - return -1; + if (serviceId == 1) { + return R.string.import_soundcloud_instructions_hint; } + return -1; } public static int getSelectedServiceId(final Context context) { From 8bb07d7afc3dafa8d89d91d4d9189a0b959c33d4 Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Fri, 15 Apr 2022 17:20:20 +0200 Subject: [PATCH 08/18] Moved service-settings into own fragment --- .../settings/ContentSettingsFragment.java | 18 ------ .../settings/SettingsResourceRegistry.java | 2 + .../services/ServicesSettingsFragment.java | 38 +++++++++++++ .../AbstractInstanceTypeCreator.java | 2 +- .../AbstractServiceInstanceListFragment.java | 2 +- .../instances}/InstanceTypeCreator.java | 2 +- .../UrlMultiInstanceTypeCreator.java | 2 +- .../PeertubeInstanceListFragment.java | 6 +- .../YouTubeLikeInstanceListFragment.java | 8 +-- app/src/main/res/values/donottranslate.xml | 1 + app/src/main/res/values/settings_keys.xml | 19 ++++--- app/src/main/res/xml/content_settings.xml | 30 +--------- app/src/main/res/xml/services_settings.xml | 56 +++++++++++++++++++ 13 files changed, 121 insertions(+), 65 deletions(-) create mode 100644 app/src/main/java/org/schabi/newpipe/settings/services/ServicesSettingsFragment.java rename app/src/main/java/org/schabi/newpipe/settings/{serviceinstances => services/instances}/AbstractInstanceTypeCreator.java (94%) rename app/src/main/java/org/schabi/newpipe/settings/{serviceinstances => services/instances}/AbstractServiceInstanceListFragment.java (99%) rename app/src/main/java/org/schabi/newpipe/settings/{serviceinstances => services/instances}/InstanceTypeCreator.java (96%) rename app/src/main/java/org/schabi/newpipe/settings/{serviceinstances => services/instances}/UrlMultiInstanceTypeCreator.java (98%) rename app/src/main/java/org/schabi/newpipe/settings/{serviceinstances => services/instances}/peertube/PeertubeInstanceListFragment.java (80%) rename app/src/main/java/org/schabi/newpipe/settings/{serviceinstances => services/instances}/youtubelike/YouTubeLikeInstanceListFragment.java (88%) create mode 100644 app/src/main/res/xml/services_settings.xml 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 47458ad3fcd..9f058ed3586 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java @@ -4,7 +4,6 @@ import static org.schabi.newpipe.util.Localization.assureCorrectAppLanguage; import android.app.Activity; -import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.net.Uri; @@ -20,7 +19,6 @@ import androidx.preference.Preference; import androidx.preference.PreferenceManager; -import org.schabi.newpipe.DownloaderImpl; import org.schabi.newpipe.NewPipeDatabase; import org.schabi.newpipe.R; import org.schabi.newpipe.error.ErrorUtil; @@ -49,7 +47,6 @@ public class ContentSettingsFragment extends BasePreferenceFragment { private ContentSettingsManager manager; private String importExportDataPathKey; - private String youtubeRestrictedModeEnabledKey; private Localization initialSelectedLocalization; private ContentCountry initialSelectedContentCountry; @@ -67,7 +64,6 @@ public void onCreatePreferences(final Bundle savedInstanceState, final String ro manager.deleteSettingsFile(); importExportDataPathKey = getString(R.string.import_export_data_path); - youtubeRestrictedModeEnabledKey = getString(R.string.youtube_restricted_mode_enabled); addPreferencesFromResourceRegistry(); @@ -119,20 +115,6 @@ ZIP_MIME_TYPE, getImportExportDataUri()), }); } - @Override - public boolean onPreferenceTreeClick(final Preference preference) { - if (preference.getKey().equals(youtubeRestrictedModeEnabledKey)) { - final Context context = getContext(); - if (context != null) { - DownloaderImpl.getInstance().updateYoutubeRestrictedModeCookies(context); - } else { - Log.w(TAG, "onPreferenceTreeClick: null context"); - } - } - - return super.onPreferenceTreeClick(preference); - } - @Override public void onDestroy() { super.onDestroy(); diff --git a/app/src/main/java/org/schabi/newpipe/settings/SettingsResourceRegistry.java b/app/src/main/java/org/schabi/newpipe/settings/SettingsResourceRegistry.java index 78ddb37866d..05cc311cacf 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/SettingsResourceRegistry.java +++ b/app/src/main/java/org/schabi/newpipe/settings/SettingsResourceRegistry.java @@ -5,6 +5,7 @@ import androidx.fragment.app.Fragment; import org.schabi.newpipe.R; +import org.schabi.newpipe.settings.services.ServicesSettingsFragment; import java.util.HashSet; import java.util.Objects; @@ -33,6 +34,7 @@ private SettingsResourceRegistry() { add(AppearanceSettingsFragment.class, R.xml.appearance_settings); add(ContentSettingsFragment.class, R.xml.content_settings); + add(ServicesSettingsFragment.class, R.xml.services_settings); add(DebugSettingsFragment.class, R.xml.debug_settings).setSearchable(false); add(DownloadSettingsFragment.class, R.xml.download_settings); add(HistorySettingsFragment.class, R.xml.history_settings); diff --git a/app/src/main/java/org/schabi/newpipe/settings/services/ServicesSettingsFragment.java b/app/src/main/java/org/schabi/newpipe/settings/services/ServicesSettingsFragment.java new file mode 100644 index 00000000000..44eb052cf8b --- /dev/null +++ b/app/src/main/java/org/schabi/newpipe/settings/services/ServicesSettingsFragment.java @@ -0,0 +1,38 @@ +package org.schabi.newpipe.settings.services; + +import android.content.Context; +import android.os.Bundle; +import android.util.Log; + +import androidx.preference.Preference; + +import org.schabi.newpipe.DownloaderImpl; +import org.schabi.newpipe.R; +import org.schabi.newpipe.settings.BasePreferenceFragment; + +public class ServicesSettingsFragment extends BasePreferenceFragment { + + private String youtubeRestrictedModeEnabledKey; + + @Override + public void onCreatePreferences(final Bundle savedInstanceState, final String rootKey) { + youtubeRestrictedModeEnabledKey = getString(R.string.youtube_restricted_mode_enabled); + + addPreferencesFromResourceRegistry(); + } + + @Override + public boolean onPreferenceTreeClick(final Preference preference) { + if (preference.getKey().equals(youtubeRestrictedModeEnabledKey)) { + final Context context = getContext(); + if (context != null) { + DownloaderImpl.getInstance().updateYoutubeRestrictedModeCookies(context); + } else { + Log.w(TAG, "onPreferenceTreeClick: null context"); + } + } + + return super.onPreferenceTreeClick(preference); + } + +} diff --git a/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/AbstractInstanceTypeCreator.java b/app/src/main/java/org/schabi/newpipe/settings/services/instances/AbstractInstanceTypeCreator.java similarity index 94% rename from app/src/main/java/org/schabi/newpipe/settings/serviceinstances/AbstractInstanceTypeCreator.java rename to app/src/main/java/org/schabi/newpipe/settings/services/instances/AbstractInstanceTypeCreator.java index 0833ddcce94..1f558b0b2c4 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/AbstractInstanceTypeCreator.java +++ b/app/src/main/java/org/schabi/newpipe/settings/services/instances/AbstractInstanceTypeCreator.java @@ -1,4 +1,4 @@ -package org.schabi.newpipe.settings.serviceinstances; +package org.schabi.newpipe.settings.services.instances; import androidx.annotation.DrawableRes; diff --git a/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/AbstractServiceInstanceListFragment.java b/app/src/main/java/org/schabi/newpipe/settings/services/instances/AbstractServiceInstanceListFragment.java similarity index 99% rename from app/src/main/java/org/schabi/newpipe/settings/serviceinstances/AbstractServiceInstanceListFragment.java rename to app/src/main/java/org/schabi/newpipe/settings/services/instances/AbstractServiceInstanceListFragment.java index 663f6d7585f..20eb522d13e 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/AbstractServiceInstanceListFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/services/instances/AbstractServiceInstanceListFragment.java @@ -1,4 +1,4 @@ -package org.schabi.newpipe.settings.serviceinstances; +package org.schabi.newpipe.settings.services.instances; import android.annotation.SuppressLint; import android.os.Bundle; diff --git a/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/InstanceTypeCreator.java b/app/src/main/java/org/schabi/newpipe/settings/services/instances/InstanceTypeCreator.java similarity index 96% rename from app/src/main/java/org/schabi/newpipe/settings/serviceinstances/InstanceTypeCreator.java rename to app/src/main/java/org/schabi/newpipe/settings/services/instances/InstanceTypeCreator.java index 2b61ea86f43..f1a3b6a206d 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/InstanceTypeCreator.java +++ b/app/src/main/java/org/schabi/newpipe/settings/services/instances/InstanceTypeCreator.java @@ -1,4 +1,4 @@ -package org.schabi.newpipe.settings.serviceinstances; +package org.schabi.newpipe.settings.services.instances; import android.content.Context; diff --git a/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/UrlMultiInstanceTypeCreator.java b/app/src/main/java/org/schabi/newpipe/settings/services/instances/UrlMultiInstanceTypeCreator.java similarity index 98% rename from app/src/main/java/org/schabi/newpipe/settings/serviceinstances/UrlMultiInstanceTypeCreator.java rename to app/src/main/java/org/schabi/newpipe/settings/services/instances/UrlMultiInstanceTypeCreator.java index 81161add13d..ba2fd23c798 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/UrlMultiInstanceTypeCreator.java +++ b/app/src/main/java/org/schabi/newpipe/settings/services/instances/UrlMultiInstanceTypeCreator.java @@ -1,4 +1,4 @@ -package org.schabi.newpipe.settings.serviceinstances; +package org.schabi.newpipe.settings.services.instances; import android.content.Context; import android.view.LayoutInflater; diff --git a/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/peertube/PeertubeInstanceListFragment.java b/app/src/main/java/org/schabi/newpipe/settings/services/instances/peertube/PeertubeInstanceListFragment.java similarity index 80% rename from app/src/main/java/org/schabi/newpipe/settings/serviceinstances/peertube/PeertubeInstanceListFragment.java rename to app/src/main/java/org/schabi/newpipe/settings/services/instances/peertube/PeertubeInstanceListFragment.java index f236be6a227..42f1ff95f9c 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/peertube/PeertubeInstanceListFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/services/instances/peertube/PeertubeInstanceListFragment.java @@ -1,9 +1,9 @@ -package org.schabi.newpipe.settings.serviceinstances.peertube; +package org.schabi.newpipe.settings.services.instances.peertube; import org.schabi.newpipe.R; import org.schabi.newpipe.extractor.services.peertube.PeertubeInstance; -import org.schabi.newpipe.settings.serviceinstances.AbstractServiceInstanceListFragment; -import org.schabi.newpipe.settings.serviceinstances.UrlMultiInstanceTypeCreator; +import org.schabi.newpipe.settings.services.instances.AbstractServiceInstanceListFragment; +import org.schabi.newpipe.settings.services.instances.UrlMultiInstanceTypeCreator; import org.schabi.newpipe.util.services.PeertubeInstanceManager; import java.util.Collections; diff --git a/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/youtubelike/YouTubeLikeInstanceListFragment.java b/app/src/main/java/org/schabi/newpipe/settings/services/instances/youtubelike/YouTubeLikeInstanceListFragment.java similarity index 88% rename from app/src/main/java/org/schabi/newpipe/settings/serviceinstances/youtubelike/YouTubeLikeInstanceListFragment.java rename to app/src/main/java/org/schabi/newpipe/settings/services/instances/youtubelike/YouTubeLikeInstanceListFragment.java index 844ece6b85d..006b1703036 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/serviceinstances/youtubelike/YouTubeLikeInstanceListFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/services/instances/youtubelike/YouTubeLikeInstanceListFragment.java @@ -1,4 +1,4 @@ -package org.schabi.newpipe.settings.serviceinstances.youtubelike; +package org.schabi.newpipe.settings.services.instances.youtubelike; import android.content.Context; @@ -9,9 +9,9 @@ import org.schabi.newpipe.extractor.services.youtube.YoutubeLikeInstance; import org.schabi.newpipe.extractor.services.youtube.invidious.InvidiousInstance; import org.schabi.newpipe.extractor.services.youtube.youtube.YoutubeInstance; -import org.schabi.newpipe.settings.serviceinstances.AbstractInstanceTypeCreator; -import org.schabi.newpipe.settings.serviceinstances.AbstractServiceInstanceListFragment; -import org.schabi.newpipe.settings.serviceinstances.UrlMultiInstanceTypeCreator; +import org.schabi.newpipe.settings.services.instances.AbstractInstanceTypeCreator; +import org.schabi.newpipe.settings.services.instances.AbstractServiceInstanceListFragment; +import org.schabi.newpipe.settings.services.instances.UrlMultiInstanceTypeCreator; import org.schabi.newpipe.util.services.YoutubeLikeInstanceManager; import java.util.Arrays; diff --git a/app/src/main/res/values/donottranslate.xml b/app/src/main/res/values/donottranslate.xml index f3e3ef0eba2..a6d316cd875 100644 --- a/app/src/main/res/values/donottranslate.xml +++ b/app/src/main/res/values/donottranslate.xml @@ -25,6 +25,7 @@ %1$s/%2$s YouTube SoundCloud + PeerTube @string/app_name LeakCanary diff --git a/app/src/main/res/values/settings_keys.xml b/app/src/main/res/values/settings_keys.xml index cc437eee801..42b948e7fb9 100644 --- a/app/src/main/res/values/settings_keys.xml +++ b/app/src/main/res/values/settings_keys.xml @@ -266,15 +266,7 @@ stream_info_selected_tab show_hold_to_append content_language - peertube_instance_setup - peertube_selected_instance - peertube_instance_list - yt_like_instance_setup - yt_like_instance_selected_instance - yt_like_instance_list content_country - show_age_restricted_content - youtube_restricted_mode_enabled enable_search_history enable_watch_history main_page_content @@ -337,6 +329,17 @@ downloads_storage_ask storage_use_saf + + Services + peertube_instance_setup + peertube_selected_instance + peertube_instance_list + yt_like_instance_setup + yt_like_instance_selected_instance + yt_like_instance_list + show_age_restricted_content + youtube_restricted_mode_enabled + file_rename_charset file_replacement_character diff --git a/app/src/main/res/xml/content_settings.xml b/app/src/main/res/xml/content_settings.xml index 30c4d730513..21d3049a903 100644 --- a/app/src/main/res/xml/content_settings.xml +++ b/app/src/main/res/xml/content_settings.xml @@ -42,34 +42,8 @@ app:iconSpaceReserved="false" /> - - - - - - diff --git a/app/src/main/res/xml/services_settings.xml b/app/src/main/res/xml/services_settings.xml new file mode 100644 index 00000000000..308d4ebcb4f --- /dev/null +++ b/app/src/main/res/xml/services_settings.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + From bf9bf27044ba1581d97ac29e836f399ec4cb19aa Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Fri, 15 Apr 2022 17:21:18 +0200 Subject: [PATCH 09/18] Removed invidious instance was there for testing purposes only --- .../util/services/YoutubeLikeInstanceManager.java | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/util/services/YoutubeLikeInstanceManager.java b/app/src/main/java/org/schabi/newpipe/util/services/YoutubeLikeInstanceManager.java index 2ff960d2103..b90aca482ed 100644 --- a/app/src/main/java/org/schabi/newpipe/util/services/YoutubeLikeInstanceManager.java +++ b/app/src/main/java/org/schabi/newpipe/util/services/YoutubeLikeInstanceManager.java @@ -10,9 +10,6 @@ import org.schabi.newpipe.extractor.services.youtube.invidious.InvidiousInstance; import org.schabi.newpipe.extractor.services.youtube.youtube.YoutubeInstance; -import java.util.Arrays; -import java.util.List; - public final class YoutubeLikeInstanceManager extends AbstractInstanceManager> { @@ -55,13 +52,6 @@ protected int getSelectedInstancePersistenceKey() { return R.string.yt_like_instance_selected_instance_key; } - @Override - protected List> getDefaultInstanceList() { - return Arrays.asList( - YoutubeInstance.YOUTUBE, - new InvidiousInstance("https://invidious.fdn.fr") /* TODO */); - } - @Override protected YoutubeLikeInstance getDefaultInstance() { return YoutubeInstance.YOUTUBE; From e71ccded6947f973f310966b59cc8d29da24ab8d Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Fri, 15 Apr 2022 23:46:23 +0200 Subject: [PATCH 10/18] Add FOSS notice --- .../UrlMultiInstanceTypeCreator.java | 13 ++++++- .../PeertubeInstanceListFragment.java | 3 +- .../YouTubeLikeInstanceListFragment.java | 3 +- .../main/res/layout/dialog_add_instance.xml | 38 +++++++++++++++++-- app/src/main/res/values/strings.xml | 1 + 5 files changed, 51 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/settings/services/instances/UrlMultiInstanceTypeCreator.java b/app/src/main/java/org/schabi/newpipe/settings/services/instances/UrlMultiInstanceTypeCreator.java index ba2fd23c798..d944c2ed43d 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/services/instances/UrlMultiInstanceTypeCreator.java +++ b/app/src/main/java/org/schabi/newpipe/settings/services/instances/UrlMultiInstanceTypeCreator.java @@ -2,6 +2,7 @@ import android.content.Context; import android.view.LayoutInflater; +import android.view.View; import android.widget.Toast; import androidx.annotation.NonNull; @@ -22,19 +23,28 @@ public class UrlMultiInstanceTypeCreator extends AbstractInstanceTypeCreator { protected final Function createNewInstanceFromUrl; + /** + * The (official) list of available instances. + */ @StringRes protected final int instanceListUrl; + /** + * true if the service is free and open source software. + */ + protected final boolean isFoss; public UrlMultiInstanceTypeCreator( final String instanceServiceName, final int icon, final Class createdClass, final Function createNewInstanceFromUrl, - final int instanceListUrl + final int instanceListUrl, + final boolean isFoss ) { super(instanceServiceName, icon, createdClass); this.createNewInstanceFromUrl = createNewInstanceFromUrl; this.instanceListUrl = instanceListUrl; + this.isFoss = isFoss; } @Override @@ -59,6 +69,7 @@ void showAddInstanceUrlDialog( c.getString( R.string.publicly_available_instances_help, c.getString(instanceListUrl))); + dialogBinding.fossNoticeContainer.setVisibility(isFoss ? View.VISIBLE : View.GONE); new AlertDialog.Builder(c) .setTitle(c.getString(R.string.add_instance, instanceServiceName())) diff --git a/app/src/main/java/org/schabi/newpipe/settings/services/instances/peertube/PeertubeInstanceListFragment.java b/app/src/main/java/org/schabi/newpipe/settings/services/instances/peertube/PeertubeInstanceListFragment.java index 42f1ff95f9c..2740b4137d3 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/services/instances/peertube/PeertubeInstanceListFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/services/instances/peertube/PeertubeInstanceListFragment.java @@ -26,7 +26,8 @@ public PeerTubeInstanceTypeCreator() { R.drawable.ic_placeholder_peertube, PeertubeInstance.class, PeertubeInstance::new, - R.string.peertube_instance_list_url); + R.string.peertube_instance_list_url, + true); } } } diff --git a/app/src/main/java/org/schabi/newpipe/settings/services/instances/youtubelike/YouTubeLikeInstanceListFragment.java b/app/src/main/java/org/schabi/newpipe/settings/services/instances/youtubelike/YouTubeLikeInstanceListFragment.java index 006b1703036..8820d7cd60b 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/services/instances/youtubelike/YouTubeLikeInstanceListFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/services/instances/youtubelike/YouTubeLikeInstanceListFragment.java @@ -66,7 +66,8 @@ public InvidiousInstanceTypeCreator() { R.drawable.ic_placeholder_invidious, InvidiousInstance.class, InvidiousInstance::new, - R.string.invidious_instance_list_url); + R.string.invidious_instance_list_url, + true); } } } diff --git a/app/src/main/res/layout/dialog_add_instance.xml b/app/src/main/res/layout/dialog_add_instance.xml index 2417723903f..384156a5a38 100644 --- a/app/src/main/res/layout/dialog_add_instance.xml +++ b/app/src/main/res/layout/dialog_add_instance.xml @@ -9,7 +9,7 @@ + tools:text="@string/publicly_available_instances_help" /> + + + + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 33b175578a3..ba5ad1c29a5 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -135,6 +135,7 @@ A list of publicly available instances can be found on %s Add %s instance Enter instance URL + This service is provided by free and open-source software. Consider donating to the maintainers and developers or feel free to host your own instance. Could not validate instance Instance already exists Communication via HTTP is insecure. Consider using HTTPS instead From eef85d067decd2c99626e060fa69a60c2940d0b2 Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Fri, 15 Apr 2022 23:51:17 +0200 Subject: [PATCH 11/18] Fixed typo --- app/src/main/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ba5ad1c29a5..0ed1c1f0ae6 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -132,7 +132,7 @@ Select your favorite PeerTube instances YouTube-Like instances Manage YouTube-Like instances - A list of publicly available instances can be found on %s + A list of publicly available instances can be found at %s Add %s instance Enter instance URL This service is provided by free and open-source software. Consider donating to the maintainers and developers or feel free to host your own instance. From 8717b5124485ce2ce8f16ca7512982260e2d4c21 Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Sat, 16 Apr 2022 22:02:24 +0200 Subject: [PATCH 12/18] Changed instance list to better link Credits to @TheFrenchGhosty --- app/src/main/res/values/donottranslate.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values/donottranslate.xml b/app/src/main/res/values/donottranslate.xml index a6d316cd875..5ab351d2b56 100644 --- a/app/src/main/res/values/donottranslate.xml +++ b/app/src/main/res/values/donottranslate.xml @@ -4,7 +4,7 @@ RSS org.xbmc.kore https://joinpeertube.org/instances#instances-list - https://docs.invidious.io/instances/ + https://instances.invidious.io/ newpipe newpipeAppUpdate newpipeHash From 5fdd1768da54c7e46a97430e08504430734802f2 Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Tue, 19 Apr 2022 21:02:45 +0200 Subject: [PATCH 13/18] Better error message, when fetching metadat fails --- .../AbstractServiceInstanceListFragment.java | 13 ++++++++++--- app/src/main/res/values-ar/strings.xml | 1 - app/src/main/res/values-b+ast/strings.xml | 1 - app/src/main/res/values-b+uz+Latn/strings.xml | 1 - app/src/main/res/values-b+zh+HANS+CN/strings.xml | 1 - app/src/main/res/values-be/strings.xml | 1 - app/src/main/res/values-bn/strings.xml | 1 - app/src/main/res/values-ca/strings.xml | 1 - app/src/main/res/values-ckb/strings.xml | 1 - app/src/main/res/values-cs/strings.xml | 1 - app/src/main/res/values-da/strings.xml | 1 - app/src/main/res/values-de/strings.xml | 1 - app/src/main/res/values-el/strings.xml | 1 - app/src/main/res/values-eo/strings.xml | 1 - app/src/main/res/values-es/strings.xml | 1 - app/src/main/res/values-et/strings.xml | 1 - app/src/main/res/values-eu/strings.xml | 1 - app/src/main/res/values-fa/strings.xml | 1 - app/src/main/res/values-fi/strings.xml | 1 - app/src/main/res/values-fr/strings.xml | 1 - app/src/main/res/values-gl/strings.xml | 1 - app/src/main/res/values-he/strings.xml | 1 - app/src/main/res/values-hi/strings.xml | 1 - app/src/main/res/values-hr/strings.xml | 1 - app/src/main/res/values-hu/strings.xml | 1 - app/src/main/res/values-in/strings.xml | 1 - app/src/main/res/values-it/strings.xml | 1 - app/src/main/res/values-ja/strings.xml | 1 - app/src/main/res/values-kmr/strings.xml | 1 - app/src/main/res/values-ko/strings.xml | 1 - app/src/main/res/values-ku/strings.xml | 1 - app/src/main/res/values-lt/strings.xml | 1 - app/src/main/res/values-lv/strings.xml | 1 - app/src/main/res/values-ml/strings.xml | 1 - app/src/main/res/values-nb-rNO/strings.xml | 1 - app/src/main/res/values-ne/strings.xml | 1 - app/src/main/res/values-nl-rBE/strings.xml | 1 - app/src/main/res/values-nl/strings.xml | 1 - app/src/main/res/values-pa/strings.xml | 1 - app/src/main/res/values-pl/strings.xml | 1 - app/src/main/res/values-pt-rBR/strings.xml | 1 - app/src/main/res/values-pt-rPT/strings.xml | 1 - app/src/main/res/values-pt/strings.xml | 1 - app/src/main/res/values-ro/strings.xml | 1 - app/src/main/res/values-ru/strings.xml | 1 - app/src/main/res/values-sc/strings.xml | 1 - app/src/main/res/values-sk/strings.xml | 1 - app/src/main/res/values-sl/strings.xml | 1 - app/src/main/res/values-so/strings.xml | 1 - app/src/main/res/values-sq/strings.xml | 1 - app/src/main/res/values-sr/strings.xml | 1 - app/src/main/res/values-sv/strings.xml | 1 - app/src/main/res/values-ta/strings.xml | 1 - app/src/main/res/values-te/strings.xml | 1 - app/src/main/res/values-tr/strings.xml | 1 - app/src/main/res/values-uk/strings.xml | 1 - app/src/main/res/values-ur/strings.xml | 1 - app/src/main/res/values-vi/strings.xml | 1 - app/src/main/res/values-zh-rCN/strings.xml | 1 - app/src/main/res/values-zh-rTW/strings.xml | 1 - app/src/main/res/values/strings.xml | 2 +- 61 files changed, 11 insertions(+), 63 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/settings/services/instances/AbstractServiceInstanceListFragment.java b/app/src/main/java/org/schabi/newpipe/settings/services/instances/AbstractServiceInstanceListFragment.java index 20eb522d13e..ab0f40da4c0 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/services/instances/AbstractServiceInstanceListFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/services/instances/AbstractServiceInstanceListFragment.java @@ -2,6 +2,7 @@ import android.annotation.SuppressLint; import android.os.Bundle; +import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; @@ -23,6 +24,7 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; +import org.schabi.newpipe.MainActivity; import org.schabi.newpipe.R; import org.schabi.newpipe.databinding.FragmentInstanceListBinding; import org.schabi.newpipe.databinding.InstanceTypeFloatingItemBinding; @@ -45,7 +47,7 @@ import io.reactivex.rxjava3.schedulers.Schedulers; public abstract class AbstractServiceInstanceListFragment extends Fragment { - + protected static final String TAG = "AbsServiceInstanceLFrag"; protected static final int TYPES_CONTAINER_ANIMATION_DURATION = 500; @StringRes @@ -253,9 +255,14 @@ protected void addInstance(final I createdInstance) { add(instance); }, e -> { binding.loadingProgressBar.setVisibility(View.GONE); + if (MainActivity.DEBUG) { + Log.w(TAG, "Failed to validate instance", e); + } Toast.makeText(getActivity(), - R.string.could_not_validate_instance, - Toast.LENGTH_SHORT).show(); + requireContext().getString( + R.string.could_not_validate_instance, + e.getMessage() != null ? e.getMessage() : "no message"), + Toast.LENGTH_LONG).show(); }); disposables.add(disposable); } diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 11ed4d78b38..721ed9806c0 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -457,7 +457,6 @@ مثيلات خوادم پيرتيوب حدد مثيلات PeerTube المفضلة لديك أدخل عنوان للمثيل - لا يمكن التحقق من صحة المثال مثيل الخادم موجود بالفعل محلي أُضيف مؤخرًا diff --git a/app/src/main/res/values-b+ast/strings.xml b/app/src/main/res/values-b+ast/strings.xml index 554f1640f2a..a9c56c5d377 100644 --- a/app/src/main/res/values-b+ast/strings.xml +++ b/app/src/main/res/values-b+ast/strings.xml @@ -260,7 +260,6 @@ Importóse Alvertencia: nun pudieron importase tolos ficheros. Anovamientos - Nun pudo validase la instancia %d minutu %d minutos diff --git a/app/src/main/res/values-b+uz+Latn/strings.xml b/app/src/main/res/values-b+uz+Latn/strings.xml index a2d9fccb7e9..303a98eb47a 100644 --- a/app/src/main/res/values-b+uz+Latn/strings.xml +++ b/app/src/main/res/values-b+uz+Latn/strings.xml @@ -144,7 +144,6 @@ Xatti-harakat Ijro etish Namuna allaqachon mavjud - Namunani tasdiqlab bo\'lmadi Namuna URL manzilini kiriting Sevimli PeerTube nusxalarini tanlang PeerTube misollari 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 87d483ec39a..3030678975a 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 @@ -431,7 +431,6 @@ PeerTube 服务器 设置自定义 PeerTube 服务器 输入服务器网址(URL) - 无法验证服务器 该服务器已存在 本地 最近添加 diff --git a/app/src/main/res/values-be/strings.xml b/app/src/main/res/values-be/strings.xml index f3fa4f3642e..43ed3c436be 100644 --- a/app/src/main/res/values-be/strings.xml +++ b/app/src/main/res/values-be/strings.xml @@ -435,7 +435,6 @@ Арыгінальныя тэксты з сэрвісаў будуць бачны ў ленце элементаў Ачысціце cookie, якія NewPipe захоўвае пры рашэнні reCAPTCHA Экзэмпляр ужо існуе - Немагчыма праверыць экзэмпляр Увесці URL экзэмпляра Абярыце любімыя экзэмпляры PeerTube Актыўны плэер быў зменены diff --git a/app/src/main/res/values-bn/strings.xml b/app/src/main/res/values-bn/strings.xml index 43ee7d838ec..e956624a570 100644 --- a/app/src/main/res/values-bn/strings.xml +++ b/app/src/main/res/values-bn/strings.xml @@ -345,7 +345,6 @@ ঝিঝিপোকা ছাড়া কিছুই নেই এখানে এই ধরনের কোন ফাইল/বিষয়বস্তুর উৎস নেই অপুনরুদ্ধারযোগ্য প্লেয়ার ত্রুটি ঘটেছে - ইন্সট্যান্সটি যাচাই করা যায়নি রিক্যাপচা কুকিগুলো পরিষ্কার করা হয়েছে হ্যাঁ, এবং আংশিকভাবে দেখা ভিডিও ব্যবস্থা দ্বারা ক্রিয়া অস্বীকার করা হয়েছে diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml index 61680a822f3..c46198f69e8 100644 --- a/app/src/main/res/values-ca/strings.xml +++ b/app/src/main/res/values-ca/strings.xml @@ -451,7 +451,6 @@ \nSi desitgeu visualitzar-lo, activeu \"%1$s\" a paràmetres. Activa el \"mode restringit\" de YouTube La instància introduïda ja existeix - No ha estat possible validar la instància Introdueix l\'enllaç d\'una instància Selecciona les teves instàncies preferides del PeerTube Instàncies del PeerTube diff --git a/app/src/main/res/values-ckb/strings.xml b/app/src/main/res/values-ckb/strings.xml index 3a360e2fb5e..dc086baed0b 100644 --- a/app/src/main/res/values-ckb/strings.xml +++ b/app/src/main/res/values-ckb/strings.xml @@ -475,7 +475,6 @@ هەڵە لە سكاڵا سڕینەوەی پاشماوەی هەموو ماڵپه‌ڕه‌كان بەرنامەکە نه‌دۆزرایه‌وه‌. دابمه‌زرێت؟ - ناتوانرێ پشتگیری دۆخەکە بکرێ دامەزراندن ڤیدیۆکان بەستەرەکە پشتگیری نەکراوە diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 7ca0a8eae60..b115325bf86 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -442,7 +442,6 @@ Instance PeerTube Vybrat oblíbené instance PeerTube Zadat URL instance - Instanci nebylo možno potvrdit Instance již existuje Místní Přidány nedávno diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index 4ff147ed281..9349a34ec7c 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -372,7 +372,6 @@ Sæt på pause ved skift til mobildata Downloads som ikke kan sættes på pause vil blive genstartet Instansen findes allerede - Kunde ikke bekræfte instans Skriv ind instans-URL Vælg dine favorit-PeerTube-instanser PeerTube-instanser diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 39fbc30d66d..09db00d297b 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -444,7 +444,6 @@ Die Sprache ändert sich, sobald die App neu gestartet wird PeerTube-Instanzen URL der Instanz eingeben - Validierung der Instanz fehlgeschlagen Instanz existiert bereits Lokal Kürzlich hinzugefügt diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 41e8d0ae956..47070c7f766 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -562,7 +562,6 @@ Το YouTube διαθέτει «Περιορισμένη Λειτουργία» η οποία κρύβει πιθανώς ακατάλληλο περιεχόμενο Εμφάνιση πιθανώς ακατάλληλου περιεχομένου (18+) Το instance υπάρχει ήδη - Αδυναμία πιστοποίησης του instance Προσθέστε την URL του instance Επιλογή των αγαπημένων σας PeerTube instances Εμφάνιση αυθεντικού παρελθόντος χρόνου στα αντικείμενα diff --git a/app/src/main/res/values-eo/strings.xml b/app/src/main/res/values-eo/strings.xml index 3cf8e140c0a..553103961cb 100644 --- a/app/src/main/res/values-eo/strings.xml +++ b/app/src/main/res/values-eo/strings.xml @@ -435,7 +435,6 @@ Instancoj de PeerTube Elekti viajn preferitajn instancojn de PeerTube Eniri la ligilon de la instanco - Ne povis validigi instanco La instanco jam ekzistas Lokaj Freŝe aldonitaj diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 8deb63747ad..8bed8ec4e0b 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -442,7 +442,6 @@ Instancias de PeerTube Selecciona tus instancias favoritas de PeerTube Ingresar URL de la instancia - No se pudo validar la instancia La instancia ya existe Local Añadidos recientemente diff --git a/app/src/main/res/values-et/strings.xml b/app/src/main/res/values-et/strings.xml index 8ef2c4df267..7b6b475f251 100644 --- a/app/src/main/res/values-et/strings.xml +++ b/app/src/main/res/values-et/strings.xml @@ -609,7 +609,6 @@ Kommentaarid on välja lülitatud Palun kontrolli kas sinu kogetud krahhi käsitlev vearaport on juba olemas. Luues korduvraporteid võtad meilt aega, mida saaksime kulutada tegelike vigade parandamiseks. Instants on juba olemas - Instantsi valideerimine nurjus Saadaval mõnedes teenustes. See on tavaliselt palju kiirem, kuid võib tagastada piiratud koguse elemente ja sageli osalise informatsiooni (nt. puudub kestus, elemendi tüüp, laiv olek) Sa saad nüüd valida kirjelduse tekstist. Pane tähele, et valikurežiimis võib leht vilkuda ja lingid ei pruugi olla klõpsatavd. Autor: %s diff --git a/app/src/main/res/values-eu/strings.xml b/app/src/main/res/values-eu/strings.xml index bade04d368f..41fa1b51db0 100644 --- a/app/src/main/res/values-eu/strings.xml +++ b/app/src/main/res/values-eu/strings.xml @@ -437,7 +437,6 @@ PeerTube instantziak Hautatu zure gogoko PeerTube instantziak Sartu instantziaren URLa - Ezin izan da instantzia balioztatu Instantzia badago aurretik Lokala Berriki gehitua diff --git a/app/src/main/res/values-fa/strings.xml b/app/src/main/res/values-fa/strings.xml index 1cb8d0e3de9..1db62e8f1d1 100644 --- a/app/src/main/res/values-fa/strings.xml +++ b/app/src/main/res/values-fa/strings.xml @@ -418,7 +418,6 @@ قطعه‌ها ویدیوها این نمونه قبلا وجود دارد - ناتوانی در اعتبارسنجی نشانی نمونه نشانی نمونه را وارد کنید نمونه پیرتیوب مورد علاقه خود در را انتخاب کنید نمونه‌های پیرتیوب diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index 80f25498059..dcae3ca3320 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -382,7 +382,6 @@ Ota käyttöön YouTuben ”Rajoitettu tila” Päivitykset Instanssi on jo olemassa - Instanssia ei voitu vahvistaa Syötä instanssin URL Valitse PeerTube-suosikki-instanssisi PeerTube-instanssit diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 05a553c2191..25975521c23 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -437,7 +437,6 @@ Instances PeerTube Veuillez choisir vos instances PeerTube préférées Veuillez saisir l’URL de l’instance - Impossible de valider l’instance L’instance existe déjà Local Ajoutées récemment diff --git a/app/src/main/res/values-gl/strings.xml b/app/src/main/res/values-gl/strings.xml index 436035c2254..910c9659153 100644 --- a/app/src/main/res/values-gl/strings.xml +++ b/app/src/main/res/values-gl/strings.xml @@ -521,7 +521,6 @@ Activar modo restrinxido de YouTube Actualizacións A instancia xa existe - Non se puido validar a instancia Introduza o URL da instancia Selecciona as instancias favoritas de PeerTube Instancias de PeerTube diff --git a/app/src/main/res/values-he/strings.xml b/app/src/main/res/values-he/strings.xml index a4d41a97b1a..7f87a8ab993 100644 --- a/app/src/main/res/values-he/strings.xml +++ b/app/src/main/res/values-he/strings.xml @@ -447,7 +447,6 @@ מופעים של PeerTube נא לבחור את מופעי ה־PeerTube המועדפים עליך נא להכניס כתובת מופע - לא ניתן לאמת את המופע המופע כבר קיים מקומי נוספו לאחרונה diff --git a/app/src/main/res/values-hi/strings.xml b/app/src/main/res/values-hi/strings.xml index 03c6d2b5a57..ee1462d5de9 100644 --- a/app/src/main/res/values-hi/strings.xml +++ b/app/src/main/res/values-hi/strings.xml @@ -546,7 +546,6 @@ स्वरूपित रिपोर्ट कॉपी करें कुकी साफ़ करें जिसे न्यूपाइप आपके द्वारा रीकैप्चा हल करने पर संग्रहीत करता है उदाहरण पहले से मौजूद है - उदाहरण मान्य नहीं किया जा सका उदाहरण URL दर्ज करें अपने पसंदीदा PeerTube उदाहरण चुनें मुख्य प्लेयर को पूर्ण स्क्रीन में शुरू करें diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml index eead621c29b..2ba71cc9759 100644 --- a/app/src/main/res/values-hr/strings.xml +++ b/app/src/main/res/values-hr/strings.xml @@ -548,7 +548,6 @@ Uključi YouTube postavku „Ograničeni način rada” Prikaži sadržaj koji vjerojatno nije prikladan za djecu, jer je dobno ograničen (kategorija 18) Primjerak već postoji - Neuspjela provjera primjerka Upiši URL primjerka Odaberi tvoje omiljene PeerTube primjerke PeerTube primjerci diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 1b9cb906bcb..f1ebfcffc19 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -546,7 +546,6 @@ A YouTube biztosít egy „Korlátozott módot”, amely elrejti a lehetséges felnőtteknek szóló tartalmat A YouTube „Korlátozott módjának” bekapcsolása A példány már létezik - A példány érvényesítése nem sikerült Adja meg a példány URL-ét Válassza ki a kedvenc PeerTube példányait PeerTube példányok diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml index df9d2bedc9f..19ca0dbc474 100644 --- a/app/src/main/res/values-in/strings.xml +++ b/app/src/main/res/values-in/strings.xml @@ -430,7 +430,6 @@ Situs PeerTube Pilih situs PeerTube favorit Anda Masukkan URL situs - Tidak bisa memvalidasi situs Situs sudah ada Lokal Baru ditambahkan diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 3adbb87df59..779a158fa75 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -437,7 +437,6 @@ Istanze PeerTube Seleziona le istanze PeerTube preferite Inserisci l\'URL dell\'istanza - Impossibile convalidare l\'istanza L\'istanza esiste già Locale Aggiunti di recente diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index cfdd54c6ae2..c88c323fe4d 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -432,7 +432,6 @@ PeerTube インスタンス PeerTube インスタンスを選択する インスタンスの URL を入力 - インスタンスを検証することができませんでした インスタンスはすでに存在しています ローカル 最近追加された diff --git a/app/src/main/res/values-kmr/strings.xml b/app/src/main/res/values-kmr/strings.xml index e279653f2d1..e19aa66cc32 100644 --- a/app/src/main/res/values-kmr/strings.xml +++ b/app/src/main/res/values-kmr/strings.xml @@ -201,7 +201,6 @@ Xwenîşandinî Lîstikvan Mînak jixwe heye - Mînak nehate pejirandin URL-ya mînakê binivîse Mînakên xweyên bijare yên PeerTube hilbijêrin Mînakên PeerTube diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index 8fa96d30260..fda396ca464 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -432,7 +432,6 @@ 피어튜브 인스턴스 당신이 선호하는 피어튜브 인스턴스를 선택하세요. 인스턴스 URL을 입력하세요. - 인스턴스를 검증할 수 없습니다. 인스턴스가 이미 존재합니다. 로컬 최근에 추가됨. diff --git a/app/src/main/res/values-ku/strings.xml b/app/src/main/res/values-ku/strings.xml index cfb84712566..095ef62d2c5 100644 --- a/app/src/main/res/values-ku/strings.xml +++ b/app/src/main/res/values-ku/strings.xml @@ -414,7 +414,6 @@ دۆخی پێرتووبی دۆخە دڵخوازەکانی پێرتووبی دیاریبکە بەستەری دۆخ دابنێ - ناتوانرێ پشتگیری دۆخەکە بکرێ هەمان دۆخ کاراکراوە نەدۆزرایەوە چارەسەرکردن شکستی هێنا diff --git a/app/src/main/res/values-lt/strings.xml b/app/src/main/res/values-lt/strings.xml index 85007f9f484..704ee5874e1 100644 --- a/app/src/main/res/values-lt/strings.xml +++ b/app/src/main/res/values-lt/strings.xml @@ -371,7 +371,6 @@ Pakeisti miniatiūrų dydi 1:1 santykiu Atkūrimo vietos pašalintos Pašalinti visas atkūrimo vietas\? - Netinkama kopija Įveskite kopijos URL Atstatyti paskutinį atkūrimo laiką Tęsti atkūrimą diff --git a/app/src/main/res/values-lv/strings.xml b/app/src/main/res/values-lv/strings.xml index 3f43fbfe960..7440d457505 100644 --- a/app/src/main/res/values-lv/strings.xml +++ b/app/src/main/res/values-lv/strings.xml @@ -268,7 +268,6 @@ Uzvedība Atskaņotājs Instance jau eksistē - Nevarēja apstiprināt instanci Ievadīt instances saites URL Izvēlaties jūsu mīļāko PeerTube instanci PeerTube instances diff --git a/app/src/main/res/values-ml/strings.xml b/app/src/main/res/values-ml/strings.xml index d99d821db22..0967e2a32cd 100644 --- a/app/src/main/res/values-ml/strings.xml +++ b/app/src/main/res/values-ml/strings.xml @@ -299,7 +299,6 @@ സ്വഭാവം പ്ലെയർ സന്ദർഭം നേരത്തെ നിലവിലുണ്ട് - സന്ദർഭം സാധൂകരിക്കാൻ സാധിച്ചില്ല സന്ദർഭത്തിന്റെ URL കൂട്ടിച്ചേർക്കുക നിങ്ങളുടെ പ്രിയപ്പെട്ട പിയർട്യൂബ് സന്ദർഭങ്ങളെ തിരഞ്ഞെടുക്കുക പിയർട്യൂബ് സന്ദർഭങ്ങൾ diff --git a/app/src/main/res/values-nb-rNO/strings.xml b/app/src/main/res/values-nb-rNO/strings.xml index cdf57fe63c7..aac65e9c122 100644 --- a/app/src/main/res/values-nb-rNO/strings.xml +++ b/app/src/main/res/values-nb-rNO/strings.xml @@ -440,7 +440,6 @@ Slett nedlastede filer Velg dine favoritter blant PeerTube-instansene Skriv inn nettadresse til instans - Kunne ikke bekrefte instans Instansen finnes allerede Autogenerert (fant ingen opplaster) gjenoppretter diff --git a/app/src/main/res/values-ne/strings.xml b/app/src/main/res/values-ne/strings.xml index f5c99bf781d..8400c5fd6b9 100644 --- a/app/src/main/res/values-ne/strings.xml +++ b/app/src/main/res/values-ne/strings.xml @@ -431,7 +431,6 @@ PeerTube उदाहरणहरू आफ्नो मनपर्ने PeerTube उदाहरणहरू चयन उदाहरणका URL प्रविष्ट गर्नुहोस् - उदाहरणका मान्य सकेन उदाहरणका पहिले नै अवस्थित स्थानिय हालसालै थपिएको diff --git a/app/src/main/res/values-nl-rBE/strings.xml b/app/src/main/res/values-nl-rBE/strings.xml index c7315584062..293738b3e5a 100644 --- a/app/src/main/res/values-nl-rBE/strings.xml +++ b/app/src/main/res/values-nl-rBE/strings.xml @@ -538,7 +538,6 @@ YouTube \"beperkte modus\" aanzetten Toon inhoud die mogelijk niet geschikt is voor kinderen omwille van een leeftijdslimiet (zoals 18+) Kanaal bestaat al - Kon kanaal niet valideren Kanaal URL invoeren Selecteer je favoriete PeerTube kanaal PeerTube kanaal diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index c46439fc111..e2af3fa5454 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -435,7 +435,6 @@ PeerTube kanaal Selecteer je favorite PeerTube kanaal Kanaal URL invoeren - Kon kanaal niet valideren Kanaal bestaat al Lokaal Recentelijk toegevoegd diff --git a/app/src/main/res/values-pa/strings.xml b/app/src/main/res/values-pa/strings.xml index 7107c6e4610..ebf3a7f5db9 100644 --- a/app/src/main/res/values-pa/strings.xml +++ b/app/src/main/res/values-pa/strings.xml @@ -585,7 +585,6 @@ ਯੂਟਿਊਬ ਦਾ ਪਾਬੰਦੀਸ਼ੁਦਾ ਮੋਡ ਚਾਲੂ ਕਰੋ ਉਹ ਸਮੱਗਰੀ ਵੀ ਵਿਖਾਓ ਜੋ ਉਮਰ-ਸੀਮਾ ਕਰਕੇ ਬੱਚਿਆਂ ਲਈ ਸ਼ਾਇਦ ਸਹੀ ਨਾ ਹੋਵੇ (ਜਿਵੇਂ 18+) ਸਥਿਤੀ ਪਹਿਲਾਂ ਨੂੰ ਮੌਜੂਦ ਹੈ - ਸਥਿਤੀ ਦੀ ਜਾਇਜ਼ਗੀ ਤਸਦੀਕ ਨਹੀਂ ਹੋ ਸਕੀ ਸਥਿਤੀ URL ਦਾਖ਼ਲ ਕਰੋ ਆਪਣੀ ਪਸੰਦੀਦਾ ਪੀਰਟਿਊਬ ਸਥਿਤੀਆਂ ਚੁਣੋ ਪੀਰਟਿਊਬ ਸਥਿਤੀਆਂ diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 2594459dae2..a623b7f888e 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -446,7 +446,6 @@ Serwery PeerTube Wybierz swoje ulubione serwery PeerTube Wprowadź adres URL serwera - Nie udało się sprawdzić poprawności serwera Serwer już istnieje Lokalne Ostatnio dodane diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 8895d142765..f50a8c037b6 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -437,7 +437,6 @@ Instâncias do PeerTube Escolha suas instâncias do PeerTube favoritas Insira o link da instância - Erro ao validar a instância A instância já existe Local Recentes diff --git a/app/src/main/res/values-pt-rPT/strings.xml b/app/src/main/res/values-pt-rPT/strings.xml index 872bb6d276b..165db13ba1e 100644 --- a/app/src/main/res/values-pt-rPT/strings.xml +++ b/app/src/main/res/values-pt-rPT/strings.xml @@ -76,7 +76,6 @@ \nPara o poder ver, tem que ativar \"%1$s\" nas definições. Ver licença Ajuda - Falha ao validar a instância Limpar histórico de descargas Remover todas as posições de reprodução\? Limitar fila de descargas diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index d5c3d45bb53..fc0fbc87757 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -437,7 +437,6 @@ Instâncias PeerTube Defina as suas instâncias favoritas PeerTube Digite o URL da instância - Falha ao validar a instância Instância já existe Local Recentes diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml index 995665083ce..e0d0cc09dc7 100644 --- a/app/src/main/res/values-ro/strings.xml +++ b/app/src/main/res/values-ro/strings.xml @@ -337,7 +337,6 @@ Ștergeți toate pozițiile de redare Videoclipuri Instanța există deja - Nu s-a putut valida instanța Introduceți URL-ul instanței Selectați instanțele PeerTube preferate Instanțe PeerTube diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 9f2893197c4..bea8d09944b 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -448,7 +448,6 @@ Серверы PeerTube Выберите предпочтительные серверы URL сервера - Не удалось проверить сервер Сервер уже существует Локальное Новое diff --git a/app/src/main/res/values-sc/strings.xml b/app/src/main/res/values-sc/strings.xml index 09d2543e3f2..1b046709103 100644 --- a/app/src/main/res/values-sc/strings.xml +++ b/app/src/main/res/values-sc/strings.xml @@ -442,7 +442,6 @@ Cumportamentu Riproduidore S\'istàntzia esistit giai - Impossìbile cunvalidare s\'istàntzia Inserta s\'URL de s\'istàntzia Ischerta sas istàntzias de PeerTube preferidas tuas Istàntzias de PeerTube diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 3a60541a79d..c8585f80cbe 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -442,7 +442,6 @@ Inštancie PeerTube Vyberte si svoje obľúbené inštancie PeerTube Vložiť URL inštancie - Nepodarilo sa overiť inštanciu Inštancia už existuje Miestne Nedávno pridané diff --git a/app/src/main/res/values-sl/strings.xml b/app/src/main/res/values-sl/strings.xml index d38913c4fb4..f42c443515f 100644 --- a/app/src/main/res/values-sl/strings.xml +++ b/app/src/main/res/values-sl/strings.xml @@ -425,7 +425,6 @@ Vklop YouTubovega \"omejenega načina\" Prikaz vsebin, ki so morda neprimerne za otroke zaradi omejitve starosti (kot na primer 18+) Instanca že obstaja - Validacija instance ni bila mogoča Vnesite URL instance Izberite vaše najljubše instance PeerTuba Instance PeerTube diff --git a/app/src/main/res/values-so/strings.xml b/app/src/main/res/values-so/strings.xml index e1f3be6268b..bc1909b67c2 100644 --- a/app/src/main/res/values-so/strings.xml +++ b/app/src/main/res/values-so/strings.xml @@ -368,7 +368,6 @@ Daareha Dabeecada Qaybtan horay ayay ujirtay - Lama ansixin karo qaybtan Gali tixraaca qaybta Dooro qaybaha aad jeceshahay ee PeerTube-ka Qaybaha PeerTube diff --git a/app/src/main/res/values-sq/strings.xml b/app/src/main/res/values-sq/strings.xml index 48111af8d4c..5674786dfc0 100644 --- a/app/src/main/res/values-sq/strings.xml +++ b/app/src/main/res/values-sq/strings.xml @@ -462,7 +462,6 @@ Përditësimet Rregullo Instanca ekziston tashmë - Nuk arriti të vërtetësohej instanca Vendosni URL e instancës Zgjidhni instancat tuaja të preferuara të PeerTube Instancat PeerTube diff --git a/app/src/main/res/values-sr/strings.xml b/app/src/main/res/values-sr/strings.xml index c4b0c539f4a..31e33487d15 100644 --- a/app/src/main/res/values-sr/strings.xml +++ b/app/src/main/res/values-sr/strings.xml @@ -486,7 +486,6 @@ Приказ садржаја који можда није прикладан за децу јер има старосну границу (попут 18+) Ажурирања Инстанца већ постоји - Не могу да потврдим инстанцу Унесите УРЛ инстанце PeerTube инстанца Изаберите своје омиљене инстанце PeerTube diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 0497ba2d946..d530c86c0f9 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -393,7 +393,6 @@ PeerTube-instanser Välj dina favoritpeertube-instanser Ange instansens URL - Det gick inte att validera instansen Instansen finns redan Videor Hjälp diff --git a/app/src/main/res/values-ta/strings.xml b/app/src/main/res/values-ta/strings.xml index 3d953c7d6ef..df9ede65369 100644 --- a/app/src/main/res/values-ta/strings.xml +++ b/app/src/main/res/values-ta/strings.xml @@ -235,7 +235,6 @@ உறவுடைய உருப்படிகள் reCAPTCHAஐ தீர்க்கையில் NewPipe சேமிக்கும் நினைவிகளைத் துடை முதன்மை இயக்கியை முழுதிரையில் துவக்கு - நிகழ்வை செல்லுபடுயாக்க முடியவில்லை எல்லா இயக்கக குறியிடங்களையும் அழிக்கும் எல்லா இயக்கக குறியிடங்களையும் அழிக்கவா\? இயக்கக குறியிடங்கள் அழிக்கப்பட்டன diff --git a/app/src/main/res/values-te/strings.xml b/app/src/main/res/values-te/strings.xml index c4a8d09b203..cc113ee592b 100644 --- a/app/src/main/res/values-te/strings.xml +++ b/app/src/main/res/values-te/strings.xml @@ -224,7 +224,6 @@ ప్లే చేయడం కొనసాగించండి డిఫాల్ట్ కంటెంట్ దేశం ఉదాహరణ URLని నమోదు చేయండి - ఉదాహరణను ధృవీకరించడం సాధ్యపడలేదు ఉదాహరణ ఇప్పటికే ఉంది వినియోగదారులు ఈవెంట్స్ diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 82c5c9d92e4..8f677132d33 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -437,7 +437,6 @@ PeerTube örnekleri Favori PeerTube örneklerinizi seçin Örnek URL\'sini girin - Örnek doğrulanamadı Örnek zaten var Yerel Son eklenen diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index a728617cc7c..b76b2e6cf9c 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -484,7 +484,6 @@ Локальне Допомога Відео - Не вдалося перевірити сервер NewPipe ще не підтримує цей вміст. \n \nМожливо, підтримка з\'явиться в наступних версіях. diff --git a/app/src/main/res/values-ur/strings.xml b/app/src/main/res/values-ur/strings.xml index 6e541487cc6..53d5dda4f1b 100644 --- a/app/src/main/res/values-ur/strings.xml +++ b/app/src/main/res/values-ur/strings.xml @@ -432,7 +432,6 @@ پیر ٹیوب واقعات اپنے پسندیدہ پیر ٹیوب کی مثالیں منتخب کریں مثال کا URL درج کریں - مثال کی توثیق نہیں کی جا سکی مثال پہلے سے موجود ہے مقامی حال ہی میں شامل diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml index c1eaa4e89d5..495e35cc77b 100644 --- a/app/src/main/res/values-vi/strings.xml +++ b/app/src/main/res/values-vi/strings.xml @@ -418,7 +418,6 @@ Nhóm kênh Chọn thực thể Thực thể đã tồn tại - Không thể xác nhận thực thể Nhập URL thực thể %d ngày diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 827c8231b74..12c31a1d117 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -426,7 +426,6 @@ PeerTube 服务器 设置自己喜欢的PeerTube服务器 输入服务器网址(URL) - 无法验证服务器 该服务器已存在 本地 最近添加 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 7f3357c1e66..4c3458501a9 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -432,7 +432,6 @@ PeerTube 站臺 選取您最愛的 PeerTube 站臺 輸入站臺 URL - 無法驗證站臺 站臺已存在 本機 最近新增 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0ed1c1f0ae6..7ed0268848b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -136,7 +136,7 @@ Add %s instance Enter instance URL This service is provided by free and open-source software. Consider donating to the maintainers and developers or feel free to host your own instance. - Could not validate instance + Could not validate instance: %s Instance already exists Communication via HTTP is insecure. Consider using HTTPS instead Player From 5bf57011933ced6456069d7465f76f6031a9b869 Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Wed, 20 Apr 2022 20:51:04 +0200 Subject: [PATCH 14/18] Remember last selected instance Reloads the current instance from the persistence layer (preferences) --- .../java/org/schabi/newpipe/MainActivity.java | 16 ++----- .../services/AbstractInstanceManager.java | 37 +++++++++++++-- .../util/services/InstanceManager.java | 45 ++++++++++++++++++- .../util/services/InstanceManagerHelper.java | 23 ++++++++++ .../newpipe/util/services/ServiceHelper.java | 28 +----------- 5 files changed, 105 insertions(+), 44 deletions(-) create mode 100644 app/src/main/java/org/schabi/newpipe/util/services/InstanceManagerHelper.java diff --git a/app/src/main/java/org/schabi/newpipe/MainActivity.java b/app/src/main/java/org/schabi/newpipe/MainActivity.java index b60789678fa..52c7e1f292e 100644 --- a/app/src/main/java/org/schabi/newpipe/MainActivity.java +++ b/app/src/main/java/org/schabi/newpipe/MainActivity.java @@ -88,9 +88,8 @@ import org.schabi.newpipe.util.TLSSocketFactoryCompat; import org.schabi.newpipe.util.ThemeHelper; import org.schabi.newpipe.util.services.InstanceManager; -import org.schabi.newpipe.util.services.PeertubeInstanceManager; +import org.schabi.newpipe.util.services.InstanceManagerHelper; import org.schabi.newpipe.util.services.ServiceHelper; -import org.schabi.newpipe.util.services.YoutubeLikeInstanceManager; import org.schabi.newpipe.views.FocusOverlayView; import java.util.ArrayList; @@ -392,16 +391,9 @@ private void showServices() { .add(R.id.menu_services_group, s.getServiceId(), ORDER, title) .setIcon(ServiceHelper.getIcon(s.getServiceId())); - // peertube specifics - InstanceManager instanceManager = null; - if (s.getServiceId() == 0) { - instanceManager = YoutubeLikeInstanceManager.MANAGER; - } else if (s.getServiceId() == 3) { - instanceManager = PeertubeInstanceManager.MANAGER; - } - if (instanceManager != null) { - enhanceServiceMenu(menuItem, instanceManager); - } + // instance specifics + InstanceManagerHelper.getManagerForServiceId(s.getServiceId()) + .ifPresent(im -> enhanceServiceMenu(menuItem, im)); } drawerLayoutBinding.navigation.getMenu() .getItem(ServiceHelper.getSelectedServiceId(this)) diff --git a/app/src/main/java/org/schabi/newpipe/util/services/AbstractInstanceManager.java b/app/src/main/java/org/schabi/newpipe/util/services/AbstractInstanceManager.java index e7676fd5341..f9a4e3f9f43 100644 --- a/app/src/main/java/org/schabi/newpipe/util/services/AbstractInstanceManager.java +++ b/app/src/main/java/org/schabi/newpipe/util/services/AbstractInstanceManager.java @@ -1,6 +1,7 @@ package org.schabi.newpipe.util.services; import android.content.Context; +import android.util.Log; import androidx.annotation.StringRes; import androidx.preference.PreferenceManager; @@ -11,6 +12,7 @@ import com.grack.nanojson.JsonStringWriter; import com.grack.nanojson.JsonWriter; +import org.schabi.newpipe.MainActivity; import org.schabi.newpipe.extractor.InstanceBasedStreamingService; import org.schabi.newpipe.extractor.instance.Instance; @@ -19,6 +21,8 @@ import java.util.stream.Collectors; public abstract class AbstractInstanceManager implements InstanceManager { + private static final String TAG = "AbsInstanceManager"; + protected abstract InstanceBasedStreamingService getRelatedStreamingService(); protected abstract I createInstanceFromPersistence(JsonObject jsonObject); @@ -28,9 +32,8 @@ public abstract class AbstractInstanceManager implements Ins @StringRes protected abstract int getListPersistenceKey(); - @Override - public List saveInstanceList(final List instances, final Context context) { + public void saveInstanceList(final List instances, final Context context) { final JsonStringWriter jsonWriter = JsonWriter.string().object().array("instances"); for (final I instance : instances) { jsonWriter.object(); @@ -42,7 +45,6 @@ public List saveInstanceList(final List instances, final Context context) .edit() .putString(context.getString(getListPersistenceKey()), jsonToSave) .apply(); - return null; } @Override @@ -50,7 +52,7 @@ public List getInstanceList(final Context context) { final String savedInstanceListKey = context.getString(getListPersistenceKey()); final String savedJson = PreferenceManager.getDefaultSharedPreferences(context) .getString(savedInstanceListKey, null); - if (null == savedJson) { + if (savedJson == null) { return getDefaultInstanceList(); } @@ -90,6 +92,33 @@ public I saveCurrentInstance(final I instance, final Context context) { return instance; } + @Override + public void reloadCurrentInstanceFromPersistence(final Context context) { + final String json = PreferenceManager.getDefaultSharedPreferences(context) + .getString(context.getString(getSelectedInstancePersistenceKey()), null); + if (json == null) { + return; + } + + final JsonObject jsonObject; + try { + jsonObject = JsonParser.object().from(json); + } catch (final JsonParserException e) { + if (MainActivity.DEBUG) { + Log.w(TAG, "Failed to load instance from settings", e); + } + return; + } + + try { + getRelatedStreamingService().setInstance(createInstanceFromPersistence(jsonObject)); + } catch (final Exception e) { + if (MainActivity.DEBUG) { + Log.w(TAG, "Failed to load instance from settings", e); + } + } + } + @Override public I getCurrentInstance() { try { diff --git a/app/src/main/java/org/schabi/newpipe/util/services/InstanceManager.java b/app/src/main/java/org/schabi/newpipe/util/services/InstanceManager.java index 587dba2e339..8dd58d65aae 100644 --- a/app/src/main/java/org/schabi/newpipe/util/services/InstanceManager.java +++ b/app/src/main/java/org/schabi/newpipe/util/services/InstanceManager.java @@ -6,14 +6,55 @@ import java.util.List; +/** + * Manages service instances. + * + * @param + */ public interface InstanceManager { - List saveInstanceList(List instances, Context context); - + /** + * Saves the instance list (to persistence/preferences). + * + * @param instances instance list + * @param context Context + */ + void saveInstanceList(List instances, Context context); + + /** + * Returns the current instance list. + * + * @param context Context + * @return instance list + */ List getInstanceList(Context context); + /** + * Returns the current instance (from memory / the corresponding streaming-service). + * + * @return The current instance + */ I getCurrentInstance(); + /** + * Reloads the current instance from the persistence layer (preferences). + * + * @param context Context + */ + void reloadCurrentInstanceFromPersistence(Context context); + + /** + * Saves the instance as the currently used one (also to the persistence). + * + * @param instance The instance + * @param context Context + * @return the saved instance + */ I saveCurrentInstance(I instance, Context context); + /** + * Restores the default values. + * + * @param context Context + */ void restoreDefaults(Context context); } diff --git a/app/src/main/java/org/schabi/newpipe/util/services/InstanceManagerHelper.java b/app/src/main/java/org/schabi/newpipe/util/services/InstanceManagerHelper.java new file mode 100644 index 00000000000..797cd4d0116 --- /dev/null +++ b/app/src/main/java/org/schabi/newpipe/util/services/InstanceManagerHelper.java @@ -0,0 +1,23 @@ +package org.schabi.newpipe.util.services; + +import org.schabi.newpipe.extractor.instance.Instance; + +import java.util.Optional; + +public final class InstanceManagerHelper { + private InstanceManagerHelper() { + // No impl + } + + @SuppressWarnings("java:S1452") // otherwise generics won't work! + public static Optional> getManagerForServiceId( + final int serviceId + ) { + if (serviceId == 0) { + return Optional.of(YoutubeLikeInstanceManager.MANAGER); + } else if (serviceId == 3) { + return Optional.of(PeertubeInstanceManager.MANAGER); + } + return Optional.empty(); + } +} diff --git a/app/src/main/java/org/schabi/newpipe/util/services/ServiceHelper.java b/app/src/main/java/org/schabi/newpipe/util/services/ServiceHelper.java index 33e57522b5e..3525f676412 100644 --- a/app/src/main/java/org/schabi/newpipe/util/services/ServiceHelper.java +++ b/app/src/main/java/org/schabi/newpipe/util/services/ServiceHelper.java @@ -3,23 +3,17 @@ import static org.schabi.newpipe.extractor.ServiceList.SoundCloud; import android.content.Context; -import android.content.SharedPreferences; import androidx.annotation.DrawableRes; import androidx.annotation.StringRes; import androidx.preference.PreferenceManager; -import com.grack.nanojson.JsonObject; -import com.grack.nanojson.JsonParser; -import com.grack.nanojson.JsonParserException; - import org.schabi.newpipe.R; import org.schabi.newpipe.extractor.NewPipe; import org.schabi.newpipe.extractor.ServiceList; import org.schabi.newpipe.extractor.StreamingService; import org.schabi.newpipe.extractor.exceptions.ExtractionException; import org.schabi.newpipe.extractor.instance.Instance; -import org.schabi.newpipe.extractor.services.peertube.PeertubeInstance; import org.schabi.newpipe.extractor.services.youtube.invidious.InvidiousInstance; import java.util.OptionalInt; @@ -174,26 +168,8 @@ public static boolean isBeta(final StreamingService s) { } public static void initService(final Context context, final int serviceId) { - if (serviceId == ServiceList.PeerTube.getServiceId()) { - final SharedPreferences sharedPreferences = PreferenceManager - .getDefaultSharedPreferences(context); - final String json = sharedPreferences.getString(context.getString( - R.string.peertube_selected_instance_key), null); - if (null == json) { - return; - } - - final JsonObject jsonObject; - try { - jsonObject = JsonParser.object().from(json); - } catch (final JsonParserException e) { - return; - } - final String name = jsonObject.getString("name"); - final String url = jsonObject.getString("url"); - final PeertubeInstance instance = new PeertubeInstance(url, name); - ServiceList.PeerTube.setInstance(instance); - } + InstanceManagerHelper.getManagerForServiceId(serviceId) + .ifPresent(im -> im.reloadCurrentInstanceFromPersistence(context)); } public static void initServices(final Context context) { From b18b3d04b2525090916e81eca7d132091d65e4cc Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Sat, 23 Apr 2022 00:03:46 +0200 Subject: [PATCH 15/18] Added help for instances --- .../AbstractServiceInstanceListFragment.java | 36 +++++++++++++++---- .../PeertubeInstanceListFragment.java | 3 +- .../YouTubeLikeInstanceListFragment.java | 3 +- .../main/res/menu/menu_chooser_fragment.xml | 5 +++ app/src/main/res/values/strings.xml | 3 +- 5 files changed, 41 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/settings/services/instances/AbstractServiceInstanceListFragment.java b/app/src/main/java/org/schabi/newpipe/settings/services/instances/AbstractServiceInstanceListFragment.java index ab0f40da4c0..ba0e7084a1d 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/services/instances/AbstractServiceInstanceListFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/services/instances/AbstractServiceInstanceListFragment.java @@ -51,10 +51,14 @@ public abstract class AbstractServiceInstanceListFragment ex protected static final int TYPES_CONTAINER_ANIMATION_DURATION = 500; @StringRes - protected final int title; + protected final int titleRes; - protected final List> instanceTypeCreators; protected final InstanceManager manager; + protected final List> instanceTypeCreators; + + @Nullable + @StringRes + protected final Integer helpTextMsgRes; protected final List currentInstances = new ArrayList<>(); protected I selectedInstance; @@ -66,13 +70,15 @@ public abstract class AbstractServiceInstanceListFragment ex protected CompositeDisposable disposables = new CompositeDisposable(); protected AbstractServiceInstanceListFragment( - @StringRes final int title, + @StringRes final int titleRes, @NonNull final InstanceManager manager, - @NonNull final List> instanceTypeCreators + @NonNull final List> instanceTypeCreators, + @Nullable @StringRes final Integer helpTextMsgRes ) { - this.title = title; + this.titleRes = titleRes; this.manager = manager; this.instanceTypeCreators = instanceTypeCreators; + this.helpTextMsgRes = helpTextMsgRes; } @Override @@ -118,7 +124,7 @@ public void onViewCreated( @Override public void onResume() { super.onResume(); - ThemeHelper.setTitleToAppCompatActivity(getActivity(), getString(title)); + ThemeHelper.setTitleToAppCompatActivity(getActivity(), getString(titleRes)); } @Override @@ -145,6 +151,8 @@ public void onCreateOptionsMenu(@NonNull final Menu menu, @NonNull final MenuInflater inflater) { super.onCreateOptionsMenu(menu, inflater); inflater.inflate(R.menu.menu_chooser_fragment, menu); + + menu.findItem(R.id.menu_item_instance_help).setVisible(helpTextMsgRes != null); } @Override @@ -153,6 +161,10 @@ public boolean onOptionsItemSelected(final MenuItem item) { restoreDefaults(); return true; } + if (item.getItemId() == R.id.menu_item_instance_help) { + openHelp(); + return true; + } return super.onOptionsItemSelected(item); } @@ -191,6 +203,18 @@ protected void restoreDefaults() { .show(); } + protected void openHelp() { + if (helpTextMsgRes == null) { + return; + } + + new AlertDialog.Builder(requireContext()) + .setTitle(R.string.help) + .setMessage(helpTextMsgRes) + .setPositiveButton(R.string.ok, null) + .show(); + } + protected void onFABCreateButtonClicked() { final List> availableInstanceTypeCreators = instanceTypeCreators.stream() diff --git a/app/src/main/java/org/schabi/newpipe/settings/services/instances/peertube/PeertubeInstanceListFragment.java b/app/src/main/java/org/schabi/newpipe/settings/services/instances/peertube/PeertubeInstanceListFragment.java index 2740b4137d3..3b7bdd22097 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/services/instances/peertube/PeertubeInstanceListFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/services/instances/peertube/PeertubeInstanceListFragment.java @@ -15,7 +15,8 @@ public PeertubeInstanceListFragment() { super( R.string.peertube_instance_url_title, PeertubeInstanceManager.MANAGER, - Collections.singletonList(new PeerTubeInstanceTypeCreator())); + Collections.singletonList(new PeerTubeInstanceTypeCreator()), + null); } public static class PeerTubeInstanceTypeCreator diff --git a/app/src/main/java/org/schabi/newpipe/settings/services/instances/youtubelike/YouTubeLikeInstanceListFragment.java b/app/src/main/java/org/schabi/newpipe/settings/services/instances/youtubelike/YouTubeLikeInstanceListFragment.java index 8820d7cd60b..04953781a8c 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/services/instances/youtubelike/YouTubeLikeInstanceListFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/services/instances/youtubelike/YouTubeLikeInstanceListFragment.java @@ -27,7 +27,8 @@ public YouTubeLikeInstanceListFragment() { YoutubeLikeInstanceManager.MANAGER, Arrays.asList( new YouTubeInstanceTypeCreator(), - new InvidiousInstanceTypeCreator())); + new InvidiousInstanceTypeCreator()), + R.string.yt_like_instance_list_help); } diff --git a/app/src/main/res/menu/menu_chooser_fragment.xml b/app/src/main/res/menu/menu_chooser_fragment.xml index 8052f60ef99..fdee0fda586 100644 --- a/app/src/main/res/menu/menu_chooser_fragment.xml +++ b/app/src/main/res/menu/menu_chooser_fragment.xml @@ -5,4 +5,9 @@ android:title="@string/restore_defaults" android:icon="@drawable/ic_settings_backup_restore" app:showAsAction="always" /> + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7ed0268848b..9079155eb09 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -131,7 +131,8 @@ PeerTube instances Select your favorite PeerTube instances YouTube-Like instances - Manage YouTube-Like instances + Manage YouTube-Like service instances + This page allows you to manage YouTube-Like service instances.\n\nAn instance provides a alternative way of fetching and delivering content (like a proxy), which can be helpful if the direct extraction fails.\n\nFurthermore it may also provide improved performance, better privacy / tracking protection and additional information.\nHowever keep in mind that an instance might not implement all features and thus limitations may occur. A list of publicly available instances can be found at %s Add %s instance Enter instance URL From 709925eb04ae16fa94d32b29c30af62819de0431 Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Mon, 25 Apr 2022 20:30:50 +0200 Subject: [PATCH 16/18] Use material icon --- .../youtubelike/YouTubeLikeInstanceListFragment.java | 2 +- .../schabi/newpipe/util/services/ServiceHelper.java | 2 +- app/src/main/res/drawable/ic_placeholder_yt.xml | 10 ---------- app/src/main/res/drawable/ic_smart_display.xml | 10 ++++++++++ app/src/main/res/layout/drawer_header.xml | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) delete mode 100644 app/src/main/res/drawable/ic_placeholder_yt.xml create mode 100644 app/src/main/res/drawable/ic_smart_display.xml diff --git a/app/src/main/java/org/schabi/newpipe/settings/services/instances/youtubelike/YouTubeLikeInstanceListFragment.java b/app/src/main/java/org/schabi/newpipe/settings/services/instances/youtubelike/YouTubeLikeInstanceListFragment.java index 04953781a8c..4cb21071a7c 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/services/instances/youtubelike/YouTubeLikeInstanceListFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/services/instances/youtubelike/YouTubeLikeInstanceListFragment.java @@ -37,7 +37,7 @@ public static class YouTubeInstanceTypeCreator public YouTubeInstanceTypeCreator() { super( YoutubeInstance.SERVICE_NAME, - R.drawable.ic_placeholder_yt, + R.drawable.ic_smart_display, YoutubeInstance.class); } diff --git a/app/src/main/java/org/schabi/newpipe/util/services/ServiceHelper.java b/app/src/main/java/org/schabi/newpipe/util/services/ServiceHelper.java index 3525f676412..bb30a4c8363 100644 --- a/app/src/main/java/org/schabi/newpipe/util/services/ServiceHelper.java +++ b/app/src/main/java/org/schabi/newpipe/util/services/ServiceHelper.java @@ -28,7 +28,7 @@ private ServiceHelper() { } public static int getIcon(final int serviceId) { switch (serviceId) { case 0: - return R.drawable.ic_placeholder_yt; + return R.drawable.ic_smart_display; case 1: return R.drawable.ic_placeholder_cloud; case 2: diff --git a/app/src/main/res/drawable/ic_placeholder_yt.xml b/app/src/main/res/drawable/ic_placeholder_yt.xml deleted file mode 100644 index ba8c694405d..00000000000 --- a/app/src/main/res/drawable/ic_placeholder_yt.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_smart_display.xml b/app/src/main/res/drawable/ic_smart_display.xml new file mode 100644 index 00000000000..d666a3b3739 --- /dev/null +++ b/app/src/main/res/drawable/ic_smart_display.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/layout/drawer_header.xml b/app/src/main/res/layout/drawer_header.xml index 109c123fcf5..94e045863b8 100644 --- a/app/src/main/res/layout/drawer_header.xml +++ b/app/src/main/res/layout/drawer_header.xml @@ -86,7 +86,7 @@ android:scaleType="fitCenter" app:tint="@color/drawer_header_font_color" tools:ignore="ContentDescription" - tools:srcCompat="@drawable/ic_placeholder_yt" /> + tools:srcCompat="@drawable/ic_smart_display" /> Date: Mon, 25 Apr 2022 20:34:44 +0200 Subject: [PATCH 17/18] Removed placeholder prefix --- .../instances/AbstractServiceInstanceListFragment.java | 2 +- .../java/org/schabi/newpipe/util/services/ServiceHelper.java | 4 ++-- .../res/drawable/{ic_placeholder_circle.xml => ic_circle.xml} | 0 .../res/drawable/{ic_placeholder_cloud.xml => ic_cloud.xml} | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename app/src/main/res/drawable/{ic_placeholder_circle.xml => ic_circle.xml} (100%) rename app/src/main/res/drawable/{ic_placeholder_cloud.xml => ic_cloud.xml} (100%) diff --git a/app/src/main/java/org/schabi/newpipe/settings/services/instances/AbstractServiceInstanceListFragment.java b/app/src/main/java/org/schabi/newpipe/settings/services/instances/AbstractServiceInstanceListFragment.java index ba0e7084a1d..cf71640030c 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/services/instances/AbstractServiceInstanceListFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/services/instances/AbstractServiceInstanceListFragment.java @@ -362,7 +362,7 @@ protected int getIconForInstance(final I instance) { .filter(c -> c.createdClass().isInstance(instance)) .map(InstanceTypeCreator::icon) .findFirst() - .orElse(R.drawable.ic_placeholder_circle); + .orElse(R.drawable.ic_circle); } /*////////////////////////////////////////////////////////////////////////// diff --git a/app/src/main/java/org/schabi/newpipe/util/services/ServiceHelper.java b/app/src/main/java/org/schabi/newpipe/util/services/ServiceHelper.java index bb30a4c8363..7553677598c 100644 --- a/app/src/main/java/org/schabi/newpipe/util/services/ServiceHelper.java +++ b/app/src/main/java/org/schabi/newpipe/util/services/ServiceHelper.java @@ -30,7 +30,7 @@ public static int getIcon(final int serviceId) { case 0: return R.drawable.ic_smart_display; case 1: - return R.drawable.ic_placeholder_cloud; + return R.drawable.ic_cloud; case 2: return R.drawable.ic_placeholder_media_ccc; case 3: @@ -38,7 +38,7 @@ public static int getIcon(final int serviceId) { case 4: return R.drawable.ic_placeholder_bandcamp; default: - return R.drawable.ic_placeholder_circle; + return R.drawable.ic_circle; } } diff --git a/app/src/main/res/drawable/ic_placeholder_circle.xml b/app/src/main/res/drawable/ic_circle.xml similarity index 100% rename from app/src/main/res/drawable/ic_placeholder_circle.xml rename to app/src/main/res/drawable/ic_circle.xml diff --git a/app/src/main/res/drawable/ic_placeholder_cloud.xml b/app/src/main/res/drawable/ic_cloud.xml similarity index 100% rename from app/src/main/res/drawable/ic_placeholder_cloud.xml rename to app/src/main/res/drawable/ic_cloud.xml From 197226bfcc3a0ac6f5e87f52fdc7f7ccfd84409e Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Sat, 7 May 2022 15:42:59 +0200 Subject: [PATCH 18/18] Added requirements section when adding an instance --- .../UrlMultiInstanceTypeCreator.java | 41 +++++++++++++++---- .../PeertubeInstanceListFragment.java | 1 + .../YouTubeLikeInstanceListFragment.java | 2 + .../main/res/layout/dialog_add_instance.xml | 21 +++++++++- app/src/main/res/values/strings.xml | 2 + 5 files changed, 57 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/settings/services/instances/UrlMultiInstanceTypeCreator.java b/app/src/main/java/org/schabi/newpipe/settings/services/instances/UrlMultiInstanceTypeCreator.java index d944c2ed43d..b67331f7ebf 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/services/instances/UrlMultiInstanceTypeCreator.java +++ b/app/src/main/java/org/schabi/newpipe/settings/services/instances/UrlMultiInstanceTypeCreator.java @@ -1,5 +1,6 @@ package org.schabi.newpipe.settings.services.instances; +import android.annotation.SuppressLint; import android.content.Context; import android.view.LayoutInflater; import android.view.View; @@ -27,7 +28,13 @@ public class UrlMultiInstanceTypeCreator * The (official) list of available instances. */ @StringRes - protected final int instanceListUrl; + protected final Integer instanceListUrl; + + /** + * List of {@link StringRes} representing the requirements for an instance (e.g. a working API). + */ + protected final List instanceRequirements; + /** * true if the service is free and open source software. */ @@ -38,12 +45,14 @@ public UrlMultiInstanceTypeCreator( final int icon, final Class createdClass, final Function createNewInstanceFromUrl, - final int instanceListUrl, + @StringRes final Integer instanceListUrl, + final List instanceRequirements, final boolean isFoss ) { super(instanceServiceName, icon, createdClass); this.createNewInstanceFromUrl = createNewInstanceFromUrl; this.instanceListUrl = instanceListUrl; + this.instanceRequirements = instanceRequirements; this.isFoss = isFoss; } @@ -55,20 +64,36 @@ public void createNewInstance( ) { showAddInstanceUrlDialog(context, url -> defaultValidateAndCleanUrl(url, context, existingInstances, createdClass()) - .map(createNewInstanceFromUrl) - .ifPresent(onInstanceCreated)); + .map(createNewInstanceFromUrl) + .ifPresent(onInstanceCreated)); } + @SuppressLint("SetTextI18n") + // When using non concated text for + // instanceRequirements, we would have to duplicate code/translations void showAddInstanceUrlDialog( final Context c, final Consumer onUrlCreated ) { final DialogAddInstanceBinding dialogBinding = DialogAddInstanceBinding.inflate(LayoutInflater.from(c)); - dialogBinding.instanceHelp.setText( - c.getString( - R.string.publicly_available_instances_help, - c.getString(instanceListUrl))); + if (instanceListUrl != -1) { + dialogBinding.instanceHelp.setVisibility(View.VISIBLE); + dialogBinding.instanceHelp.setText( + c.getString( + R.string.publicly_available_instances_help, + c.getString(instanceListUrl))); + } + if (!instanceRequirements.isEmpty()) { + dialogBinding.instanceRequirements.setVisibility(View.VISIBLE); + dialogBinding.instanceRequirements.setText( + c.getString(R.string.note_that_an_instance_requires_the_following) + + instanceRequirements.stream() + .map(c::getString) + .map(s -> "\n • " + s) + .collect(Collectors.joining()) + ); + } dialogBinding.fossNoticeContainer.setVisibility(isFoss ? View.VISIBLE : View.GONE); new AlertDialog.Builder(c) diff --git a/app/src/main/java/org/schabi/newpipe/settings/services/instances/peertube/PeertubeInstanceListFragment.java b/app/src/main/java/org/schabi/newpipe/settings/services/instances/peertube/PeertubeInstanceListFragment.java index 3b7bdd22097..7b1419d19d9 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/services/instances/peertube/PeertubeInstanceListFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/services/instances/peertube/PeertubeInstanceListFragment.java @@ -28,6 +28,7 @@ public PeerTubeInstanceTypeCreator() { PeertubeInstance.class, PeertubeInstance::new, R.string.peertube_instance_list_url, + Collections.singletonList(R.string.a_working_api), true); } } diff --git a/app/src/main/java/org/schabi/newpipe/settings/services/instances/youtubelike/YouTubeLikeInstanceListFragment.java b/app/src/main/java/org/schabi/newpipe/settings/services/instances/youtubelike/YouTubeLikeInstanceListFragment.java index 4cb21071a7c..4be446baca0 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/services/instances/youtubelike/YouTubeLikeInstanceListFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/services/instances/youtubelike/YouTubeLikeInstanceListFragment.java @@ -15,6 +15,7 @@ import org.schabi.newpipe.util.services.YoutubeLikeInstanceManager; import java.util.Arrays; +import java.util.Collections; import java.util.List; import java.util.function.Consumer; @@ -68,6 +69,7 @@ public InvidiousInstanceTypeCreator() { InvidiousInstance.class, InvidiousInstance::new, R.string.invidious_instance_list_url, + Collections.singletonList(R.string.a_working_api), true); } } diff --git a/app/src/main/res/layout/dialog_add_instance.xml b/app/src/main/res/layout/dialog_add_instance.xml index 384156a5a38..b9680d65e95 100644 --- a/app/src/main/res/layout/dialog_add_instance.xml +++ b/app/src/main/res/layout/dialog_add_instance.xml @@ -15,10 +15,27 @@ android:layout_marginTop="8dp" android:layout_marginEnd="8dp" android:autoLink="web" + android:visibility="gone" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" - tools:text="@string/publicly_available_instances_help" /> + tools:text="@string/publicly_available_instances_help" + tools:visibility="visible" /> + + + app:layout_constraintTop_toBottomOf="@+id/instanceRequirements" /> Manage YouTube-Like service instances This page allows you to manage YouTube-Like service instances.\n\nAn instance provides a alternative way of fetching and delivering content (like a proxy), which can be helpful if the direct extraction fails.\n\nFurthermore it may also provide improved performance, better privacy / tracking protection and additional information.\nHowever keep in mind that an instance might not implement all features and thus limitations may occur. A list of publicly available instances can be found at %s + Note that an instance requires the following: + a working API Add %s instance Enter instance URL This service is provided by free and open-source software. Consider donating to the maintainers and developers or feel free to host your own instance.