Commit ead2e2f1 authored by Duncan McNAMARA's avatar Duncan McNAMARA
Browse files

Medialibrary: move Artist to AArtist

parent 31f61415
......@@ -1759,8 +1759,8 @@ static JNINativeMethod methods[] = {
{"nativeSearchAlbum", "(Ljava/lang/String;)[Lorg/videolan/medialibrary/media/Album;", (void*)searchAlbum },
{"nativeSearchPagedAlbum", "(Ljava/lang/String;IZII)[Lorg/videolan/medialibrary/media/Album;", (void*)searchPagedAlbum },
{"nativeGetAlbumSearchCount", "(Ljava/lang/String;)I", (void*)getAlbumSearchCount },
{"nativeSearchArtist", "(Ljava/lang/String;)[Lorg/videolan/medialibrary/media/Artist;", (void*)searchArtist },
{"nativeSearchPagedArtist", "(Ljava/lang/String;IZII)[Lorg/videolan/medialibrary/media/Artist;", (void*)searchPagedArtist },
{"nativeSearchArtist", "(Ljava/lang/String;)[Lorg/videolan/medialibrary/interfaces/media/AArtist;", (void*)searchArtist },
{"nativeSearchPagedArtist", "(Ljava/lang/String;IZII)[Lorg/videolan/medialibrary/interfaces/media/AArtist;", (void*)searchPagedArtist },
{"nativeGetArtistsSearchCount", "(Ljava/lang/String;)I", (void*)getArtistsSearchCount },
{"nativeSearchGenre", "(Ljava/lang/String;)[Lorg/videolan/medialibrary/media/Genre;", (void*)searchGenre },
{"nativeSearchPagedGenre", "(Ljava/lang/String;IZII)[Lorg/videolan/medialibrary/media/Genre;", (void*)searchPagedGenre },
......@@ -1779,10 +1779,10 @@ static JNINativeMethod methods[] = {
{"nativeGetPagedAlbums", "(IZII)[Lorg/videolan/medialibrary/media/Album;", (void*)getPagedAlbums },
{"nativeGetAlbumsCount", "()I", (void*)getAlbumsCount },
{"nativeGetAlbum", "(J)Lorg/videolan/medialibrary/media/Album;", (void*)getAlbum },
{"nativeGetArtists", "(ZIZ)[Lorg/videolan/medialibrary/media/Artist;", (void*)getArtists },
{"nativeGetPagedArtists", "(ZIZII)[Lorg/videolan/medialibrary/media/Artist;", (void*)getPagedArtists },
{"nativeGetArtists", "(ZIZ)[Lorg/videolan/medialibrary/interfaces/media/AArtist;", (void*)getArtists },
{"nativeGetPagedArtists", "(ZIZII)[Lorg/videolan/medialibrary/interfaces/media/AArtist;", (void*)getPagedArtists },
{"nativeGetArtistsCount", "(Z)I", (void*)getArtistsCount },
{"nativeGetArtist", "(J)Lorg/videolan/medialibrary/media/Artist;", (void*)getArtist },
{"nativeGetArtist", "(J)Lorg/videolan/medialibrary/interfaces/media/AArtist;", (void*)getArtist },
{"nativeGetGenres", "(IZ)[Lorg/videolan/medialibrary/media/Genre;", (void*)getGenres },
{"nativeGetPagedGenres", "(IZII)[Lorg/videolan/medialibrary/media/Genre;", (void*)getPagedGenres },
{"nativeGetGenresCount", "()I", (void*)getGenresCount },
......@@ -1840,10 +1840,10 @@ static JNINativeMethod artist_methods[] = {
static JNINativeMethod genre_methods[] = {
{"nativeGetTracks", "(Lorg/videolan/medialibrary/Medialibrary;JIZ)[Lorg/videolan/medialibrary/interfaces/media/AMediaWrapper;", (void*)getMediaFromGenre },
{"nativeGetAlbums", "(Lorg/videolan/medialibrary/Medialibrary;JIZ)[Lorg/videolan/medialibrary/media/Album;", (void*)getAlbumsFromGenre },
{"nativeGetArtists", "(Lorg/videolan/medialibrary/Medialibrary;JIZ)[Lorg/videolan/medialibrary/media/Artist;", (void*)getArtistsFromGenre },
{"nativeGetArtists", "(Lorg/videolan/medialibrary/Medialibrary;JIZ)[Lorg/videolan/medialibrary/interfaces/media/AArtist;", (void*)getArtistsFromGenre },
{"nativeGetPagedTracks", "(Lorg/videolan/medialibrary/Medialibrary;JIZII)[Lorg/videolan/medialibrary/interfaces/media/AMediaWrapper;", (void*)getPagedMediaFromGenre },
{"nativeGetPagedAlbums", "(Lorg/videolan/medialibrary/Medialibrary;JIZII)[Lorg/videolan/medialibrary/media/Album;", (void*)getPagedAlbumsFromGenre },
{"nativeGetPagedArtists", "(Lorg/videolan/medialibrary/Medialibrary;JIZII)[Lorg/videolan/medialibrary/media/Artist;", (void*)getPagedArtistsFromGenre },
{"nativeGetPagedArtists", "(Lorg/videolan/medialibrary/Medialibrary;JIZII)[Lorg/videolan/medialibrary/interfaces/media/AArtist;", (void*)getPagedArtistsFromGenre },
{"nativeSearch", "(Lorg/videolan/medialibrary/Medialibrary;JLjava/lang/String;IZII)[Lorg/videolan/medialibrary/interfaces/media/AMediaWrapper;", (void*)searchMediaFromGenre },
{"nativeSearchAlbums", "(Lorg/videolan/medialibrary/Medialibrary;JLjava/lang/String;IZII)[Lorg/videolan/medialibrary/media/Album;", (void*)searchAlbumsFromGenre },
{"nativeGetTracksCount", "(Lorg/videolan/medialibrary/Medialibrary;J)I", (void*)getGenreTracksCount },
......@@ -2008,7 +2008,7 @@ jint JNI_OnLoad(JavaVM *vm, void *reserved)
GET_ID(GetMethodID,
ml_fields.SearchAggregate.initID,
ml_fields.SearchAggregate.clazz,
"<init>", "([Lorg/videolan/medialibrary/media/Album;[Lorg/videolan/medialibrary/media/Artist;[Lorg/videolan/medialibrary/media/Genre;[Lorg/videolan/medialibrary/interfaces/media/AMediaWrapper;[Lorg/videolan/medialibrary/interfaces/media/AMediaWrapper;[Lorg/videolan/medialibrary/media/Playlist;)V");
"<init>", "([Lorg/videolan/medialibrary/media/Album;[Lorg/videolan/medialibrary/interfaces/media/AArtist;[Lorg/videolan/medialibrary/media/Genre;[Lorg/videolan/medialibrary/interfaces/media/AMediaWrapper;[Lorg/videolan/medialibrary/interfaces/media/AMediaWrapper;[Lorg/videolan/medialibrary/media/Playlist;)V");
GET_CLASS(ml_fields.Folder.clazz, "org/videolan/medialibrary/media/Folder", true);
......
......@@ -33,12 +33,11 @@ import android.util.Log;
import org.videolan.libvlc.LibVLC;
import org.videolan.medialibrary.interfaces.DevicesDiscoveryCb;
import org.videolan.medialibrary.interfaces.EntryPointsEventsCb;
import org.videolan.medialibrary.interfaces.media.AArtist;
import org.videolan.medialibrary.interfaces.media.AMediaWrapper;
import org.videolan.medialibrary.media.Album;
import org.videolan.medialibrary.media.Artist;
import org.videolan.medialibrary.media.Folder;
import org.videolan.medialibrary.media.Genre;
import org.videolan.medialibrary.media.MediaWrapper;
import org.videolan.medialibrary.media.Playlist;
import org.videolan.medialibrary.media.SearchAggregate;
......@@ -298,18 +297,18 @@ public class Medialibrary {
}
@WorkerThread
public Artist[] getArtists(boolean all) {
public AArtist[] getArtists(boolean all) {
return getArtists(all, Medialibrary.SORT_DEFAULT, false);
}
@WorkerThread
public Artist[] getArtists(boolean all, int sort, boolean desc) {
return mIsInitiated ? nativeGetArtists(all, sort, desc) : new Artist[0];
public AArtist[] getArtists(boolean all, int sort, boolean desc) {
return mIsInitiated ? nativeGetArtists(all, sort, desc) : new AArtist[0];
}
@WorkerThread
public Artist[] getPagedArtists(boolean all, int sort, boolean desc, int nbItems, int offset) {
return mIsInitiated ? nativeGetPagedArtists(all, sort, desc, nbItems, offset) : new Artist[0];
public AArtist[] getPagedArtists(boolean all, int sort, boolean desc, int nbItems, int offset) {
return mIsInitiated ? nativeGetPagedArtists(all, sort, desc, nbItems, offset) : new AArtist[0];
}
public int getArtistsCount(boolean all) {
......@@ -320,7 +319,7 @@ public class Medialibrary {
return mIsInitiated ? nativeGetArtistsSearchCount(query) : 0;
}
public Artist getArtist(long artistId) {
public AArtist getArtist(long artistId) {
return mIsInitiated ? nativeGetArtist(artistId) : null;
}
......@@ -849,12 +848,12 @@ public class Medialibrary {
return mIsInitiated ? nativeGetSearchVideoCount(query) : 0;
}
public Artist[] searchArtist(String query) {
public AArtist[] searchArtist(String query) {
return mIsInitiated && !TextUtils.isEmpty(query) ? nativeSearchArtist(query) : null;
}
public Artist[] searchArtist(String query, int sort, boolean desc, int nbItems, int offset) {
return mIsInitiated && !TextUtils.isEmpty(query) ? nativeSearchPagedArtist(query, sort, desc, nbItems, offset) : new Artist[0];
public AArtist[] searchArtist(String query, int sort, boolean desc, int nbItems, int offset) {
return mIsInitiated && !TextUtils.isEmpty(query) ? nativeSearchPagedArtist(query, sort, desc, nbItems, offset) : new AArtist[0];
}
public Album[] searchAlbum(String query, int sort, boolean desc, int nbItems, int offset) {
......@@ -1005,10 +1004,10 @@ public class Medialibrary {
private native Album[] nativeGetPagedAlbums(int sort, boolean desc, int nbItems, int offset);
private native int nativeGetAlbumsCount();
private native Album nativeGetAlbum(long albumtId);
private native Artist[] nativeGetArtists(boolean all, int sort, boolean desc);
private native Artist[] nativeGetPagedArtists(boolean all, int sort, boolean desc, int nbItems, int offset);
private native AArtist[] nativeGetArtists(boolean all, int sort, boolean desc);
private native AArtist[] nativeGetPagedArtists(boolean all, int sort, boolean desc, int nbItems, int offset);
private native int nativeGetArtistsCount(boolean all);
private native Artist nativeGetArtist(long artistId);
private native AArtist nativeGetArtist(long artistId);
private native Genre[] nativeGetGenres(int sort, boolean desc);
private native Genre[] nativeGetPagedGenres(int sort, boolean desc, int nbItems, int offset);
private native int nativeGetGenresCount();
......@@ -1037,8 +1036,8 @@ public class Medialibrary {
private native int nativeGetSearchAudioCount(String query);
private native AMediaWrapper[] nativeSearchPagedVideo(String query, int sort, boolean desc, int nbItems, int offset);
private native int nativeGetSearchVideoCount(String query);
private native Artist[] nativeSearchArtist(String query);
private native Artist[] nativeSearchPagedArtist(String query, int sort, boolean desc, int nbItems, int offset);
private native AArtist[] nativeSearchArtist(String query);
private native AArtist[] nativeSearchPagedArtist(String query, int sort, boolean desc, int nbItems, int offset);
private native int nativeGetArtistsSearchCount(String query);
private native Album[] nativeSearchAlbum(String query);
private native Album[] nativeSearchPagedAlbum(String query, int sort, boolean desc, int nbItems, int offset);
......
......@@ -5,8 +5,11 @@ import android.net.Uri;
import android.os.Parcel;
import org.videolan.libvlc.Media;
import org.videolan.medialibrary.interfaces.media.AArtist;
import org.videolan.medialibrary.interfaces.media.AMediaWrapper;
import org.videolan.medialibrary.media.Artist;
import org.videolan.medialibrary.media.MediaWrapper;
import org.videolan.medialibrary.stubs.StubArtist;
import org.videolan.medialibrary.stubs.StubMediaWrapper;
public class ServiceLocator {
......@@ -86,4 +89,21 @@ public class ServiceLocator {
return new StubMediaWrapper(in);
}
}
//Artist
public static AArtist getAArtist(long id, String name, String shortBio, String artworkMrl, String musicBrainzId) {
if (mMode == LocatorMode.VLC_ANDROID) {
return new Artist(id, name, shortBio, artworkMrl, musicBrainzId);
} else {
return new StubArtist(id, name, shortBio, artworkMrl, musicBrainzId);
}
}
public static AArtist getAArtist(Parcel in) {
if (mMode == LocatorMode.VLC_ANDROID) {
return new Artist(in);
} else {
return new StubArtist(in);
}
}
}
package org.videolan.medialibrary.interfaces.media;
import android.os.Parcel;
import android.os.Parcelable;
import org.videolan.libvlc.util.VLCUtil;
import org.videolan.medialibrary.Medialibrary;
import org.videolan.medialibrary.R;
import org.videolan.medialibrary.ServiceLocator;
import org.videolan.medialibrary.media.Album;
import org.videolan.medialibrary.media.MediaLibraryItem;
abstract public class AArtist extends MediaLibraryItem {
private String shortBio;
private String artworkMrl;
private String musicBrainzId;
public static class SpecialRes {
public static String UNKNOWN_ARTIST = Medialibrary.getContext().getString(R.string.unknown_artist);
public static String VARIOUS_ARTISTS = Medialibrary.getContext().getString(R.string.various_artists);
}
public AArtist(long id, String name, String shortBio, String artworkMrl, String musicBrainzId) {
super(id, name);
this.shortBio = shortBio;
this.artworkMrl = artworkMrl != null ? VLCUtil.UriFromMrl(artworkMrl).getPath() : null;
this.musicBrainzId = musicBrainzId;
if (id == 1L) {
mTitle = SpecialRes.UNKNOWN_ARTIST;
} else if (id == 2L) {
mTitle = SpecialRes.VARIOUS_ARTISTS;
}
}
abstract public Album[] getAlbums(int sort, boolean desc);
abstract public Album[] getPagedAlbums(int sort, boolean desc, int nbItems, int offset);
abstract public Album[] searchAlbums(String query, int sort, boolean desc, int nbItems, int offset);
abstract public int searchAlbumsCount(String query);
abstract public AMediaWrapper[] searchTracks(String query, int sort, boolean desc, int nbItems, int offset);
abstract public int searchTracksCount(String query);
abstract public int getAlbumsCount();
abstract public AMediaWrapper[] getTracks(int sort, boolean desc);
abstract public AMediaWrapper[] getPagedTracks(int sort, boolean desc, int nbItems, int offset);
abstract public int getTracksCount();
public String getShortBio() {
return shortBio;
}
@Override
public String getArtworkMrl() {
return artworkMrl;
}
public String getMusicBrainzId() {
return musicBrainzId;
}
public void setShortBio(String shortBio) {
this.shortBio = shortBio;
}
public void setArtworkMrl(String artworkMrl) {
this.artworkMrl = artworkMrl;
}
public Album[] getAlbums() {
return getAlbums(Medialibrary.SORT_DEFAULT, false);
}
@Override
public AMediaWrapper[] getTracks() {
return getTracks(Medialibrary.SORT_ALBUM, true);
}
@Override
public int getItemType() {
return TYPE_ARTIST;
}
@Override
public void writeToParcel(Parcel parcel, int i) {
super.writeToParcel(parcel, i);
parcel.writeString(shortBio);
parcel.writeString(artworkMrl);
parcel.writeString(musicBrainzId);
}
public static Parcelable.Creator<AArtist> CREATOR
= new Parcelable.Creator<AArtist>() {
@Override
public AArtist createFromParcel(Parcel in) {
return ServiceLocator.getAArtist(in);
}
@Override
public AArtist[] newArray(int size) {
return new AArtist[size];
}
};
public AArtist(Parcel in) {
super(in);
this.shortBio = in.readString();
this.artworkMrl = in.readString();
this.musicBrainzId = in.readString();
}
}
......@@ -7,6 +7,7 @@ import android.text.TextUtils;
import org.videolan.libvlc.util.VLCUtil;
import org.videolan.medialibrary.Medialibrary;
import org.videolan.medialibrary.R;
import org.videolan.medialibrary.interfaces.media.AArtist;
import org.videolan.medialibrary.interfaces.media.AMediaWrapper;
@SuppressWarnings("JniMissingFunction")
......@@ -33,9 +34,9 @@ public class Album extends MediaLibraryItem {
this.duration = duration;
if (TextUtils.isEmpty(title)) mTitle = SpecialRes.UNKNOWN_ALBUM;
if (albumArtistId == 1L) {
this.albumArtist = Artist.SpecialRes.UNKNOWN_ARTIST;
this.albumArtist = AArtist.SpecialRes.UNKNOWN_ARTIST;
} else if (albumArtistId == 2L) {
this.albumArtist = Artist.SpecialRes.VARIOUS_ARTISTS;
this.albumArtist = AArtist.SpecialRes.VARIOUS_ARTISTS;
}
}
......@@ -58,7 +59,7 @@ public class Album extends MediaLibraryItem {
return artworkMrl;
}
public Artist getAlbumArtist() {
public AArtist getAlbumArtist() {
//TODO
return null;
}
......
package org.videolan.medialibrary.media;
import android.os.Parcel;
import android.os.Parcelable;
import org.videolan.libvlc.util.VLCUtil;
import org.videolan.medialibrary.Medialibrary;
import org.videolan.medialibrary.R;
import org.videolan.medialibrary.interfaces.media.AArtist;
import org.videolan.medialibrary.interfaces.media.AMediaWrapper;
import androidx.annotation.NonNull;
@SuppressWarnings("JniMissingFunction")
public class Artist extends MediaLibraryItem {
private String shortBio;
private String artworkMrl;
private String musicBrainzId;
static class SpecialRes {
static String UNKNOWN_ARTIST = Medialibrary.getContext().getString(R.string.unknown_artist);
static String VARIOUS_ARTISTS = Medialibrary.getContext().getString(R.string.various_artists);
}
public class Artist extends AArtist {
public Artist(long id, String name, String shortBio, String artworkMrl, String musicBrainzId) {
super(id, name);
this.shortBio = shortBio;
this.artworkMrl = artworkMrl != null ? VLCUtil.UriFromMrl(artworkMrl).getPath() : null;
this.musicBrainzId = musicBrainzId;
if (id == 1L) {
mTitle = SpecialRes.UNKNOWN_ARTIST;
} else if (id == 2L) {
mTitle = SpecialRes.VARIOUS_ARTISTS;
}
}
public String getShortBio() {
return shortBio;
}
@Override
public String getArtworkMrl() {
return artworkMrl;
super(id, name, shortBio, artworkMrl, musicBrainzId);
}
public String getMusicBrainzId() {
return musicBrainzId;
}
public void setShortBio(String shortBio) {
this.shortBio = shortBio;
}
public void setArtworkMrl(String artworkMrl) {
this.artworkMrl = artworkMrl;
}
public Album[] getAlbums() {
return getAlbums(Medialibrary.SORT_DEFAULT, false);
public Artist(Parcel in) {
super(in);
}
public Album[] getAlbums(int sort, boolean desc) {
......@@ -95,11 +55,6 @@ public class Artist extends MediaLibraryItem {
return ml.isInitiated() ? nativeGetAlbumsCount(ml, mId) : 0;
}
@Override
public AMediaWrapper[] getTracks() {
return getTracks(Medialibrary.SORT_ALBUM, true);
}
public AMediaWrapper[] getTracks(int sort, boolean desc) {
final Medialibrary ml = Medialibrary.getInstance();
return ml.isInitiated() ? nativeGetMedia(ml, mId, sort, desc) : Medialibrary.EMPTY_COLLECTION;
......@@ -116,11 +71,6 @@ public class Artist extends MediaLibraryItem {
return ml.isInitiated() ? nativeGetTracksCount(ml, mId) : 0;
}
@Override
public int getItemType() {
return TYPE_ARTIST;
}
private native Album[] nativeGetAlbums(Medialibrary ml, long mId, int sort, boolean desc);
private native AMediaWrapper[] nativeGetMedia(Medialibrary ml, long mId, int sort, boolean desc);
private native Album[] nativeGetPagedAlbums(Medialibrary ml, long mId, int sort, boolean desc, int nbItems, int offset);
......@@ -131,32 +81,4 @@ public class Artist extends MediaLibraryItem {
private native int nativeGetAlbumsCount(Medialibrary ml, long mId);
private native int nativeGetSearchCount(Medialibrary ml, long mId, String query);
private native int nativeGetSearchAlbumCount(Medialibrary ml, long mId, String query);
@Override
public void writeToParcel(Parcel parcel, int i) {
super.writeToParcel(parcel, i);
parcel.writeString(shortBio);
parcel.writeString(artworkMrl);
parcel.writeString(musicBrainzId);
}
public static Parcelable.Creator<Artist> CREATOR
= new Parcelable.Creator<Artist>() {
@Override
public Artist createFromParcel(Parcel in) {
return new Artist(in);
}
@Override
public Artist[] newArray(int size) {
return new Artist[size];
}
};
private Artist(Parcel in) {
super(in);
this.shortBio = in.readString();
this.artworkMrl = in.readString();
this.musicBrainzId = in.readString();
}
}
......@@ -4,6 +4,7 @@ import android.os.Parcel;
import android.os.Parcelable;
import org.videolan.medialibrary.Medialibrary;
import org.videolan.medialibrary.interfaces.media.AArtist;
import org.videolan.medialibrary.interfaces.media.AMediaWrapper;
import androidx.annotation.NonNull;
......@@ -30,13 +31,13 @@ public class Genre extends MediaLibraryItem {
return ml.isInitiated() ? nativeGetPagedAlbums(ml, mId, sort, desc, nbItems, offset) : new Album[0];
}
public Artist[] getArtists() {
public AArtist[] getArtists() {
return getArtists(Medialibrary.SORT_DEFAULT, false);
}
public Artist[] getArtists(int sort, boolean desc) {
public AArtist[] getArtists(int sort, boolean desc) {
final Medialibrary ml = Medialibrary.getInstance();
return ml.isInitiated() ? nativeGetArtists(ml, mId, sort, desc) : new Artist[0];
return ml.isInitiated() ? nativeGetArtists(ml, mId, sort, desc) : new AArtist[0];
}
@Override
......@@ -91,11 +92,11 @@ public class Genre extends MediaLibraryItem {
}
private native Album[] nativeGetAlbums(Medialibrary ml, long mId, int sort, boolean desc);
private native Artist[] nativeGetArtists(Medialibrary ml, long mId, int sort, boolean desc);
private native AArtist[] nativeGetArtists(Medialibrary ml, long mId, int sort, boolean desc);
private native AMediaWrapper[] nativeGetTracks(Medialibrary ml, long mId, int sort, boolean desc);
private native Album[] nativeGetPagedAlbums(Medialibrary ml, long mId, int sort, boolean desc, int nbItems, int offset);
private native Artist[] nativeGetPagedArtists(Medialibrary ml, long mId, int sort, boolean desc, int nbItems, int offset);
private native AArtist[] nativeGetPagedArtists(Medialibrary ml, long mId, int sort, boolean desc, int nbItems, int offset);
private native AMediaWrapper[] nativeGetPagedTracks(Medialibrary ml, long mId, int sort, boolean desc, int nbItems, int offset);
private native int nativeGetTracksCount(Medialibrary ml, long id);
private native int nativeGetAlbumsCount(Medialibrary ml, long mId);
......
package org.videolan.medialibrary.media;
import org.videolan.medialibrary.Tools;
import org.videolan.medialibrary.interfaces.media.AArtist;
import org.videolan.medialibrary.interfaces.media.AMediaWrapper;
public class SearchAggregate {
private static final String TAG = "VLC/SearchAggregate";
private final Album[] albums;
private final Artist[] artists;
private final AArtist[] artists;
private final Genre[] genres;
private final AMediaWrapper[] videos;
private final AMediaWrapper[] tracks;
......@@ -21,7 +22,7 @@ public class SearchAggregate {
this.tracks = null;
this.playlists = null;}
public SearchAggregate(Album[] albums, Artist[] artists, Genre[] genres, AMediaWrapper[] videos, AMediaWrapper[] tracks, Playlist[] playlists) {
public SearchAggregate(Album[] albums, AArtist[] artists, Genre[] genres, AMediaWrapper[] videos, AMediaWrapper[] tracks, Playlist[] playlists) {
this.albums = albums;
this.artists = artists;
this.genres = genres;
......@@ -34,7 +35,7 @@ public class SearchAggregate {
return albums;
}
public Artist[] getArtists() {
public AArtist[] getArtists() {
return artists;
}
......@@ -68,7 +69,7 @@ public class SearchAggregate {
}
if (artists.length > 0) {
sb.append("Artists:\n");
for (Artist artist : artists)
for (AArtist artist : artists)
sb.append(artist.getTitle()).append("\n");
}
if (genres.length > 0) {
......
package org.videolan.medialibrary.stubs;
import android.os.Parcel;
import org.videolan.medialibrary.interfaces.media.AArtist;
import org.videolan.medialibrary.interfaces.media.AMediaWrapper;
import org.videolan.medialibrary.media.Album;
public class StubArtist extends AArtist {
public StubArtist(long id, String name, String shortBio, String artworkMrl, String musicBrainzId) {
super(id, name, shortBio, artworkMrl, musicBrainzId);
}
public StubArtist(Parcel in) {
super(in);
}
public Album[] getAlbums(int sort, boolean desc) {
return null;
}
public Album[] getPagedAlbums(int sort, boolean desc, int nbItems, int offset) {
return null;
}
public Album[] searchAlbums(String query, int sort, boolean desc, int nbItems, int offset) {
return null;
}
public int searchAlbumsCount(String query) {
return 0;
}
public AMediaWrapper[] searchTracks(String query, int sort, boolean desc, int nbItems, int offset) {
return null;
}
public int searchTracksCount(String query) {
return 0;
}
public int getAlbumsCount() {
return 0;
}
public AMediaWrapper[] getTracks(int sort, boolean desc) {
return null;
}
public AMediaWrapper[] getPagedTracks(int sort, boolean desc, int nbItems, int offset) {
return null;
}
public int getTracksCount() {
return 0;
}
}
......@@ -22,8 +22,8 @@ import kotlinx.coroutines.*
import org.videolan.libvlc.Media
import org.videolan.libvlc.util.Extensions
import org.videolan.medialibrary.Tools
import org.videolan.medialibrary.interfaces.media.AArtist