diff --git a/app/build.gradle b/app/build.gradle
index fbd9a7c8c..4259d45a2 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -62,7 +62,7 @@ dependencies {
exclude module: 'support-annotations'
})
- implementation 'com.github.yausername:NewPipeExtractor:4e0adbe'
+ implementation 'com.github.yausername:NewPipeExtractor:bc75c66'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.23.0'
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 c14aac4b5..5e3562c7e 100644
--- a/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java
+++ b/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java
@@ -24,6 +24,7 @@ import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.ServiceList;
import org.schabi.newpipe.extractor.localization.ContentCountry;
import org.schabi.newpipe.extractor.localization.Localization;
+import org.schabi.newpipe.extractor.services.peertube.PeertubeInstance;
import org.schabi.newpipe.report.ErrorActivity;
import org.schabi.newpipe.report.UserAction;
import org.schabi.newpipe.util.FilePickerActivityHelper;
@@ -45,9 +46,8 @@ import java.util.Map;
import java.util.zip.ZipFile;
import java.util.zip.ZipOutputStream;
-import io.reactivex.Single;
+import io.reactivex.Completable;
import io.reactivex.android.schedulers.AndroidSchedulers;
-import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
@@ -68,8 +68,6 @@ public class ContentSettingsFragment extends BasePreferenceFragment {
private Localization initialSelectedLocalization;
private ContentCountry initialSelectedContentCountry;
- private CompositeDisposable disposables = new CompositeDisposable();
-
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -142,30 +140,24 @@ public class ContentSettingsFragment extends BasePreferenceFragment {
Toast.LENGTH_SHORT).show();
} else {
pEt.setSummary("fetching instance details..");
- Disposable disposable = Single.fromCallable(() -> {
- ServiceList.PeerTube.setInstance(url);
- return true;
+ Disposable disposable = Completable.fromAction(() -> {
+ PeertubeInstance instance = new PeertubeInstance(url);
+ instance.fetchInstanceMetaData();
+ ServiceList.PeerTube.setInstance(instance);
}).subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
- .subscribe(result -> {
- if (result) {
- pEt.setSummary(url);
- pEt.setText(url);
- SharedPreferences.Editor editor = sharedPreferences.edit();
- editor.putString(App.getApp().getString(R.string.peertube_instance_name_key), ServiceList.PeerTube.getServiceInfo().getName()).apply();
- editor.putString(App.getApp().getString(R.string.current_service_key), ServiceList.PeerTube.getServiceInfo().getName()).apply();
- NavigationHelper.openMainActivity(App.getApp());
- } else {
- pEt.setSummary(ServiceList.PeerTube.getBaseUrl());
- Toast.makeText(getActivity(), "unable to update instance",
- Toast.LENGTH_SHORT).show();
- }
+ .subscribe(() -> {
+ pEt.setSummary(url);
+ pEt.setText(url);
+ SharedPreferences.Editor editor = sharedPreferences.edit();
+ editor.putString(App.getApp().getString(R.string.peertube_instance_name_key), ServiceList.PeerTube.getServiceInfo().getName()).apply();
+ editor.putString(App.getApp().getString(R.string.current_service_key), ServiceList.PeerTube.getServiceInfo().getName()).apply();
+ NavigationHelper.openMainActivity(App.getApp());
}, error -> {
pEt.setSummary(ServiceList.PeerTube.getBaseUrl());
Toast.makeText(getActivity(), "unable to update instance",
Toast.LENGTH_SHORT).show();
});
- disposables.add(disposable);
}
return false;
});
diff --git a/app/src/main/java/org/schabi/newpipe/util/ServiceHelper.java b/app/src/main/java/org/schabi/newpipe/util/ServiceHelper.java
index 429331dfd..084ab5878 100644
--- a/app/src/main/java/org/schabi/newpipe/util/ServiceHelper.java
+++ b/app/src/main/java/org/schabi/newpipe/util/ServiceHelper.java
@@ -11,6 +11,7 @@ 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.services.peertube.PeertubeInstance;
import java.util.concurrent.TimeUnit;
@@ -140,7 +141,8 @@ public class ServiceHelper {
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
String peerTubeInstanceUrl = sharedPreferences.getString(context.getString(R.string.peertube_instance_url_key), ServiceList.PeerTube.getBaseUrl());
String peerTubeInstanceName = sharedPreferences.getString(context.getString(R.string.peertube_instance_name_key), ServiceList.PeerTube.getServiceInfo().getName());
- ServiceList.PeerTube.setInstance(peerTubeInstanceUrl, peerTubeInstanceName);
+ PeertubeInstance instance = new PeertubeInstance(peerTubeInstanceUrl, peerTubeInstanceName);
+ ServiceList.PeerTube.setInstance(instance);
}
}
diff --git a/app/src/main/res/drawable-hdpi/ic_kiosklocal_black_24dp.png b/app/src/main/res/drawable-hdpi/ic_kiosk_local_black_24dp.png
similarity index 100%
rename from app/src/main/res/drawable-hdpi/ic_kiosklocal_black_24dp.png
rename to app/src/main/res/drawable-hdpi/ic_kiosk_local_black_24dp.png
diff --git a/app/src/main/res/drawable-hdpi/ic_kiosklocal_white_24dp.png b/app/src/main/res/drawable-hdpi/ic_kiosk_local_white_24dp.png
similarity index 100%
rename from app/src/main/res/drawable-hdpi/ic_kiosklocal_white_24dp.png
rename to app/src/main/res/drawable-hdpi/ic_kiosk_local_white_24dp.png
diff --git a/app/src/main/res/drawable-hdpi/ic_kioskrecent_black_24dp.png b/app/src/main/res/drawable-hdpi/ic_kiosk_recent_black_24dp.png
similarity index 100%
rename from app/src/main/res/drawable-hdpi/ic_kioskrecent_black_24dp.png
rename to app/src/main/res/drawable-hdpi/ic_kiosk_recent_black_24dp.png
diff --git a/app/src/main/res/drawable-hdpi/ic_kioskrecent_white_24dp.png b/app/src/main/res/drawable-hdpi/ic_kiosk_recent_white_24dp.png
similarity index 100%
rename from app/src/main/res/drawable-hdpi/ic_kioskrecent_white_24dp.png
rename to app/src/main/res/drawable-hdpi/ic_kiosk_recent_white_24dp.png
diff --git a/app/src/main/res/drawable-mdpi/ic_kiosklocal_black_24dp.png b/app/src/main/res/drawable-mdpi/ic_kiosk_local_black_24dp.png
similarity index 100%
rename from app/src/main/res/drawable-mdpi/ic_kiosklocal_black_24dp.png
rename to app/src/main/res/drawable-mdpi/ic_kiosk_local_black_24dp.png
diff --git a/app/src/main/res/drawable-mdpi/ic_kiosklocal_white_24dp.png b/app/src/main/res/drawable-mdpi/ic_kiosk_local_white_24dp.png
similarity index 100%
rename from app/src/main/res/drawable-mdpi/ic_kiosklocal_white_24dp.png
rename to app/src/main/res/drawable-mdpi/ic_kiosk_local_white_24dp.png
diff --git a/app/src/main/res/drawable-mdpi/ic_kioskrecent_black_24dp.png b/app/src/main/res/drawable-mdpi/ic_kiosk_recent_black_24dp.png
similarity index 100%
rename from app/src/main/res/drawable-mdpi/ic_kioskrecent_black_24dp.png
rename to app/src/main/res/drawable-mdpi/ic_kiosk_recent_black_24dp.png
diff --git a/app/src/main/res/drawable-mdpi/ic_kioskrecent_white_24dp.png b/app/src/main/res/drawable-mdpi/ic_kiosk_recent_white_24dp.png
similarity index 100%
rename from app/src/main/res/drawable-mdpi/ic_kioskrecent_white_24dp.png
rename to app/src/main/res/drawable-mdpi/ic_kiosk_recent_white_24dp.png
diff --git a/app/src/main/res/drawable-xhdpi/ic_kiosklocal_black_24dp.png b/app/src/main/res/drawable-xhdpi/ic_kiosk_local_black_24dp.png
similarity index 100%
rename from app/src/main/res/drawable-xhdpi/ic_kiosklocal_black_24dp.png
rename to app/src/main/res/drawable-xhdpi/ic_kiosk_local_black_24dp.png
diff --git a/app/src/main/res/drawable-xhdpi/ic_kiosklocal_white_24dp.png b/app/src/main/res/drawable-xhdpi/ic_kiosk_local_white_24dp.png
similarity index 100%
rename from app/src/main/res/drawable-xhdpi/ic_kiosklocal_white_24dp.png
rename to app/src/main/res/drawable-xhdpi/ic_kiosk_local_white_24dp.png
diff --git a/app/src/main/res/drawable-xhdpi/ic_kioskrecent_black_24dp.png b/app/src/main/res/drawable-xhdpi/ic_kiosk_recent_black_24dp.png
similarity index 100%
rename from app/src/main/res/drawable-xhdpi/ic_kioskrecent_black_24dp.png
rename to app/src/main/res/drawable-xhdpi/ic_kiosk_recent_black_24dp.png
diff --git a/app/src/main/res/drawable-xhdpi/ic_kioskrecent_white_24dp.png b/app/src/main/res/drawable-xhdpi/ic_kiosk_recent_white_24dp.png
similarity index 100%
rename from app/src/main/res/drawable-xhdpi/ic_kioskrecent_white_24dp.png
rename to app/src/main/res/drawable-xhdpi/ic_kiosk_recent_white_24dp.png
diff --git a/app/src/main/res/drawable-xxhdpi/ic_kiosklocal_black_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_kiosk_local_black_24dp.png
similarity index 100%
rename from app/src/main/res/drawable-xxhdpi/ic_kiosklocal_black_24dp.png
rename to app/src/main/res/drawable-xxhdpi/ic_kiosk_local_black_24dp.png
diff --git a/app/src/main/res/drawable-xxhdpi/ic_kiosklocal_white_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_kiosk_local_white_24dp.png
similarity index 100%
rename from app/src/main/res/drawable-xxhdpi/ic_kiosklocal_white_24dp.png
rename to app/src/main/res/drawable-xxhdpi/ic_kiosk_local_white_24dp.png
diff --git a/app/src/main/res/drawable-xxhdpi/ic_kioskrecent_black_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_kiosk_recent_black_24dp.png
similarity index 100%
rename from app/src/main/res/drawable-xxhdpi/ic_kioskrecent_black_24dp.png
rename to app/src/main/res/drawable-xxhdpi/ic_kiosk_recent_black_24dp.png
diff --git a/app/src/main/res/drawable-xxhdpi/ic_kioskrecent_white_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_kiosk_recent_white_24dp.png
similarity index 100%
rename from app/src/main/res/drawable-xxhdpi/ic_kioskrecent_white_24dp.png
rename to app/src/main/res/drawable-xxhdpi/ic_kiosk_recent_white_24dp.png
diff --git a/app/src/main/res/drawable-xxxhdpi/ic_kiosklocal_black_24dp.png b/app/src/main/res/drawable-xxxhdpi/ic_kiosk_local_black_24dp.png
similarity index 100%
rename from app/src/main/res/drawable-xxxhdpi/ic_kiosklocal_black_24dp.png
rename to app/src/main/res/drawable-xxxhdpi/ic_kiosk_local_black_24dp.png
diff --git a/app/src/main/res/drawable-xxxhdpi/ic_kiosklocal_white_24dp.png b/app/src/main/res/drawable-xxxhdpi/ic_kiosk_local_white_24dp.png
similarity index 100%
rename from app/src/main/res/drawable-xxxhdpi/ic_kiosklocal_white_24dp.png
rename to app/src/main/res/drawable-xxxhdpi/ic_kiosk_local_white_24dp.png
diff --git a/app/src/main/res/drawable-xxxhdpi/ic_kioskrecent_black_24dp.png b/app/src/main/res/drawable-xxxhdpi/ic_kiosk_recent_black_24dp.png
similarity index 100%
rename from app/src/main/res/drawable-xxxhdpi/ic_kioskrecent_black_24dp.png
rename to app/src/main/res/drawable-xxxhdpi/ic_kiosk_recent_black_24dp.png
diff --git a/app/src/main/res/drawable-xxxhdpi/ic_kioskrecent_white_24dp.png b/app/src/main/res/drawable-xxxhdpi/ic_kiosk_recent_white_24dp.png
similarity index 100%
rename from app/src/main/res/drawable-xxxhdpi/ic_kioskrecent_white_24dp.png
rename to app/src/main/res/drawable-xxxhdpi/ic_kiosk_recent_white_24dp.png
diff --git a/app/src/main/res/values/colors_services.xml b/app/src/main/res/values/colors_services.xml
index d38df003e..0126ee9ae 100644
--- a/app/src/main/res/values/colors_services.xml
+++ b/app/src/main/res/values/colors_services.xml
@@ -23,13 +23,13 @@
#ff9100
- #e65100
- #ac1900
+ #ff6f00
+ #c43e00
#000000
#ff833a
- #e65100
- #ac1900
+ #ff6f00
+ #c43e00
#FFFFFF
#ff833a
diff --git a/app/src/main/res/values/settings_keys.xml b/app/src/main/res/values/settings_keys.xml
index c5f5cde78..dcf39b488 100644
--- a/app/src/main/res/values/settings_keys.xml
+++ b/app/src/main/res/values/settings_keys.xml
@@ -145,7 +145,6 @@
GB
content_language
peertube_instance_url
- Find the instance that best suits you on https://instances.joinpeertube.org
peertube_instance_name
content_country
show_age_restricted_content
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 08978e014..52b56a7b8 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -110,6 +110,7 @@
Service
Default content language
PeerTube instance
+ Find the instance that best suits you on https://instances.joinpeertube.org
Player
Behavior
Video & audio
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index caa332261..ba3fe78d5 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -44,8 +44,8 @@
- @drawable/ic_pause_black_24dp
- @drawable/ic_settings_black_24dp
- @drawable/ic_whatshot_black_24dp
- - @drawable/ic_kiosklocal_black_24dp
- - @drawable/ic_kioskrecent_black_24dp
+ - @drawable/ic_kiosk_local_black_24dp
+ - @drawable/ic_kiosk_recent_black_24dp
- @drawable/ic_channel_black_24dp
- @drawable/ic_bookmark_black_24dp
- @drawable/ic_playlist_add_black_24dp
@@ -110,8 +110,8 @@
- @drawable/ic_play_arrow_white_24dp
- @drawable/ic_settings_white_24dp
- @drawable/ic_whatshot_white_24dp
- - @drawable/ic_kiosklocal_white_24dp
- - @drawable/ic_kioskrecent_white_24dp
+ - @drawable/ic_kiosk_local_white_24dp
+ - @drawable/ic_kiosk_recent_white_24dp
- @drawable/ic_channel_white_24dp
- @drawable/ic_bookmark_white_24dp
- @drawable/ic_playlist_add_white_24dp