mirror of
https://github.com/TeamNewPipe/NewPipe.git
synced 2024-11-21 18:42:35 +01:00
Undo some unneeded changes to LocalPlaylistManager
This commit is contained in:
parent
c9051d33c1
commit
38d4887901
@ -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());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user