mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 17:43:32 +00:00
35 lines
1 KiB
Java
35 lines
1 KiB
Java
package com.cappielloantonio.tempo.viewmodel;
|
|
|
|
import android.app.Application;
|
|
|
|
import androidx.annotation.NonNull;
|
|
import androidx.lifecycle.AndroidViewModel;
|
|
import androidx.lifecycle.MutableLiveData;
|
|
|
|
import com.cappielloantonio.tempo.repository.DirectoryRepository;
|
|
import com.cappielloantonio.tempo.subsonic.models.Indexes;
|
|
import com.cappielloantonio.tempo.subsonic.models.MusicFolder;
|
|
|
|
public class IndexViewModel extends AndroidViewModel {
|
|
private final DirectoryRepository directoryRepository;
|
|
|
|
private MusicFolder musicFolder;
|
|
|
|
public IndexViewModel(@NonNull Application application) {
|
|
super(application);
|
|
|
|
directoryRepository = new DirectoryRepository();
|
|
}
|
|
|
|
public MutableLiveData<Indexes> getIndexes(String musicFolderId) {
|
|
return directoryRepository.getIndexes(musicFolderId, null);
|
|
}
|
|
|
|
public String getMusicFolderName() {
|
|
return musicFolder != null ? musicFolder.getName() : "";
|
|
}
|
|
|
|
public void setMusicFolder(MusicFolder musicFolder) {
|
|
this.musicFolder = musicFolder;
|
|
}
|
|
}
|