Delete queue on logout

This commit is contained in:
CappielloAntonio 2021-08-09 00:23:09 +02:00
parent 78a4006ed6
commit af60a4a3eb
12 changed files with 60 additions and 43 deletions

View file

@ -91,7 +91,7 @@ public class PreferenceUtil {
}
public String getServerId() {
return mPreferences.getString(SERVER_ID, null);
return mPreferences.getString(SERVER_ID, "");
}
public void setServerId(String serverId) {

View file

@ -9,12 +9,12 @@ import java.util.List;
public class QueueUtil {
private static final String TAG = "QueueUtil";
public static List<Queue> getQueueElementsFromSongs(List<Song> songs, String serverID) {
public static List<Queue> getQueueElementsFromSongs(List<Song> songs) {
int counter = 0;
List<Queue> queue = new ArrayList<>();
for (Song song : songs) {
queue.add(new Queue(counter, song.getId(), song.getTitle(), song.getAlbumId(), song.getAlbumName(), song.getArtistId(), song.getArtistName(), song.getPrimary(), song.getDuration(), serverID));
queue.add(new Queue(counter, song.getId(), song.getTitle(), song.getAlbumId(), song.getAlbumName(), song.getArtistId(), song.getArtistName(), song.getPrimary(), song.getDuration()));
counter++;
}