mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 17:43:32 +00:00
feat: Load media downloaded as file for offline use
This commit is contained in:
parent
cce6456951
commit
3ba19be4d9
7 changed files with 170 additions and 15 deletions
|
|
@ -217,12 +217,20 @@ public class MappingUtil {
|
|||
}
|
||||
|
||||
private static Uri getUri(Child media) {
|
||||
if (Preferences.getDownloadDirectoryUri() != null) {
|
||||
Uri local = ExternalAudioReader.getUri(media);
|
||||
return local != null ? local : MusicUtil.getStreamUri(media.getId());
|
||||
}
|
||||
return DownloadUtil.getDownloadTracker(App.getContext()).isDownloaded(media.getId())
|
||||
? getDownloadUri(media.getId())
|
||||
: MusicUtil.getStreamUri(media.getId());
|
||||
}
|
||||
|
||||
private static Uri getUri(PodcastEpisode podcastEpisode) {
|
||||
if (Preferences.getDownloadDirectoryUri() != null) {
|
||||
Uri local = ExternalAudioReader.getUri(podcastEpisode);
|
||||
return local != null ? local : MusicUtil.getStreamUri(podcastEpisode.getStreamId());
|
||||
}
|
||||
return DownloadUtil.getDownloadTracker(App.getContext()).isDownloaded(podcastEpisode.getStreamId())
|
||||
? getDownloadUri(podcastEpisode.getStreamId())
|
||||
: MusicUtil.getStreamUri(podcastEpisode.getStreamId());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue