diff options
author | Scott Jackson <daneren2005@gmail.com> | 2013-06-27 20:00:14 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2013-06-27 20:00:14 -0700 |
commit | 08ddea6128d2ffeda1a51cc58ca8ae1c2b8a1282 (patch) | |
tree | 25a7941313219e25c86ae246ba78f451a03073a1 /subsonic-android/src/github/daneren2005 | |
parent | fb8cb08404e0ca2bba59331278e039b72d984203 (diff) | |
download | dsub-08ddea6128d2ffeda1a51cc58ca8ae1c2b8a1282.tar.gz dsub-08ddea6128d2ffeda1a51cc58ca8ae1c2b8a1282.tar.bz2 dsub-08ddea6128d2ffeda1a51cc58ca8ae1c2b8a1282.zip |
Fix for older versions of server showing all podcasts together
Diffstat (limited to 'subsonic-android/src/github/daneren2005')
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java | 2 | ||||
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/service/parser/PodcastEntryParser.java | 18 |
2 files changed, 14 insertions, 6 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java b/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java index ffa8e676..22e7f8e9 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java @@ -900,7 +900,7 @@ public class RESTMusicService implements MusicService { public MusicDirectory getPodcastEpisodes(String id, Context context, ProgressListener progressListener) throws Exception { Reader reader = getReader(context, progressListener, "getPodcasts", null, Arrays.asList("id"), Arrays.<Object>asList(id)); try { - return new PodcastEntryParser(context).parse(reader, progressListener); + return new PodcastEntryParser(context).parse(id, reader, progressListener); } finally { Util.close(reader); } diff --git a/subsonic-android/src/github/daneren2005/dsub/service/parser/PodcastEntryParser.java b/subsonic-android/src/github/daneren2005/dsub/service/parser/PodcastEntryParser.java index efc36a7e..8ef667f4 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/parser/PodcastEntryParser.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/parser/PodcastEntryParser.java @@ -37,26 +37,34 @@ public class PodcastEntryParser extends AbstractParser { super(context);
}
- public MusicDirectory parse(Reader reader, ProgressListener progressListener) throws Exception {
+ public MusicDirectory parse(String channel, Reader reader, ProgressListener progressListener) throws Exception {
updateProgress(progressListener, R.string.parser_reading);
init(reader);
MusicDirectory episodes = new MusicDirectory();
int eventType;
+ boolean valid = false;
do {
eventType = nextParseEvent();
if (eventType == XmlPullParser.START_TAG) {
String name = getElementName();
if ("channel".equals(name)) {
- episodes.setId(get("id"));
- episodes.setName(get("title"));
+ String id = get("id");
+ if(id.equals(channel)) {
+ episodes.setId(id);
+ episodes.setName(get("title"));
+ valid = true;
+ } else {
+ valid = false;
+ }
}
- else if ("episode".equals(name)) {
+ else if ("episode".equals(name) && valid) {
PodcastEpisode episode = new PodcastEpisode();
episode.setEpisodeId(get("id"));
episode.setId(get("streamId"));
episode.setTitle(get("title"));
- episode.setDescription(get("description"));
+ episode.setArtist(episodes.getName());
+ episode.setAlbum(get("description"));
episode.setDate(get("publishDate"));
episode.setStatus(get("status"));
episode.setCoverArt(get("coverArt"));
|