aboutsummaryrefslogtreecommitdiff
path: root/src/github/daneren2005
diff options
context:
space:
mode:
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r--src/github/daneren2005/dsub/fragments/MainFragment.java2
-rw-r--r--src/github/daneren2005/dsub/service/DownloadService.java3
-rw-r--r--src/github/daneren2005/dsub/util/MediaRouteManager.java6
-rw-r--r--src/github/daneren2005/dsub/util/UserUtil.java8
4 files changed, 16 insertions, 3 deletions
diff --git a/src/github/daneren2005/dsub/fragments/MainFragment.java b/src/github/daneren2005/dsub/fragments/MainFragment.java
index 691000e3..c673fc12 100644
--- a/src/github/daneren2005/dsub/fragments/MainFragment.java
+++ b/src/github/daneren2005/dsub/fragments/MainFragment.java
@@ -209,7 +209,7 @@ public class MainFragment extends SubsonicFragment {
}
Util.setActiveServer(context, instance);
context.invalidate();
- UserUtil.seedCurrentUser(context);
+ UserUtil.refreshCurrentUser(context);
}
}
diff --git a/src/github/daneren2005/dsub/service/DownloadService.java b/src/github/daneren2005/dsub/service/DownloadService.java
index 99056ea2..7bf04936 100644
--- a/src/github/daneren2005/dsub/service/DownloadService.java
+++ b/src/github/daneren2005/dsub/service/DownloadService.java
@@ -561,6 +561,9 @@ public class DownloadService extends Service {
}
});
}
+ public void userSettingsChanged() {
+ mediaRouter.buildSelector();
+ }
public synchronized int size() {
return downloadList.size();
diff --git a/src/github/daneren2005/dsub/util/MediaRouteManager.java b/src/github/daneren2005/dsub/util/MediaRouteManager.java
index cad8afe3..347b0376 100644
--- a/src/github/daneren2005/dsub/util/MediaRouteManager.java
+++ b/src/github/daneren2005/dsub/util/MediaRouteManager.java
@@ -157,9 +157,11 @@ public class MediaRouteManager extends MediaRouter.Callback {
addOfflineProviders();
}
}
- private void buildSelector() {
+ public void buildSelector() {
MediaRouteSelector.Builder builder = new MediaRouteSelector.Builder();
- builder.addControlCategory(JukeboxRouteProvider.CATEGORY_JUKEBOX_ROUTE);
+ if(UserUtil.canJukebox()) {
+ builder.addControlCategory(JukeboxRouteProvider.CATEGORY_JUKEBOX_ROUTE);
+ }
if(castAvailable) {
builder.addControlCategory(CastCompat.getCastControlCategory());
}
diff --git a/src/github/daneren2005/dsub/util/UserUtil.java b/src/github/daneren2005/dsub/util/UserUtil.java
index 2d42133f..7a93f535 100644
--- a/src/github/daneren2005/dsub/util/UserUtil.java
+++ b/src/github/daneren2005/dsub/util/UserUtil.java
@@ -32,6 +32,7 @@ import java.io.File;
import github.daneren2005.dsub.R;
import github.daneren2005.dsub.domain.User;
import github.daneren2005.dsub.fragments.SubsonicFragment;
+import github.daneren2005.dsub.service.DownloadService;
import github.daneren2005.dsub.service.MusicService;
import github.daneren2005.dsub.service.MusicServiceFactory;
import github.daneren2005.dsub.service.OfflineException;
@@ -65,6 +66,13 @@ public final class UserUtil {
@Override
protected Void doInBackground() throws Throwable {
currentUser = MusicServiceFactory.getMusicService(context).getUser(false, getCurrentUsername(context, instance), context, null);
+
+ // If running, redo cast selector
+ DownloadService downloadService = DownloadService.getInstance();
+ if(downloadService != null) {
+ downloadService.userSettingsChanged();
+ }
+
return null;
}