fix empty playlist adding to offline catalog
This commit is contained in:
@@ -235,6 +235,10 @@ public class CacheDatabaseDelegate {
|
||||
return null; // get playlist from db
|
||||
}
|
||||
|
||||
public static boolean hasPlaylist() {
|
||||
return false; // has playlists or not
|
||||
}
|
||||
|
||||
public static List<MusicTrack> getTracks(String query) {
|
||||
List<MusicTrack> list = new ArrayList<>();
|
||||
try (Cursor cursor = getHelper().getReadableDatabase().rawQuery(query, new String[0])) {
|
||||
|
||||
+9
-5
@@ -235,11 +235,15 @@ public class TracklistInjector {
|
||||
|
||||
audiosBlock.put("layout", layout);
|
||||
|
||||
var blocks = new JSONArray()
|
||||
.put(getCatalogHeader())
|
||||
.put(getCatalogPlaylist())
|
||||
.put(getCatalogSeparator())
|
||||
.put(getShuffleButton())
|
||||
var blocks = new JSONArray();
|
||||
|
||||
if (CacheDatabaseDelegate.hasPlaylist()) {
|
||||
blocks.put(getCatalogHeader())
|
||||
.put(getCatalogPlaylist())
|
||||
.put(getCatalogSeparator());
|
||||
}
|
||||
|
||||
blocks.put(getShuffleButton())
|
||||
.put(audiosBlock);
|
||||
|
||||
var randomId = getRandomId();
|
||||
|
||||
Reference in New Issue
Block a user