Przeglądaj źródła

Update release channel option labels

Closes #2818
Matt Seeley 7 lat temu
rodzic
commit
5ce74ef65d
1 zmienionych plików z 28 dodań i 33 usunięć
  1. 28 33
      src/settings/SettingsComponent.cpp

+ 28 - 33
src/settings/SettingsComponent.cpp

@@ -703,39 +703,34 @@ void SettingsComponent::setUserRoleList(const QStringList& userRoles)
 {
   QVariantList values;
 
-  // stable is always available
-  QVariantMap stable;
-  stable.insert("value", 0);
-  stable.insert("title", "Stable");
-
-  values << stable;
-
-  for(const QString& role : userRoles)
-  {
-    QVariantMap channel;
-    int value = 0;
-    QString title;
-
-    if (role == "ninja")
-    {
-      value = 4;
-      title = "Ninja";
-    }
-    else if (role == "plexpass")
-    {
-      value = 8;
-      title = "PlexPass";
-    }
-    else if (role == "employee")
-    {
-      value = 2;
-      title = "Employee";
-    }
-
-    channel.insert("value", value);
-    channel.insert("title", title);
-
-    values << channel;
+  // Channel names and values are aligned with values expected by plex.tv.
+  // See: https://github.com/plexinc/plex-media-player-private/issues/642
+
+  // Public is always available as the default value.
+  QVariantMap publicChannel;
+  publicChannel.insert("value", 0);
+  publicChannel.insert("title", "Public");
+  values << publicChannel;
+
+  if (userRoles.contains("plexpass")) {
+    QVariantMap betaChannel;
+    betaChannel.insert("value", 8);
+    betaChannel.insert("title", "Beta");
+    values << betaChannel;
+  }
+
+  if (userRoles.contains("ninja")) {
+    QVariantMap alphaChannel;
+    alphaChannel.insert("value", 4);
+    alphaChannel.insert("title", "Alpha");
+    values << alphaChannel;
+  }
+
+  if (userRoles.contains("employee")) {
+    QVariantMap qaChannel;
+    qaChannel.insert("value", 2);
+    qaChannel.insert("title", "QA");
+    values << qaChannel;
   }
 
   updatePossibleValues(SETTINGS_SECTION_MAIN, "updateChannel", values);