This repository was archived by the owner on Mar 28, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +19
-5
lines changed
packages/server/src/modules Expand file tree Collapse file tree 6 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -13,9 +13,11 @@ import { AuthorService } from './author.service';
1313 {
1414 DTOClass : AuthorDto ,
1515 EntityClass : AuthorEntity ,
16+ ServiceClass : AuthorService ,
1617 create : { disabled : true } ,
1718 } ,
1819 ] ,
20+ services : [ AuthorService ] ,
1921 } ) ,
2022 ] ,
2123 providers : [ AuthorService ] ,
Original file line number Diff line number Diff line change 1+ /* eslint-disable @typescript-eslint/no-useless-constructor */
12import { QueryService } from '@nestjs-query/core' ;
23import { TypeOrmQueryService } from '@nestjs-query/query-typeorm' ;
34import { InjectRepository } from '@nestjs/typeorm' ;
@@ -8,12 +9,18 @@ import { AuthorEntity } from '@entities/author.entity';
89@QueryService ( AuthorEntity )
910export class AuthorService extends TypeOrmQueryService < AuthorEntity > {
1011 constructor (
11- @InjectRepository ( AuthorEntity ) authorRepository : Repository < AuthorEntity >
12+ @InjectRepository ( AuthorEntity ) authorRepository : Repository < AuthorEntity > ,
1213 ) {
1314 super ( authorRepository ) ;
1415 }
1516
16- async findOrCreate ( name : string ) : Promise < AuthorEntity > {
17+ async findOrCreate (
18+ name : string | undefined ,
19+ ) : Promise < AuthorEntity | undefined > {
20+ if ( ! name ) {
21+ return undefined ;
22+ }
23+
1724 const authors : AuthorEntity [ ] = await this . query ( {
1825 filter : { name : { eq : name } } ,
1926 } ) ;
Original file line number Diff line number Diff line change @@ -13,9 +13,11 @@ import { EpisodeService } from './episode.service';
1313 {
1414 DTOClass : EpisodeDto ,
1515 EntityClass : EpisodeEntity ,
16+ ServiceClass : EpisodeService ,
1617 create : { disabled : true } ,
1718 } ,
1819 ] ,
20+ services : [ EpisodeService ] ,
1921 } ) ,
2022 ] ,
2123 providers : [ EpisodeService ] ,
Original file line number Diff line number Diff line change @@ -19,10 +19,10 @@ export class EpisodeService extends TypeOrmQueryService<EpisodeEntity> {
1919
2020 episode . title = item . title ;
2121 episode . publication = new Date ( item . pubDate ) ;
22- episode . url = item . enclosure . url ;
23- episode . filesize = item . enclosure . length ;
22+ episode . url = item . enclosure ? .url ;
23+ episode . filesize = item . enclosure ? .length ;
2424 episode . guid = item . guid ;
25- episode . type = item . enclosure . type ;
25+ episode . type = item . enclosure ? .type ;
2626 episode . description = item . content ;
2727 episode . image = item . itunes . image ;
2828 episode . explicit = item . itunes . explicit === 'clean' ;
Original file line number Diff line number Diff line change @@ -12,9 +12,11 @@ import { QueueService } from './queue.service';
1212 {
1313 DTOClass : QueueEntity ,
1414 EntityClass : QueueEntity ,
15+ ServiceClass : QueueService ,
1516 update : { disabled : true } ,
1617 } ,
1718 ] ,
19+ services : [ QueueService ] ,
1820 } ) ,
1921 ] ,
2022 providers : [ QueueService ] ,
Original file line number Diff line number Diff line change 1+ /* eslint-disable @typescript-eslint/no-useless-constructor */
12import { QueryService } from '@nestjs-query/core' ;
23import { TypeOrmQueryService } from '@nestjs-query/query-typeorm' ;
34import { Repository } from 'typeorm' ;
You can’t perform that action at this time.
0 commit comments