Skip to content

Commit

Permalink
Persist updates made to movies during sync (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasodonnell authored Feb 19, 2024
1 parent a28d570 commit 953c62d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion apps/api/src/movie/movie.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export class MovieService {
/**
* Create a new movie record if one does not exist, otherwise update the existing record
*/
async createOrUpdate(movie: MovieDTO): Promise<Movie> {
async createOrUpdate(movie: Partial<MovieDTO>): Promise<Movie> {
try {
const {
alternativeTitles,
Expand Down
3 changes: 0 additions & 3 deletions apps/api/src/sync/sync.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,9 @@ export class SyncService {
deletedAt: null,
downloadedAt: radarrMovie.movieFile?.dateAdded,
id: radarrMovie.id,
ignored: false,
imdbRating: radarrMovie.ratings?.imdb?.value
? Math.floor(radarrMovie.ratings.imdb.value * 10)
: null,
lastWatchedAt: null,
metacriticRating: radarrMovie.ratings?.metacritic?.value
? Math.floor(radarrMovie.ratings.metacritic.value)
: null,
Expand All @@ -290,7 +288,6 @@ export class SyncService {
tmdbRating: radarrMovie.ratings?.tmdb?.value
? Math.floor(radarrMovie.ratings.tmdb.value * 10)
: null,
watched: false,
})

this.logger.log(`Synced movie "${movie.title}"`)
Expand Down

0 comments on commit 953c62d

Please sign in to comment.