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.PodcastChannel;
|
2023-06-04 19:38:24 +02:00
|
|
|
|
|
|
|
|
public class PodcastChannelBottomSheetViewModel extends AndroidViewModel {
|
|
|
|
|
private final PodcastRepository podcastRepository;
|
|
|
|
|
|
|
|
|
|
private PodcastChannel podcastChannel;
|
|
|
|
|
|
|
|
|
|
public PodcastChannelBottomSheetViewModel(@NonNull Application application) {
|
|
|
|
|
super(application);
|
|
|
|
|
|
|
|
|
|
podcastRepository = new PodcastRepository();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public PodcastChannel getPodcastChannel() {
|
|
|
|
|
return podcastChannel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setPodcastChannel(PodcastChannel podcastChannel) {
|
|
|
|
|
this.podcastChannel = podcastChannel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void deletePodcastChannel() {
|
|
|
|
|
if (podcastChannel != null) podcastRepository.deletePodcastChannel(podcastChannel.getId());
|
|
|
|
|
}
|
|
|
|
|
}
|