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';
13
13
{
14
14
DTOClass : AuthorDto ,
15
15
EntityClass : AuthorEntity ,
16
+ ServiceClass : AuthorService ,
16
17
create : { disabled : true } ,
17
18
} ,
18
19
] ,
20
+ services : [ AuthorService ] ,
19
21
} ) ,
20
22
] ,
21
23
providers : [ AuthorService ] ,
Original file line number Diff line number Diff line change
1
+ /* eslint-disable @typescript-eslint/no-useless-constructor */
1
2
import { QueryService } from '@nestjs-query/core' ;
2
3
import { TypeOrmQueryService } from '@nestjs-query/query-typeorm' ;
3
4
import { InjectRepository } from '@nestjs/typeorm' ;
@@ -8,12 +9,18 @@ import { AuthorEntity } from '@entities/author.entity';
8
9
@QueryService ( AuthorEntity )
9
10
export class AuthorService extends TypeOrmQueryService < AuthorEntity > {
10
11
constructor (
11
- @InjectRepository ( AuthorEntity ) authorRepository : Repository < AuthorEntity >
12
+ @InjectRepository ( AuthorEntity ) authorRepository : Repository < AuthorEntity > ,
12
13
) {
13
14
super ( authorRepository ) ;
14
15
}
15
16
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
+
17
24
const authors : AuthorEntity [ ] = await this . query ( {
18
25
filter : { name : { eq : name } } ,
19
26
} ) ;
Original file line number Diff line number Diff line change @@ -13,9 +13,11 @@ import { EpisodeService } from './episode.service';
13
13
{
14
14
DTOClass : EpisodeDto ,
15
15
EntityClass : EpisodeEntity ,
16
+ ServiceClass : EpisodeService ,
16
17
create : { disabled : true } ,
17
18
} ,
18
19
] ,
20
+ services : [ EpisodeService ] ,
19
21
} ) ,
20
22
] ,
21
23
providers : [ EpisodeService ] ,
Original file line number Diff line number Diff line change @@ -19,10 +19,10 @@ export class EpisodeService extends TypeOrmQueryService<EpisodeEntity> {
19
19
20
20
episode . title = item . title ;
21
21
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 ;
24
24
episode . guid = item . guid ;
25
- episode . type = item . enclosure . type ;
25
+ episode . type = item . enclosure ? .type ;
26
26
episode . description = item . content ;
27
27
episode . image = item . itunes . image ;
28
28
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';
12
12
{
13
13
DTOClass : QueueEntity ,
14
14
EntityClass : QueueEntity ,
15
+ ServiceClass : QueueService ,
15
16
update : { disabled : true } ,
16
17
} ,
17
18
] ,
19
+ services : [ QueueService ] ,
18
20
} ) ,
19
21
] ,
20
22
providers : [ QueueService ] ,
Original file line number Diff line number Diff line change
1
+ /* eslint-disable @typescript-eslint/no-useless-constructor */
1
2
import { QueryService } from '@nestjs-query/core' ;
2
3
import { TypeOrmQueryService } from '@nestjs-query/query-typeorm' ;
3
4
import { Repository } from 'typeorm' ;
You can’t perform that action at this time.
0 commit comments