mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 18:03:33 +00:00
Saved in database downloaded playlists
This commit is contained in:
parent
b41e3e641b
commit
d2ad0188b7
6 changed files with 16 additions and 32 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue