From 99ea7976997d123e3fa1ddd84f49feb13115671e Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 30 Oct 2023 19:12:09 +0200 Subject: [PATCH] fix torrent poster update on last poster delete #18 --- src/Service/TorrentService.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Service/TorrentService.php b/src/Service/TorrentService.php index 1424848..1e52555 100644 --- a/src/Service/TorrentService.php +++ b/src/Service/TorrentService.php @@ -1209,10 +1209,17 @@ class TorrentService $torrent->setTorrentPosterId( $torrentPoster->getId() ); - - $this->entityManagerInterface->persist($torrent); - $this->entityManagerInterface->flush(); } + + else + { + $torrent->setTorrentPosterId( + null + ); + } + + $this->entityManagerInterface->persist($torrent); + $this->entityManagerInterface->flush(); } }