Browse Source

Add exists method to PlexMovie entity

dev
David Ludwig 4 years ago
parent
commit
1f42d67d77
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      packages/database/src/entities/PlexMovie.ts

+ 7
- 0
packages/database/src/entities/PlexMovie.ts View File

@ -19,6 +19,13 @@ export class PlexMovie extends BaseEntity
return (await PlexMovie.findOne({ where: { tmdbId } }))?.plexKey ?? null;
}
/**
* Check if the given movie exists on Plex
*/
public static async exists(tmdbId: number|string) {
return (await PlexMovie.count({ where: { tmdbId } })) > 0;
}
/**
* Get the set of IMDb IDs stored in the library
*/


Loading…
Cancel
Save