feat: folder navigation

This commit is contained in:
antonio 2023-05-27 11:57:59 +02:00
parent e85d7f9198
commit 24d2d201ad
29 changed files with 1238 additions and 9 deletions

View file

@ -14,6 +14,9 @@ object Constants {
const val PODCAST_OBJECT = "PODCAST_OBJECT"
const val PODCAST_CHANNEL_OBJECT = "PODCAST_CHANNEL_OBJECT"
const val INTERNET_RADIO_STATION_OBJECT = "INTERNET_RADIO_STATION_OBJECT"
const val MUSIC_FOLDER_OBJECT = "MUSIC_FOLDER_OBJECT"
const val MUSIC_DIRECTORY_OBJECT = "MUSIC_DIRECTORY_OBJECT"
const val MUSIC_INDEX_OBJECT = "MUSIC_DIRECTORY_OBJECT"
const val ALBUM_RECENTLY_PLAYED = "ALBUM_RECENTLY_PLAYED"
const val ALBUM_MOST_PLAYED = "ALBUM_MOST_PLAYED"

View file

@ -0,0 +1,29 @@
package com.cappielloantonio.play.util;
import androidx.annotation.OptIn;
import androidx.media3.common.util.UnstableApi;
import com.cappielloantonio.play.subsonic.models.Artist;
import com.cappielloantonio.play.subsonic.models.Index;
import com.cappielloantonio.play.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;
}
}