mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-02 18:31:40 +00:00
feat: add functionality to delete podcast episodes and channels via bottom sheet
This commit is contained in:
parent
675ad1e9a6
commit
0248187f41
13 changed files with 336 additions and 82 deletions
|
|
@ -0,0 +1,33 @@
|
|||
package com.cappielloantonio.play.viewmodel;
|
||||
|
||||
import android.app.Application;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.AndroidViewModel;
|
||||
|
||||
import com.cappielloantonio.play.repository.PodcastRepository;
|
||||
import com.cappielloantonio.play.subsonic.models.PodcastEpisode;
|
||||
|
||||
public class PodcastEpisodeBottomSheetViewModel extends AndroidViewModel {
|
||||
private final PodcastRepository podcastRepository;
|
||||
|
||||
private PodcastEpisode podcastEpisode;
|
||||
|
||||
public PodcastEpisodeBottomSheetViewModel(@NonNull Application application) {
|
||||
super(application);
|
||||
|
||||
podcastRepository = new PodcastRepository();
|
||||
}
|
||||
|
||||
public PodcastEpisode getPodcastEpisode() {
|
||||
return podcastEpisode;
|
||||
}
|
||||
|
||||
public void setPodcastEpisode(PodcastEpisode podcast) {
|
||||
this.podcastEpisode = podcast;
|
||||
}
|
||||
|
||||
public void deletePodcastEpisode() {
|
||||
if (podcastEpisode != null) podcastRepository.deletePodcastEpisode(podcastEpisode.getId());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue