mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-02 18:31:40 +00:00
feat: folder navigation
This commit is contained in:
parent
e85d7f9198
commit
24d2d201ad
29 changed files with 1238 additions and 9 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue