@@ -40,7 +40,7 @@ export class PodcastService extends TypeOrmQueryService<PodcastEntity> {
40
40
async parseFromQueue ( ) {
41
41
this . logger . info ( 'Starting parsing for next podcast.' ) ;
42
42
43
- var next : QueueEntity [ ] = await this . queueService . query ( {
43
+ const next : QueueEntity [ ] = await this . queueService . query ( {
44
44
filter : {
45
45
or : [ { completed : { is : false } } , { completed : { is : null } } ] ,
46
46
} ,
@@ -56,11 +56,11 @@ export class PodcastService extends TypeOrmQueryService<PodcastEntity> {
56
56
next . forEach ( async ( cast ) => {
57
57
this . logger . info ( 'Parsing %s ...' , cast . url ) ;
58
58
59
- var podcast : PodcastEntity = await this . query ( {
59
+ let podcast : PodcastEntity = await this . query ( {
60
60
filter : { link : { eq : cast . url } } ,
61
61
} ) [ 0 ] ;
62
62
63
- var data : Parser . Output = await this . rss
63
+ const data : Parser . Output = await this . rss
64
64
. parseURL ( cast . url )
65
65
. catch ( ( error ) => {
66
66
this . logger . error ( error . message ) ;
@@ -78,7 +78,7 @@ export class PodcastService extends TypeOrmQueryService<PodcastEntity> {
78
78
podcast = new PodcastEntity ( ) ;
79
79
}
80
80
81
- var author = await this . authorService . findOrCreate ( data . itunes . author ) ;
81
+ const author = await this . authorService . findOrCreate ( data . itunes . author ) ;
82
82
83
83
podcast . title = data . title ;
84
84
podcast . image = data . image . url ;
@@ -88,10 +88,10 @@ export class PodcastService extends TypeOrmQueryService<PodcastEntity> {
88
88
podcast . explicit = data . itunes . explicit === 'true' ? true : false ;
89
89
podcast . author = author ;
90
90
91
- podcast . episodes = new Array ( ) ;
91
+ podcast . episodes = [ ] ;
92
92
93
93
data . items . forEach ( async ( item ) => {
94
- var episode = await this . episodeService . create ( item ) ;
94
+ const episode = await this . episodeService . create ( item ) ;
95
95
podcast . episodes . push ( episode ) ;
96
96
} ) ;
97
97
0 commit comments