mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-12-13 13:50:28 +05:30
Fix missing transaction when trying to insert new videos in a playlist
This commit is contained in:
parent
0b9c96e910
commit
5676881ec1
@ -255,7 +255,15 @@ public class AuthPlaylistHandlers {
|
|||||||
|
|
||||||
video = new PlaylistVideo(videoId, info.getName(), info.getThumbnailUrl(), info.getDuration(), channel);
|
video = new PlaylistVideo(videoId, info.getName(), info.getThumbnailUrl(), info.getDuration(), channel);
|
||||||
|
|
||||||
s.persist(video);
|
var tr = s.beginTransaction();
|
||||||
|
try {
|
||||||
|
s.persist(video);
|
||||||
|
tr.commit();
|
||||||
|
} catch (Exception e) {
|
||||||
|
tr.rollback();
|
||||||
|
ExceptionHandler.handle(e);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
ExceptionHandler.handle(e);
|
ExceptionHandler.handle(e);
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user