mirror of
https://github.com/sct/overseerr.git
synced 2025-09-17 17:24:35 +02:00

* fix(mediarequest entity): narrow cascade to insert & remove to prevent hook recursion Restrict cascade options on the MediaRequest→Media relation to only `insert` and `remove`to avoid nested subscriber/AfterUpdate recursion when saving entities. * fix(mediarequest): move methods modifying MediaRequest to its Subscriber * fix(mediasubscriber): use event.manager for parent media updates on remove Replace `getRepository(Media)` calls with `event.manager` in the `afterRemove` hook so that parent-media status resets run within the same transaction/QueryRunner (important for postgresql. Doesnt affect sqlite). * refactor(mediasubscriber): make afterInsert and afterUpdate async and await internal operations This should prevent unhandled promise rejections and ensure sequential execution of lifecycle actions --------- Co-authored-by: Gauthier <mail@gauthierth.fr>