1
0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2024-11-22 19:12:45 +01:00

more grammar fix

This commit is contained in:
yausername 2019-12-10 12:36:56 +05:30
parent fd5f4d9840
commit a0151f2a68
No known key found for this signature in database
GPG Key ID: F946F508AA241678
2 changed files with 8 additions and 7 deletions

View File

@ -36,7 +36,6 @@ 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 org.schabi.newpipe.util.Constants;
import org.schabi.newpipe.util.PeertubeHelper;
@ -219,7 +218,7 @@ public class PeertubeInstanceListFragment extends Fragment {
}
private void addInstance(String url) {
String cleanUrl = verifyUrl(url);
String cleanUrl = cleanUrl(url);
if(null == cleanUrl) return;
progressBar.setVisibility(View.VISIBLE);
Disposable disposable = Single.fromCallable(() -> {
@ -237,7 +236,7 @@ public class PeertubeInstanceListFragment extends Fragment {
}
@Nullable
private String verifyUrl(String url){
private String cleanUrl(String url){
// if protocol not present, add https
if(!url.startsWith("http")){
url = "https://" + url;
@ -246,13 +245,13 @@ public class PeertubeInstanceListFragment extends Fragment {
url = url.replaceAll("/$", "");
// only allow https
if (!url.startsWith("https://")) {
Toast.makeText(getActivity(), "instance url should start with https://", Toast.LENGTH_SHORT).show();
Toast.makeText(getActivity(), R.string.peertube_instance_add_https_only, Toast.LENGTH_SHORT).show();
return null;
}
// only allow if not already exists
for (PeertubeInstance instance : instanceList) {
if (instance.getUrl().equals(url)) {
Toast.makeText(getActivity(), "instance already exists", Toast.LENGTH_SHORT).show();
Toast.makeText(getActivity(), R.string.peertube_instance_add_exists, Toast.LENGTH_SHORT).show();
return null;
}
}

View File

@ -111,10 +111,12 @@
<string name="content_language_title">Default content language</string>
<string name="peertube_instance_url_title">PeerTube instances</string>
<string name="peertube_instance_url_summary">Set your favorite peertube instances</string>
<string name="peertube_instance_url_help">Find the instances that best suit you on https://instances.joinpeertube.org</string>
<string name="peertube_instance_url_help">Find the instances that best suit you on https://joinpeertube.org/instances#instances-list</string>
<string name="peertube_instance_add_title">Add instance</string>
<string name="peertube_instance_add_help">enter instance url</string>
<string name="peertube_instance_add_help">Enter instance url</string>
<string name="peertube_instance_add_fail">Failed to validate instance</string>
<string name="peertube_instance_add_https_only">Only https urls are supported</string>
<string name="peertube_instance_add_exists">Instance already exists</string>
<string name="settings_category_player_title">Player</string>
<string name="settings_category_player_behavior_title">Behavior</string>
<string name="settings_category_video_audio_title">Video &amp; audio</string>