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

Medialibrary: move Genre to AGenre

parent ead2e2f1
......@@ -1762,8 +1762,8 @@ static JNINativeMethod methods[] = {
{"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 },
{"nativeSearchGenre", "(Ljava/lang/String;)[Lorg/videolan/medialibrary/interfaces/media/AGenre;", (void*)searchGenre },
{"nativeSearchPagedGenre", "(Ljava/lang/String;IZII)[Lorg/videolan/medialibrary/interfaces/media/AGenre;", (void*)searchPagedGenre },
{"nativeGetGenreSearchCount", "(Ljava/lang/String;)I", (void*)getGenreSearchCount },
{"nativeSearchPlaylist", "(Ljava/lang/String;)[Lorg/videolan/medialibrary/media/Playlist;", (void*)searchPlaylist },
{"nativeSearchPagedPlaylist", "(Ljava/lang/String;IZII)[Lorg/videolan/medialibrary/media/Playlist;", (void*)searchPagedPlaylist },
......@@ -1783,10 +1783,10 @@ static JNINativeMethod methods[] = {
{"nativeGetPagedArtists", "(ZIZII)[Lorg/videolan/medialibrary/interfaces/media/AArtist;", (void*)getPagedArtists },
{"nativeGetArtistsCount", "(Z)I", (void*)getArtistsCount },
{"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 },
{"nativeGetGenres", "(IZ)[Lorg/videolan/medialibrary/interfaces/media/AGenre;", (void*)getGenres },
{"nativeGetPagedGenres", "(IZII)[Lorg/videolan/medialibrary/interfaces/media/AGenre;", (void*)getPagedGenres },
{"nativeGetGenresCount", "()I", (void*)getGenresCount },
{"nativeGetGenre", "(J)Lorg/videolan/medialibrary/media/Genre;", (void*)getGenre },
{"nativeGetGenre", "(J)Lorg/videolan/medialibrary/interfaces/media/AGenre;", (void*)getGenre },
{"nativeGetPlaylists", "(IZ)[Lorg/videolan/medialibrary/media/Playlist;", (void*)getPlaylists },
{"nativeGetPagedPlaylists", "(IZII)[Lorg/videolan/medialibrary/media/Playlist;", (void*)getPagedPlaylists },
{"nativeGetPlaylistsCount", "()I", (void*)getPlaylistsCount },
......@@ -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/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");
"<init>", "([Lorg/videolan/medialibrary/media/Album;[Lorg/videolan/medialibrary/interfaces/media/AArtist;[Lorg/videolan/medialibrary/interfaces/media/AGenre;[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);
......
......@@ -34,10 +34,10 @@ 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.AGenre;
import org.videolan.medialibrary.interfaces.media.AMediaWrapper;
import org.videolan.medialibrary.media.Album;
import org.videolan.medialibrary.media.Folder;
import org.videolan.medialibrary.media.Genre;
import org.videolan.medialibrary.media.Playlist;
import org.videolan.medialibrary.media.SearchAggregate;
......@@ -324,19 +324,19 @@ public class Medialibrary {
}
@WorkerThread
public Genre[] getGenres() {
public AGenre[] getGenres() {
return getGenres(Medialibrary.SORT_DEFAULT, false);
}
@WorkerThread
public Genre[] getGenres(int sort, boolean desc) {
return mIsInitiated ? nativeGetGenres(sort, desc) : new Genre[0];
public AGenre[] getGenres(int sort, boolean desc) {
return mIsInitiated ? nativeGetGenres(sort, desc) : new AGenre[0];
}
@NonNull
@WorkerThread
public Genre[] getPagedGenres(int sort, boolean desc, int nbItems, int offset) {
return mIsInitiated ? nativeGetPagedGenres(sort, desc, nbItems, offset) : new Genre[0];
public AGenre[] getPagedGenres(int sort, boolean desc, int nbItems, int offset) {
return mIsInitiated ? nativeGetPagedGenres(sort, desc, nbItems, offset) : new AGenre[0];
}
public int getGenresCount() {
......@@ -347,7 +347,7 @@ public class Medialibrary {
return mIsInitiated ? nativeGetGenreSearchCount(query) : 0;
}
public Genre getGenre(long genreId) {
public AGenre getGenre(long genreId) {
return mIsInitiated ? nativeGetGenre(genreId) : null;
}
......@@ -864,11 +864,11 @@ public class Medialibrary {
return mIsInitiated && !TextUtils.isEmpty(query) ? nativeSearchAlbum(query) : null;
}
public Genre[] searchGenre(String query) {
public AGenre[] searchGenre(String query) {
return mIsInitiated && !TextUtils.isEmpty(query) ? nativeSearchGenre(query) : null;
}
public Genre[] searchGenre(String query, int sort, boolean desc, int nbItems, int offset) {
public AGenre[] searchGenre(String query, int sort, boolean desc, int nbItems, int offset) {
return mIsInitiated && !TextUtils.isEmpty(query) ? nativeSearchPagedGenre(query, sort, desc, nbItems, offset) : null;
}
......@@ -1008,10 +1008,10 @@ public class Medialibrary {
private native AArtist[] nativeGetPagedArtists(boolean all, int sort, boolean desc, int nbItems, int offset);
private native int nativeGetArtistsCount(boolean all);
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 AGenre[] nativeGetGenres(int sort, boolean desc);
private native AGenre[] nativeGetPagedGenres(int sort, boolean desc, int nbItems, int offset);
private native int nativeGetGenresCount();
private native Genre nativeGetGenre(long genreId);
private native AGenre nativeGetGenre(long genreId);
private native Playlist[] nativeGetPlaylists(int sort, boolean desc);
private native Playlist[] nativeGetPagedPlaylists(int sort, boolean desc, int nbItems, int offset);
private native int nativeGetPlaylistsCount();
......@@ -1042,8 +1042,8 @@ public class Medialibrary {
private native Album[] nativeSearchAlbum(String query);
private native Album[] nativeSearchPagedAlbum(String query, int sort, boolean desc, int nbItems, int offset);
private native int nativeGetAlbumSearchCount(String query);
private native Genre[] nativeSearchGenre(String query);
private native Genre[] nativeSearchPagedGenre(String query, int sort, boolean desc, int nbItems, int offset);
private native AGenre[] nativeSearchGenre(String query);
private native AGenre[] nativeSearchPagedGenre(String query, int sort, boolean desc, int nbItems, int offset);
private native int nativeGetGenreSearchCount(String query);
private native Playlist[] nativeSearchPlaylist(String query);
private native Playlist[] nativeSearchPagedPlaylist(String query, int sort, boolean desc, int nbItems, int offset);
......
......@@ -6,11 +6,15 @@ import android.os.Parcel;
import org.videolan.libvlc.Media;
import org.videolan.medialibrary.interfaces.media.AArtist;
import org.videolan.medialibrary.interfaces.media.AGenre;
import org.videolan.medialibrary.interfaces.media.AMediaWrapper;
import org.videolan.medialibrary.media.Artist;
import org.videolan.medialibrary.media.Genre;
import org.videolan.medialibrary.media.MediaWrapper;
import org.videolan.medialibrary.stubs.StubArtist;
import org.videolan.medialibrary.stubs.StubGenre;
import org.videolan.medialibrary.stubs.StubMediaWrapper;
import org.xml.sax.Locator;
public class ServiceLocator {
......@@ -106,4 +110,21 @@ public class ServiceLocator {
return new StubArtist(in);
}
}
//Genre
public static AGenre getAGenre(long id, String title) {
if (mMode == LocatorMode.VLC_ANDROID) {
return new Genre(id, title);
} else {
return new StubGenre(id, title);
}
}
public static AGenre getAGenre(Parcel in) {
if (mMode == LocatorMode.VLC_ANDROID) {
return new Genre(in);
} else {
return new StubGenre(in);
}
}
}
package org.videolan.medialibrary.interfaces.media;
import android.os.Parcel;
import android.os.Parcelable;
import org.videolan.medialibrary.Medialibrary;
import org.videolan.medialibrary.ServiceLocator;
import org.videolan.medialibrary.media.Album;
import org.videolan.medialibrary.media.MediaLibraryItem;
public abstract class AGenre extends MediaLibraryItem {
public AGenre(long id, String title) { super(id, title); }
public AGenre(Parcel in) { super(in); }
abstract public Album[] getAlbums(int sort, boolean desc);
abstract public Album[] getPagedAlbums(int sort, boolean desc, int nbItems, int offset);
abstract public AArtist[] getArtists(int sort, boolean desc);
abstract public AMediaWrapper[] getTracks(int sort, boolean desc);
abstract public AMediaWrapper[] getPagedTracks(int sort, boolean desc, int nbItems, int offset);
abstract public int getTracksCount();
abstract public int getAlbumsCount();
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);
public Album[] getAlbums() {
return getAlbums(Medialibrary.SORT_DEFAULT, false);
}
public AArtist[] getArtists() {
return getArtists(Medialibrary.SORT_DEFAULT, false);
}
public AMediaWrapper[] getTracks() {
return getTracks(Medialibrary.SORT_ALBUM, false);
}
@Override
public int getItemType() {
return TYPE_GENRE;
}
public static Parcelable.Creator<AGenre> CREATOR
= new Parcelable.Creator<AGenre>() {
@Override
public AGenre createFromParcel(Parcel in) {
return ServiceLocator.getAGenre(in);
}
@Override
public AGenre[] newArray(int size) {
return new AGenre[size];
}
};
}
package org.videolan.medialibrary.media;
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.AGenre;
import org.videolan.medialibrary.interfaces.media.AMediaWrapper;
import androidx.annotation.NonNull;
@SuppressWarnings("JniMissingFunction")
public class Genre extends MediaLibraryItem {
public class Genre extends AGenre {
public Genre(long id, String title) {
super(id, title);
}
public Album[] getAlbums() {
return getAlbums(Medialibrary.SORT_DEFAULT, false);
}
public Album[] getAlbums(int sort, boolean desc) {
final Medialibrary ml = Medialibrary.getInstance();
......@@ -31,20 +28,11 @@ public class Genre extends MediaLibraryItem {
return ml.isInitiated() ? nativeGetPagedAlbums(ml, mId, sort, desc, nbItems, offset) : new Album[0];
}
public AArtist[] getArtists() {
return getArtists(Medialibrary.SORT_DEFAULT, false);
}
public AArtist[] getArtists(int sort, boolean desc) {
final Medialibrary ml = Medialibrary.getInstance();
return ml.isInitiated() ? nativeGetArtists(ml, mId, sort, desc) : new AArtist[0];
}
@Override
public AMediaWrapper[] getTracks() {
return getTracks(Medialibrary.SORT_ALBUM, false);
}
public AMediaWrapper[] getTracks(int sort, boolean desc) {
final Medialibrary ml = Medialibrary.getInstance();
return ml.isInitiated() ? nativeGetTracks(ml, mId, sort, desc) : Medialibrary.EMPTY_COLLECTION;
......@@ -86,11 +74,6 @@ public class Genre extends MediaLibraryItem {
return ml.isInitiated() ? nativeGetSearchCount(ml, mId, query) : 0;
}
@Override
public int getItemType() {
return TYPE_GENRE;
}
private native Album[] nativeGetAlbums(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);
......@@ -106,18 +89,6 @@ public class Genre extends MediaLibraryItem {
private native int nativeGetSearchCount(Medialibrary ml, long mId, String query);
private native int nativeGetSearchAlbumCount(Medialibrary ml, long mId, String query);
public static Parcelable.Creator<Genre> CREATOR
= new Parcelable.Creator<Genre>() {
@Override
public Genre createFromParcel(Parcel in) {
return new Genre(in);
}
@Override
public Genre[] newArray(int size) {
return new Genre[size];
}
};
public Genre(Parcel in) {
super(in);
}
......
......@@ -2,6 +2,7 @@ package org.videolan.medialibrary.media;
import org.videolan.medialibrary.Tools;
import org.videolan.medialibrary.interfaces.media.AArtist;
import org.videolan.medialibrary.interfaces.media.AGenre;
import org.videolan.medialibrary.interfaces.media.AMediaWrapper;
public class SearchAggregate {
......@@ -9,7 +10,7 @@ public class SearchAggregate {
private final Album[] albums;
private final AArtist[] artists;
private final Genre[] genres;
private final AGenre[] genres;
private final AMediaWrapper[] videos;
private final AMediaWrapper[] tracks;
private final Playlist[] playlists;
......@@ -20,9 +21,10 @@ public class SearchAggregate {
this.genres = null;
this.videos = null;
this.tracks = null;
this.playlists = null;}
this.playlists = null;
}
public SearchAggregate(Album[] albums, AArtist[] artists, Genre[] genres, AMediaWrapper[] videos, AMediaWrapper[] tracks, Playlist[] playlists) {
public SearchAggregate(Album[] albums, AArtist[] artists, AGenre[] genres, AMediaWrapper[] videos, AMediaWrapper[] tracks, Playlist[] playlists) {
this.albums = albums;
this.artists = artists;
this.genres = genres;
......@@ -39,7 +41,7 @@ public class SearchAggregate {
return artists;
}
public Genre[] getGenres() {
public AGenre[] getGenres() {
return genres;
}
......@@ -74,7 +76,7 @@ public class SearchAggregate {
}
if (genres.length > 0) {
sb.append("Genres:\n");
for (Genre genre : genres)
for (AGenre genre : genres)
sb.append(genre.getTitle()).append("\n");
}
if (tracks.length > 0) {
......
package org.videolan.medialibrary.stubs;
import android.os.Parcel;
import org.videolan.medialibrary.interfaces.media.AArtist;
import org.videolan.medialibrary.interfaces.media.AGenre;
import org.videolan.medialibrary.interfaces.media.AMediaWrapper;
import org.videolan.medialibrary.media.Album;
public class StubGenre extends AGenre {
public StubGenre(long id, String title) { super(id, title); }
public StubGenre(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 AArtist[] getArtists(int sort, boolean desc) {
return null;
}
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;
}
public int getAlbumsCount() {
return 0;
}
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;
}
}
......@@ -33,6 +33,7 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.launch
import org.videolan.medialibrary.Tools
import org.videolan.medialibrary.interfaces.media.AArtist
import org.videolan.medialibrary.interfaces.media.AGenre
import org.videolan.medialibrary.interfaces.media.AMediaWrapper
import org.videolan.medialibrary.media.*
import org.videolan.tools.coroutineScope
......@@ -100,7 +101,7 @@ class SearchFragment : SearchSupportFragment(), SearchSupportFragment.SearchResu
val albumsAdapter = ArrayObjectAdapter(cp)
if (!empty) albumsAdapter.addAll(0, Arrays.asList<Album>(*searchAggregate.albums))
val genresAdapter = ArrayObjectAdapter(cp)
if (!empty) genresAdapter.addAll(0, Arrays.asList<Genre>(*searchAggregate.genres))
if (!empty) genresAdapter.addAll(0, Arrays.asList<AGenre>(*searchAggregate.genres))
if (!mediaEmpty && videoAdapter.size() > 0)
rowsAdapter.add(ListRow(HeaderItem(0, resources.getString(R.string.videos)), videoAdapter))
// if (!mediaEmpty && episodesAdapter.size() > 0)
......
......@@ -24,8 +24,8 @@ import android.content.Context
import kotlinx.coroutines.ExperimentalCoroutinesApi
import org.videolan.medialibrary.Medialibrary
import org.videolan.medialibrary.interfaces.media.AArtist
import org.videolan.medialibrary.interfaces.media.AGenre
import org.videolan.medialibrary.media.Album
import org.videolan.medialibrary.media.Genre
import org.videolan.medialibrary.media.MediaLibraryItem
import org.videolan.vlc.util.Settings
import org.videolan.vlc.viewmodels.SortableModel
......@@ -45,18 +45,18 @@ class AlbumsProvider(val parent : MediaLibraryItem?, context: Context, scope: So
override fun getAll() : Array<Album> = when (parent) {
is AArtist -> parent.getAlbums(sort, scope.desc)
is Genre -> parent.getAlbums(sort, scope.desc)
is AGenre -> parent.getAlbums(sort, scope.desc)
else -> medialibrary.getAlbums(sort, scope.desc)
}
override fun getPage(loadSize: Int, startposition: Int) : Array<Album> {
val list = if (scope.filterQuery == null) when(parent) {
is AArtist -> parent.getPagedAlbums(sort, scope.desc, loadSize, startposition)
is Genre -> parent.getPagedAlbums(sort, scope.desc, loadSize, startposition)
is AGenre -> parent.getPagedAlbums(sort, scope.desc, loadSize, startposition)
else -> medialibrary.getPagedAlbums(sort, scope.desc, loadSize, startposition)
} else when(parent) {
is AArtist -> parent.searchAlbums(scope.filterQuery, sort, scope.desc, loadSize, startposition)
is Genre -> parent.searchAlbums(scope.filterQuery, sort, scope.desc, loadSize, startposition)
is AGenre -> parent.searchAlbums(scope.filterQuery, sort, scope.desc, loadSize, startposition)
else -> medialibrary.searchAlbum(scope.filterQuery, sort, scope.desc, loadSize, startposition)
}
return list.also { completeHeaders(it, startposition) }
......@@ -64,11 +64,11 @@ class AlbumsProvider(val parent : MediaLibraryItem?, context: Context, scope: So
override fun getTotalCount() = if (scope.filterQuery == null) when(parent) {
is AArtist -> parent.albumsCount
is Genre -> parent.albumsCount
is AGenre -> parent.albumsCount
else -> medialibrary.albumsCount
} else when (parent) {
is AArtist -> parent.searchAlbumsCount(scope.filterQuery)
is Genre -> parent.searchAlbumsCount(scope.filterQuery)
is AGenre -> parent.searchAlbumsCount(scope.filterQuery)
else -> medialibrary.getAlbumsCount(scope.filterQuery)
}
}
\ No newline at end of file
......@@ -22,16 +22,16 @@ package org.videolan.vlc.providers.medialibrary
import android.content.Context
import kotlinx.coroutines.ExperimentalCoroutinesApi
import org.videolan.medialibrary.media.Genre
import org.videolan.medialibrary.interfaces.media.AGenre
import org.videolan.vlc.viewmodels.SortableModel
@ExperimentalCoroutinesApi
class GenresProvider(context: Context, scope: SortableModel) : MedialibraryProvider<Genre>(context, scope) {
class GenresProvider(context: Context, scope: SortableModel) : MedialibraryProvider<AGenre>(context, scope) {
override fun getAll() : Array<Genre> = medialibrary.getGenres(sort, scope.desc)
override fun getAll() : Array<AGenre> = medialibrary.getGenres(sort, scope.desc)
override fun getPage(loadSize: Int, startposition: Int) : Array<Genre> {
override fun getPage(loadSize: Int, startposition: Int) : Array<AGenre> {
val list = if (scope.filterQuery == null) medialibrary.getPagedGenres(sort, scope.desc, loadSize, startposition)
else medialibrary.searchGenre(scope.filterQuery, sort, scope.desc, loadSize, startposition)
return list.also { completeHeaders(it, startposition) }
......
......@@ -24,6 +24,7 @@ import android.content.Context
import kotlinx.coroutines.ExperimentalCoroutinesApi
import org.videolan.medialibrary.Medialibrary
import org.videolan.medialibrary.interfaces.media.AArtist
import org.videolan.medialibrary.interfaces.media.AGenre
import org.videolan.medialibrary.interfaces.media.AMediaWrapper
import org.videolan.medialibrary.media.*
import org.videolan.vlc.util.Settings
......@@ -54,13 +55,13 @@ class TracksProvider(val parent : MediaLibraryItem?, context: Context, scope: So
val list = if (scope.filterQuery == null) when(parent) {
is AArtist -> parent.getPagedTracks(sort, scope.desc, loadSize, startposition)
is Album -> parent.getPagedTracks(sort, scope.desc, loadSize, startposition)
is Genre -> parent.getPagedTracks(sort, scope.desc, loadSize, startposition)
is AGenre -> parent.getPagedTracks(sort, scope.desc, loadSize, startposition)
is Playlist -> parent.getPagedTracks(loadSize, startposition)
else -> medialibrary.getPagedAudio(sort, scope.desc, loadSize, startposition)
} else when(parent) {
is AArtist -> parent.searchTracks(scope.filterQuery, sort, scope.desc, loadSize, startposition)
is Album -> parent.searchTracks(scope.filterQuery, sort, scope.desc, loadSize, startposition)
is Genre -> parent.searchTracks(scope.filterQuery, sort, scope.desc, loadSize, startposition)
is AGenre -> parent.searchTracks(scope.filterQuery, sort, scope.desc, loadSize, startposition)
is Playlist -> parent.searchTracks(scope.filterQuery, sort, scope.desc, loadSize, startposition)
else -> medialibrary.searchAudio(scope.filterQuery, sort, scope.desc, loadSize, startposition)
}
......@@ -71,12 +72,12 @@ class TracksProvider(val parent : MediaLibraryItem?, context: Context, scope: So
is Album -> parent.realTracksCount
is Playlist -> parent.realTracksCount
is AArtist,
is Genre -> parent.tracksCount
is AGenre -> parent.tracksCount
else -> medialibrary.audioCount
} else when(parent) {
is AArtist -> parent.searchTracksCount(scope.filterQuery)
is Album -> parent.searchTracksCount(scope.filterQuery)
is Genre -> parent.searchTracksCount(scope.filterQuery)
is AGenre -> parent.searchTracksCount(scope.filterQuery)
is Playlist -> parent.searchTracksCount(scope.filterQuery)
else ->medialibrary.getAudioCount(scope.filterQuery)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment