aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-01-24 16:49:43 -0800
committerScott Jackson <daneren2005@gmail.com>2015-01-24 16:49:43 -0800
commit3f1488fe6f15d114aedc5da35ca0ae413d19045b (patch)
treef5938b2b1d6670ed6f7d894095d175085c5d87b3
parente706d46fad8158069ecc0f7f28db7bf4021bf612 (diff)
downloaddsub-3f1488fe6f15d114aedc5da35ca0ae413d19045b.tar.gz
dsub-3f1488fe6f15d114aedc5da35ca0ae413d19045b.tar.bz2
dsub-3f1488fe6f15d114aedc5da35ca0ae413d19045b.zip
Fix casting online songs in offline mode to DLNA
-rw-r--r--src/github/daneren2005/dsub/service/DLNAController.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/service/DLNAController.java b/src/github/daneren2005/dsub/service/DLNAController.java
index c1ac4d09..5d87e478 100644
--- a/src/github/daneren2005/dsub/service/DLNAController.java
+++ b/src/github/daneren2005/dsub/service/DLNAController.java
@@ -331,13 +331,20 @@ public class DLNAController extends RemoteController {
// Get url for entry
MusicService musicService = MusicServiceFactory.getMusicService(downloadService);
String url;
+ // In offline mode or playing offline song
if(Util.isOffline(downloadService) || song.getId().indexOf(rootLocation) != -1) {
if(proxy == null) {
proxy = new FileProxy(downloadService);
proxy.start();
}
- url = proxy.getPublicAddress(song.getId());
+ // Offline song
+ if(song.getId().indexOf(rootLocation) != -1) {
+ url = proxy.getPublicAddress(song.getId());
+ } else {
+ // Playing online song in offline mode
+ url = proxy.getPublicAddress(currentPlaying.getCompleteFile().getPath());
+ }
} else {
if(proxy != null) {
proxy.stop();