mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 01:53:31 +00:00
Fix crash when getting context in an observable
This commit is contained in:
parent
575c77baf9
commit
3de858e3d9
3 changed files with 15 additions and 5 deletions
|
|
@ -13,6 +13,7 @@ import com.cappielloantonio.play.repository.QueueRepository;
|
|||
import com.cappielloantonio.play.repository.SongRepository;
|
||||
import com.cappielloantonio.play.service.MusicPlayerRemote;
|
||||
import com.cappielloantonio.play.util.DownloadUtil;
|
||||
import com.cappielloantonio.play.util.PreferenceUtil;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
|
@ -53,7 +54,10 @@ public class PlayerBottomSheetViewModel extends AndroidViewModel {
|
|||
} else {
|
||||
songRepository.star(song.getId());
|
||||
song.setFavorite(true);
|
||||
DownloadUtil.getDownloadTracker(context).download(Collections.singletonList(song), null, null);
|
||||
|
||||
if(PreferenceUtil.getInstance(context).isStarredSyncEnabled()) {
|
||||
DownloadUtil.getDownloadTracker(context).download(Collections.singletonList(song), null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue