Fix cloning of playlist with duplicate videos.

This commit is contained in:
Kavin 2022-08-03 21:09:10 +05:30
parent 5fd274bc87
commit 30a7b43c5e
No known key found for this signature in database
GPG key ID: 49451E4482CC5BCD

View file

@ -1390,7 +1390,7 @@ public class ResponseHelper {
var channel = channelMap.get(channelId);
playlist.getVideos().add(videoMap.getOrDefault(videoId, new PlaylistVideo(videoId, video.getName(), video.getThumbnailUrl(), video.getDuration(), channel)));
playlist.getVideos().add(videoMap.computeIfAbsent(videoId, (key) -> new PlaylistVideo(videoId, video.getName(), video.getThumbnailUrl(), video.getDuration(), channel)));
});
var tr = s.beginTransaction();