2023-06-17 15:30:23 +02:00
|
|
|
package com.cappielloantonio.tempo.viewmodel;
|
2023-06-04 19:38:24 +02:00
|
|
|
|
|
|
|
|
import android.app.Application;
|
|
|
|
|
|
|
|
|
|
import androidx.annotation.NonNull;
|
|
|
|
|
import androidx.lifecycle.AndroidViewModel;
|
|
|
|
|
|
2023-06-17 15:30:23 +02:00
|
|
|
import com.cappielloantonio.tempo.repository.PodcastRepository;
|
|
|
|
|
import com.cappielloantonio.tempo.subsonic.models.PodcastEpisode;
|
2023-06-04 19:38:24 +02:00
|
|
|
|
|
|
|
|
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());
|
|
|
|
|
}
|
|
|
|
|
}
|