From 9067c770a75aea9e8f0fd25dcb617536c15e09f1 Mon Sep 17 00:00:00 2001 From: Jared Fantaye Date: Sat, 25 Feb 2023 22:14:49 +0100 Subject: [PATCH] Made some small code improvements --- .../schabi/newpipe/local/playlist/LocalPlaylistManager.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistManager.java b/app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistManager.java index 0a9120da2..0cf2d67c5 100644 --- a/app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistManager.java +++ b/app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistManager.java @@ -42,13 +42,11 @@ public class LocalPlaylistManager { if (streams.isEmpty()) { return Maybe.empty(); } - final StreamEntity defaultStream = streams.get(0); - final PlaylistEntity newPlaylist = - new PlaylistEntity(name, false, defaultStream.getUid()); return Maybe.fromCallable(() -> database.runInTransaction(() -> { final List streamIds = streamTable.upsertAll(streams); - newPlaylist.setThumbnailStreamId(streamIds.get(0)); + final PlaylistEntity newPlaylist = new PlaylistEntity(name, false, + streamIds.get(0)); return insertJoinEntities(playlistTable.insert(newPlaylist), streamIds, 0);