mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-08-14 23:51:41 +00:00
Fix unsubscribeResponse()
This commit is contained in:
parent
b38c641b5f
commit
cffd93f383
1 changed files with 7 additions and 7 deletions
|
@ -650,18 +650,18 @@ public class ResponseHelper {
|
|||
plQuery.select(plRoot).where(plCriteria.equal(plRoot.get("owner"), user.getId()));
|
||||
List<me.kavin.piped.utils.obj.db.Playlist> playlists = s.createQuery(plQuery).getResultList();
|
||||
|
||||
for (me.kavin.piped.utils.obj.db.Playlist pl : playlists) {
|
||||
Iterator<me.kavin.piped.utils.obj.db.Playlist> plIter = playlists.iterator();
|
||||
|
||||
while (plIter.hasNext()) {
|
||||
me.kavin.piped.utils.obj.db.Playlist pl = plIter.next();
|
||||
Iterator<PlaylistVideo> pvIter = pl.getVideos().iterator();
|
||||
|
||||
while (pvIter.hasNext())
|
||||
s.delete(pvIter.next());
|
||||
|
||||
s.delete(pl);
|
||||
}
|
||||
|
||||
Iterator<me.kavin.piped.utils.obj.db.Playlist> iter = playlists.iterator();
|
||||
|
||||
while (iter.hasNext())
|
||||
s.delete(iter.next());
|
||||
|
||||
s.delete(user);
|
||||
|
||||
s.getTransaction().begin();
|
||||
|
@ -790,7 +790,7 @@ public class ResponseHelper {
|
|||
public static byte[] unsubscribeResponse(String session, String channelId)
|
||||
throws IOException {
|
||||
|
||||
User user = DatabaseHelper.getUserFromSession(session);
|
||||
User user = DatabaseHelper.getUserFromSessionWithSubscribed(session);
|
||||
|
||||
if (user != null) {
|
||||
try (Session s = DatabaseSessionFactory.createSession()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue