Undo some unneeded changes to LocalPlaylistManager

This commit is contained in:
Stypox 2024-03-30 14:46:13 +01:00
parent c9051d33c1
commit 38d4887901
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23
1 changed files with 3 additions and 12 deletions

View File

@ -133,18 +133,13 @@ public class LocalPlaylistManager {
} }
public Maybe<Integer> renamePlaylist(final long playlistId, final String name) { public Maybe<Integer> renamePlaylist(final long playlistId, final String name) {
return modifyPlaylist(playlistId, name, THUMBNAIL_ID_LEAVE_UNCHANGED, false, -1); return modifyPlaylist(playlistId, name, THUMBNAIL_ID_LEAVE_UNCHANGED, false);
} }
public Maybe<Integer> changePlaylistThumbnail(final long playlistId, public Maybe<Integer> changePlaylistThumbnail(final long playlistId,
final long thumbnailStreamId, final long thumbnailStreamId,
final boolean isPermanent) { final boolean isPermanent) {
return modifyPlaylist(playlistId, null, thumbnailStreamId, isPermanent, -1); return modifyPlaylist(playlistId, null, thumbnailStreamId, isPermanent);
}
public Maybe<Integer> updatePlaylistDisplayIndex(final long playlistId,
final long displayIndex) {
return modifyPlaylist(playlistId, null, THUMBNAIL_ID_LEAVE_UNCHANGED, false, displayIndex);
} }
public long getPlaylistThumbnailStreamId(final long playlistId) { public long getPlaylistThumbnailStreamId(final long playlistId) {
@ -168,8 +163,7 @@ public class LocalPlaylistManager {
private Maybe<Integer> modifyPlaylist(final long playlistId, private Maybe<Integer> modifyPlaylist(final long playlistId,
@Nullable final String name, @Nullable final String name,
final long thumbnailStreamId, final long thumbnailStreamId,
final boolean isPermanent, final boolean isPermanent) {
final long displayIndex) {
return playlistTable.getPlaylist(playlistId) return playlistTable.getPlaylist(playlistId)
.firstElement() .firstElement()
.filter(playlistEntities -> !playlistEntities.isEmpty()) .filter(playlistEntities -> !playlistEntities.isEmpty())
@ -182,9 +176,6 @@ public class LocalPlaylistManager {
playlist.setThumbnailStreamId(thumbnailStreamId); playlist.setThumbnailStreamId(thumbnailStreamId);
playlist.setIsThumbnailPermanent(isPermanent); playlist.setIsThumbnailPermanent(isPermanent);
} }
if (displayIndex != -1) {
playlist.setDisplayIndex(displayIndex);
}
return playlistTable.update(playlist); return playlistTable.update(playlist);
}).subscribeOn(Schedulers.io()); }).subscribeOn(Schedulers.io());
} }