aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-06-26 23:02:28 -0700
committerScott Jackson <daneren2005@gmail.com>2013-06-26 23:02:28 -0700
commitfb8cb08404e0ca2bba59331278e039b72d984203 (patch)
tree0a436418dc31e9e891c1a81c662807b6ffde8d81
parent00da962eb40f571f433d4afb3dc81ab92b2c8630 (diff)
downloaddsub-fb8cb08404e0ca2bba59331278e039b72d984203.tar.gz
dsub-fb8cb08404e0ca2bba59331278e039b72d984203.tar.bz2
dsub-fb8cb08404e0ca2bba59331278e039b72d984203.zip
Add date in place of artist for Podcasts
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/view/SongView.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/view/SongView.java b/subsonic-android/src/github/daneren2005/dsub/view/SongView.java
index 6f594048..dfdd814e 100644
--- a/subsonic-android/src/github/daneren2005/dsub/view/SongView.java
+++ b/subsonic-android/src/github/daneren2005/dsub/view/SongView.java
@@ -26,13 +26,14 @@ import android.view.View;
import android.widget.*;
import github.daneren2005.dsub.R;
import github.daneren2005.dsub.domain.MusicDirectory;
+import github.daneren2005.dsub.domain.PodcastEpisode;
import github.daneren2005.dsub.service.DownloadService;
import github.daneren2005.dsub.service.DownloadServiceImpl;
import github.daneren2005.dsub.service.DownloadFile;
import github.daneren2005.dsub.util.Util;
-import github.daneren2005.dsub.view.UpdateView;
import java.io.File;
+import java.text.DateFormat;
/**
* Used to display songs in a {@code ListView}.
@@ -89,6 +90,10 @@ public class SongView extends UpdateView implements Checkable {
if(!song.isVideo()) {
if(song.getArtist() != null) {
artist.append(song.getArtist());
+ } else if(song instanceof PodcastEpisode) {
+ String date = ((PodcastEpisode)song).getDate();
+ int index = date.indexOf(" ");
+ artist.append(date.substring(0, index != -1 ? index : date.length()));
}
artist.append(" (")
.append(String.format(getContext().getString(R.string.song_details_all), bitRate == null ? "" : bitRate, fileFormat))