mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 09:33:33 +00:00
fix: skip mapping downloaded item (#228)
This commit is contained in:
commit
7457c5b6e3
1 changed files with 7 additions and 0 deletions
|
|
@ -116,6 +116,13 @@ public class MappingUtil {
|
|||
}
|
||||
|
||||
public static MediaItem mapMediaItem(MediaItem old) {
|
||||
String mediaId = null;
|
||||
if (old.requestMetadata.extras != null)
|
||||
mediaId = old.requestMetadata.extras.getString("id");
|
||||
|
||||
if (mediaId != null && DownloadUtil.getDownloadTracker(App.getContext()).isDownloaded(mediaId)) {
|
||||
return old;
|
||||
}
|
||||
Uri uri = old.requestMetadata.mediaUri == null ? null : MusicUtil.updateStreamUri(old.requestMetadata.mediaUri);
|
||||
return new MediaItem.Builder()
|
||||
.setMediaId(old.mediaId)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue