aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-04-06 09:11:59 -0700
committerScott Jackson <daneren2005@gmail.com>2015-04-06 09:11:59 -0700
commit9134077d785986ad1432018939daee05229430a7 (patch)
treee966bae40b4e40c994258bb13bddcf00eec2ad9d /src
parent3a9bf492cf45443b28d2a87b4dbcd89342f87a69 (diff)
downloaddsub-9134077d785986ad1432018939daee05229430a7.tar.gz
dsub-9134077d785986ad1432018939daee05229430a7.tar.bz2
dsub-9134077d785986ad1432018939daee05229430a7.zip
#482 Fix share url being wrong in Ampache
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/service/parser/ShareParser.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/service/parser/ShareParser.java b/src/github/daneren2005/dsub/service/parser/ShareParser.java
index fdad8375..375629d9 100644
--- a/src/github/daneren2005/dsub/service/parser/ShareParser.java
+++ b/src/github/daneren2005/dsub/service/parser/ShareParser.java
@@ -20,6 +20,7 @@ package github.daneren2005.dsub.service.parser;
import android.content.Context;
import android.content.SharedPreferences;
+import android.util.Log;
import github.daneren2005.dsub.R;
import github.daneren2005.dsub.domain.ServerInfo;
@@ -83,7 +84,13 @@ public class ShareParser extends MusicDirectoryEntryParser {
} catch (Exception e) {
share.setCreated((Date) null);
}
- share.setUrl(get("url").replaceFirst(".*/([^/?]+).*", serverUrl + "$1"));
+
+ String url = get("url");
+ if(url != null && url.indexOf(".php") == -1) {
+ url = url.replaceFirst(".*/([^/?]+).*", serverUrl + "$1");
+ }
+ share.setUrl(url);
+
share.setDescription(get("description"));
try {