Skip to content
This repository was archived by the owner on Mar 28, 2024. It is now read-only.

Commit 69e05df

Browse files
committed
refactor: changes according to lint rules
1 parent 7b17786 commit 69e05df

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

packages/server/src/modules/author/author.service.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@ export class AuthorService extends TypeOrmQueryService<AuthorEntity> {
1414
}
1515

1616
async findOrCreate(name: string): Promise<AuthorEntity> {
17-
var authors: AuthorEntity[] = await this.query({
17+
const authors: AuthorEntity[] = await this.query({
1818
filter: { name: { eq: name } },
1919
});
2020

21+
let author: AuthorEntity;
22+
2123
if (authors.length <= 0) {
22-
var author: AuthorEntity = await this.createOne({ name: name });
24+
author = await this.createOne({ name: name });
2325
} else {
24-
var author = authors[0];
26+
author = authors[0];
2527
}
2628

2729
return author;

packages/server/src/modules/episode/episode.service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class EpisodeService extends TypeOrmQueryService<EpisodeEntity> {
1515
}
1616

1717
async create(item: Item): Promise<EpisodeEntity> {
18-
var episode = new EpisodeEntity();
18+
const episode = new EpisodeEntity();
1919

2020
episode.title = item.title;
2121
episode.publication = new Date(item.pubDate);

packages/server/src/modules/podcast/podcast.service.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class PodcastService extends TypeOrmQueryService<PodcastEntity> {
4040
async parseFromQueue() {
4141
this.logger.info('Starting parsing for next podcast.');
4242

43-
var next: QueueEntity[] = await this.queueService.query({
43+
const next: QueueEntity[] = await this.queueService.query({
4444
filter: {
4545
or: [{ completed: { is: false } }, { completed: { is: null } }],
4646
},
@@ -56,11 +56,11 @@ export class PodcastService extends TypeOrmQueryService<PodcastEntity> {
5656
next.forEach(async (cast) => {
5757
this.logger.info('Parsing %s ...', cast.url);
5858

59-
var podcast: PodcastEntity = await this.query({
59+
let podcast: PodcastEntity = await this.query({
6060
filter: { link: { eq: cast.url } },
6161
})[0];
6262

63-
var data: Parser.Output = await this.rss
63+
const data: Parser.Output = await this.rss
6464
.parseURL(cast.url)
6565
.catch((error) => {
6666
this.logger.error(error.message);
@@ -78,7 +78,7 @@ export class PodcastService extends TypeOrmQueryService<PodcastEntity> {
7878
podcast = new PodcastEntity();
7979
}
8080

81-
var author = await this.authorService.findOrCreate(data.itunes.author);
81+
const author = await this.authorService.findOrCreate(data.itunes.author);
8282

8383
podcast.title = data.title;
8484
podcast.image = data.image.url;
@@ -88,10 +88,10 @@ export class PodcastService extends TypeOrmQueryService<PodcastEntity> {
8888
podcast.explicit = data.itunes.explicit === 'true' ? true : false;
8989
podcast.author = author;
9090

91-
podcast.episodes = new Array();
91+
podcast.episodes = [];
9292

9393
data.items.forEach(async (item) => {
94-
var episode = await this.episodeService.create(item);
94+
const episode = await this.episodeService.create(item);
9595
podcast.episodes.push(episode);
9696
});
9797

0 commit comments

Comments
 (0)