mirror of
https://github.com/CappielloAntonio/tempo.git
synced 2026-02-04 16:23:08 +00:00
Fix starred artists loading when there are no starred artists
This commit is contained in:
@@ -91,6 +91,10 @@ public class ArtistRepository {
|
|||||||
* Metodo che mi restituisce le informazioni essenzionali dell'artista (cover, numero di album...)
|
* Metodo che mi restituisce le informazioni essenzionali dell'artista (cover, numero di album...)
|
||||||
*/
|
*/
|
||||||
public void getArtistInfo(List<Artist> artists, MutableLiveData<List<Artist>> list) {
|
public void getArtistInfo(List<Artist> artists, MutableLiveData<List<Artist>> list) {
|
||||||
|
List<Artist> liveArtists = list.getValue();
|
||||||
|
if(liveArtists == null) liveArtists = new ArrayList<>();
|
||||||
|
list.setValue(liveArtists);
|
||||||
|
|
||||||
for (Artist artist : artists) {
|
for (Artist artist : artists) {
|
||||||
App.getSubsonicClientInstance(application, false)
|
App.getSubsonicClientInstance(application, false)
|
||||||
.getBrowsingClient()
|
.getBrowsingClient()
|
||||||
@@ -310,7 +314,6 @@ public class ArtistRepository {
|
|||||||
|
|
||||||
private void addToMutableLiveData(MutableLiveData<List<Artist>> liveData, Artist artist) {
|
private void addToMutableLiveData(MutableLiveData<List<Artist>> liveData, Artist artist) {
|
||||||
List<Artist> liveArtists = liveData.getValue();
|
List<Artist> liveArtists = liveData.getValue();
|
||||||
if(liveArtists == null) liveArtists = new ArrayList<>();
|
|
||||||
liveArtists.add(artist);
|
liveArtists.add(artist);
|
||||||
liveData.setValue(liveArtists);
|
liveData.setValue(liveArtists);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user