Skip to content

Commit

Permalink
Removed the "(beta)"-tag from services (#8637)
Browse files Browse the repository at this point in the history
  • Loading branch information
litetex committed Jul 24, 2022
1 parent 8f37015 commit 51e72d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
9 changes: 4 additions & 5 deletions app/src/main/java/org/schabi/newpipe/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -374,26 +374,25 @@ private void toggleServices() {

private void showServices() {
for (final StreamingService s : NewPipe.getServices()) {
final String title = s.getServiceInfo().getName()
+ (ServiceHelper.isBeta(s) ? " (beta)" : "");
final String title = s.getServiceInfo().getName();

final MenuItem menuItem = drawerLayoutBinding.navigation.getMenu()
.add(R.id.menu_services_group, s.getServiceId(), ORDER, title)
.setIcon(ServiceHelper.getIcon(s.getServiceId()));

// peertube specifics
if (s.getServiceId() == 3) {
enhancePeertubeMenu(s, menuItem);
enhancePeertubeMenu(menuItem);
}
}
drawerLayoutBinding.navigation.getMenu()
.getItem(ServiceHelper.getSelectedServiceId(this))
.setChecked(true);
}

private void enhancePeertubeMenu(final StreamingService s, final MenuItem menuItem) {
private void enhancePeertubeMenu(final MenuItem menuItem) {
final PeertubeInstance currentInstance = PeertubeHelper.getCurrentInstance();
menuItem.setTitle(currentInstance.getName() + (ServiceHelper.isBeta(s) ? " (beta)" : ""));
menuItem.setTitle(currentInstance.getName());
final Spinner spinner = InstanceSpinnerLayoutBinding.inflate(LayoutInflater.from(this))
.getRoot();
final List<PeertubeInstance> instances = PeertubeHelper.getInstanceList(this);
Expand Down
9 changes: 0 additions & 9 deletions app/src/main/java/org/schabi/newpipe/util/ServiceHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,6 @@ public static long getCacheExpirationMillis(final int serviceId) {
}
}

public static boolean isBeta(final StreamingService s) {
switch (s.getServiceInfo().getName()) {
case "YouTube":
return false;
default:
return true;
}
}

public static void initService(final Context context, final int serviceId) {
if (serviceId == ServiceList.PeerTube.getServiceId()) {
final SharedPreferences sharedPreferences = PreferenceManager
Expand Down

0 comments on commit 51e72d1

Please sign in to comment.