Skip to content

Commit

Permalink
fix(server): skip syncing media if they have no title field
Browse files Browse the repository at this point in the history
  • Loading branch information
ADRFranklin committed Jun 9, 2024
1 parent 90fb805 commit bd4e262
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion server/src/api/routes/batch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { validateRequest } from '@/api/middleware/validation';
import { getFromContainer } from '@/infrastructure/container/container';
import { MovieMapper } from '@/resources/movie/mapper';
import { ShowMapper } from '@/resources/show/mapper';
import { MovieService } from '@/services/movie/movie';
import { MovieService } from '@/services/movie/movie-service';
import { ShowService } from '@/services/show/show-service';

const handleTv = async (ctx: Context) => {
Expand Down
2 changes: 1 addition & 1 deletion server/src/api/routes/movie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Context } from 'koa';

import { getFromContainer } from '@/infrastructure/container/container';
import { MovieMapper } from '@/resources/movie/mapper';
import { MovieService } from '@/services/movie/movie';
import { MovieService } from '@/services/movie/movie-service';
import { company, discoverMovie } from '@/services/tmdb/movie';

const lookupById = async (ctx: Context) => {
Expand Down
2 changes: 1 addition & 1 deletion server/src/services/cache/cache-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
CommonResourcesResponse,
} from '@/services/cache/types';
import { CompanyService } from '@/services/company/company-service';
import { MovieService } from '@/services/movie/movie';
import { MovieService } from '@/services/movie/movie-service';
import { NetworkService } from '@/services/network/network-service';
import { PersonService } from '@/services/person/person-service';
import { ShowService } from '@/services/show/show-service';
Expand Down
2 changes: 1 addition & 1 deletion server/src/services/cron/jobs/resource-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Service } from 'diod';
import { AgendaCronService } from '@/services/cron/agenda-cron-service';
import { Jobber } from '@/services/cron/job';
import { JobCronName } from '@/services/cron/types';
import { MovieService } from '@/services/movie/movie';
import { MovieService } from '@/services/movie/movie-service';

@Service()
export class ResourceCacheJob implements Jobber {
Expand Down
2 changes: 1 addition & 1 deletion server/src/services/movie/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ContainerBuilder } from 'diod';

import { MovieService } from '@/services/movie/movie';
import { MovieService } from '@/services/movie/movie-service';
import { FanartMovieProvider } from '@/services/movie/provider/fanart/fanart';
import {
MovieArtworkProvider,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion server/src/services/movie/provider/tmdb/tmdb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export class TmdbMovieProvider implements MovieProvider, MovieTrendingProvider {
: undefined;
const images = this.buildArtworkUrls(detailsResult.images);
return {
title: detailsResult.title || '',
title: detailsResult.title || detailsResult.original_title || '',
description: detailsResult.overview || '',
certification:
detailsResult.release_dates?.results.find(
Expand Down
2 changes: 1 addition & 1 deletion server/src/services/person/person-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Logger } from '@/infrastructure/logger/logger';
import { PersonEntity } from '@/resources/person/entity';
import { PersonProps } from '@/resources/person/types';
import { CacheProvider } from '@/services/cache/cache-provider';
import { MovieService } from '@/services/movie/movie';
import { MovieService } from '@/services/movie/movie-service';
import {
PersonDetailsProvider,
PersonTrendingProvider,
Expand Down
2 changes: 2 additions & 0 deletions server/src/services/scanner/providers/plex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ export class PlexScannerProvider implements ScannerProvider {
if (
!is.truthy(content.ratingKey) ||
content.type !== 'show' ||
!is.truthy(content.title) ||
!is.truthy(content.guid) ||
!is.truthy(content.Guid)
) {
Expand Down Expand Up @@ -262,6 +263,7 @@ export class PlexScannerProvider implements ScannerProvider {
if (
!is.truthy(metadata.ratingKey) ||
metadata.type !== 'movie' ||
!is.truthy(metadata.title) ||
!is.truthy(metadata.guid) ||
!is.truthy(metadata.Guid)
) {
Expand Down
2 changes: 1 addition & 1 deletion server/src/services/scanner/scanner-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { MovieEntity } from '@/resources/movie/entity';
import { MovieRepository } from '@/resources/movie/repository';
import { ShowEntity } from '@/resources/show/entity';
import { ShowRepository } from '@/resources/show/repository';
import { MovieService } from '@/services/movie/movie';
import { MovieService } from '@/services/movie/movie-service';
import { ScannerProvider } from '@/services/scanner/provider';
import { scannerProviders } from '@/services/scanner/providers';
import { ShowService } from '@/services/show/show-service';
Expand Down
1 change: 0 additions & 1 deletion server/src/services/show/show-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ export class ShowService {
return undefined;
}
const details = detailsResult.unwrap();

const artworkResult =
options?.withArtwork && details.providers.tvdb
? await this.showArtworkProvider.getArtworkImages(
Expand Down

0 comments on commit bd4e262

Please sign in to comment.