mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 09:53:33 +00:00
29 lines
847 B
Java
29 lines
847 B
Java
package com.cappielloantonio.tempo.util;
|
|
|
|
import androidx.annotation.OptIn;
|
|
import androidx.media3.common.util.UnstableApi;
|
|
|
|
import com.cappielloantonio.tempo.subsonic.models.Artist;
|
|
import com.cappielloantonio.tempo.subsonic.models.Index;
|
|
import com.cappielloantonio.tempo.subsonic.models.Indexes;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.Collections;
|
|
import java.util.List;
|
|
|
|
@OptIn(markerClass = UnstableApi.class)
|
|
public class IndexUtil {
|
|
public static List<Artist> getArtist(Indexes indexes) {
|
|
if (indexes.getIndices() == null) return Collections.emptyList();
|
|
|
|
ArrayList<Artist> toReturn = new ArrayList<>();
|
|
|
|
for (Index index : indexes.getIndices()) {
|
|
if (index.getArtists() != null) {
|
|
toReturn.addAll(index.getArtists());
|
|
}
|
|
}
|
|
|
|
return toReturn;
|
|
}
|
|
}
|