fix: updated song bottom sheet to match album/artist bottom sheets

This commit is contained in:
eddyizm 2026-01-04 11:31:53 -08:00
parent 6110a9c8e7
commit 431014adc4
No known key found for this signature in database
GPG key ID: CF5F671829E8158A
2 changed files with 102 additions and 25 deletions

View file

@ -10,6 +10,7 @@ import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.media3.common.util.UnstableApi;
import com.cappielloantonio.tempo.interfaces.MediaCallback;
import com.cappielloantonio.tempo.interfaces.StarCallback;
import com.cappielloantonio.tempo.model.Download;
import com.cappielloantonio.tempo.repository.AlbumRepository;
@ -134,6 +135,17 @@ public class SongBottomSheetViewModel extends AndroidViewModel {
return instantMix;
}
public void getInstantMix(Child media, int count, MediaCallback callback) {
songRepository.getInstantMix(media.getId(), SeedType.TRACK, count, songs -> {
if (songs != null && !songs.isEmpty()) {
callback.onLoadMedia(songs);
} else {
callback.onLoadMedia(Collections.emptyList());
}
});
}
public MutableLiveData<Share> shareTrack() {
return sharingRepository.createShare(song.getId(), song.getTitle(), null);
}