From 8fc68c388803ed1767eb70e1aa8dfe57f1026de3 Mon Sep 17 00:00:00 2001 From: fallenbagel <98979876+fallenbagel@users.noreply.github.com> Date: Wed, 4 Feb 2026 21:51:59 +0500 Subject: [PATCH] revert(media-request): revert #2316 explicitly setting the mediaId when creating request (#2372) This just reverts #2316. A further description is not needed. **TYPEORM**, thats all thats needed to say. --- server/entity/MediaRequest.ts | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/server/entity/MediaRequest.ts b/server/entity/MediaRequest.ts index 55f24fe5..cdfa17c3 100644 --- a/server/entity/MediaRequest.ts +++ b/server/entity/MediaRequest.ts @@ -332,16 +332,9 @@ export class MediaRequest { if (requestBody.mediaType === MediaType.MOVIE) { await mediaRepository.save(media); - if (!media.id) { - throw new Error( - `Failed to save media before creating request. Media type: ${requestBody.mediaType}, TMDB ID: ${requestBody.mediaId}, persisted media id: ${media.id}` - ); - } - const request = new MediaRequest({ type: MediaType.MOVIE, media, - mediaId: media.id, requestedBy: requestUser, // If the user is an admin or has the "auto approve" permission, automatically approve the request status: user.hasPermission( @@ -449,16 +442,9 @@ export class MediaRequest { await mediaRepository.save(media); - if (!media.id) { - throw new Error( - `Failed to save media before creating request. Media type: TV, TMDB ID: ${requestBody.mediaId}, is4k: ${requestBody.is4k}` - ); - } - const request = new MediaRequest({ type: MediaType.TV, media, - mediaId: media.id, requestedBy: requestUser, // If the user is an admin or has the "auto approve" permission, automatically approve the request status: user.hasPermission( @@ -535,9 +521,6 @@ export class MediaRequest { }) public media: Media; - @Column({ name: 'mediaId', nullable: true }) - public mediaId: number; - @ManyToOne(() => User, (user) => user.requests, { eager: true, onDelete: 'CASCADE',