mirror of
https://github.com/CappielloAntonio/tempo.git
synced 2026-02-01 23:13:36 +00:00
Saved in database downloaded playlists
This commit is contained in:
@@ -65,7 +65,7 @@ public class StarredSyncDialog extends DialogFragment {
|
||||
if (songs != null) {
|
||||
DownloadUtil.getDownloadTracker(context).download(
|
||||
MappingUtil.mapMediaItems(context, songs, false),
|
||||
MappingUtil.mapDownload(songs)
|
||||
MappingUtil.mapDownload(songs, null, null)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -110,7 +110,7 @@ public class AlbumPageFragment extends Fragment {
|
||||
if (isVisible() && getActivity() != null) {
|
||||
DownloadUtil.getDownloadTracker(requireContext()).download(
|
||||
MappingUtil.mapMediaItems(requireContext(), songs, false),
|
||||
MappingUtil.mapDownload(songs)
|
||||
MappingUtil.mapDownload(songs, null, null)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -107,12 +107,8 @@ public class PlaylistPageFragment extends Fragment {
|
||||
playlistPageViewModel.getPlaylistSongLiveList(requireActivity()).observe(requireActivity(), songs -> {
|
||||
if (isVisible() && getActivity() != null) {
|
||||
DownloadUtil.getDownloadTracker(requireContext()).download(
|
||||
MappingUtil.markPlaylistMediaItems(
|
||||
MappingUtil.mapMediaItems(requireContext(), songs, false),
|
||||
playlistPageViewModel.getPlaylist().getId(),
|
||||
playlistPageViewModel.getPlaylist().getName()
|
||||
),
|
||||
MappingUtil.mapDownload(songs)
|
||||
MappingUtil.mapMediaItems(requireContext(), songs, false),
|
||||
MappingUtil.mapDownload(songs, playlistPageViewModel.getPlaylist().getId(), playlistPageViewModel.getPlaylist().getName())
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -158,7 +158,7 @@ public class AlbumBottomSheetDialog extends BottomSheetDialogFragment implements
|
||||
|
||||
albumBottomSheetViewModel.getAlbumTracks().observe(requireActivity(), songs -> {
|
||||
List<MediaItem> mediaItems = MappingUtil.mapMediaItems(requireContext(), songs, false);
|
||||
List<Download> downloads = MappingUtil.mapDownload(songs);
|
||||
List<Download> downloads = MappingUtil.mapDownload(songs, null, null);
|
||||
|
||||
downloadAll.setOnClickListener(v -> {
|
||||
DownloadUtil.getDownloadTracker(requireContext()).download(mediaItems, downloads);
|
||||
|
||||
Reference in New Issue
Block a user