1. Julian Brost
  2. volksempfaenger

Commits

Vincent Schüßler  committed 93b352f

Stream episode if it has not been downloaded

  • Participants
  • Parent commits 0afe0b1
  • Branches default

Comments (0)

Files changed (2)

File src/net/x4a42/volksempfaenger/service/PlaybackService.java

View file
 				new String[] { Episode._ID, Episode.TITLE, Episode.STATUS,
 						Episode.PODCAST_ID, Episode.ENCLOSURE_ID,
 						Episode.DOWNLOAD_ID, Episode.DOWNLOAD_LOCAL_URI,
-						Episode.DURATION_LISTENED, Episode.PODCAST_TITLE },
-				null, null, null));
+						Episode.DURATION_LISTENED, Episode.PODCAST_TITLE,
+						Episode.ENCLOSURE_URL }, null, null, null));
 
 		if (!cursor.moveToFirst()) {
 			throw new IllegalArgumentException("Episode not found");
 		}
 		File enclosureFile = cursor.getDownloadFile();
+		String path;
 		if (enclosureFile == null || !enclosureFile.isFile()) {
-			throw new IllegalArgumentException("Episode not found");
+			path = cursor.getEnclosureUrl();
+		} else {
+			path = enclosureFile.getAbsolutePath();
 		}
-		helper.open(enclosureFile.getAbsolutePath());
+		helper.open(path);
 		ContentValues values = new ContentValues();
 		values.put(Episode.STATUS, Constants.EPISODE_STATE_LISTENING);
 		updateEpisode(values);

File src/net/x4a42/volksempfaenger/ui/ViewEpisodeActivity.java

View file
 
 			if (episodeCursor.getDownloadStatus() == DownloadManager.STATUS_SUCCESSFUL) {
 				menu.removeItem(R.id.item_download);
-			} else {
-				menu.removeItem(R.id.item_play);
 			}
 
 			if (remote.isPlaying()