Skip to content

Commit 92636f7

Browse files
committed
fix: Fixes for typescript
1 parent 9145b24 commit 92636f7

File tree

4 files changed

+16
-17
lines changed

4 files changed

+16
-17
lines changed

apps/api/src/seasons/seasons.service.ts

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Injectable } from '@nestjs/common'
22
import { InjectModel } from '@nestjs/mongoose'
3-
43
import { Season, SeasonModel } from '@pct-org/mongo-models'
54

65
@Injectable()
@@ -29,16 +28,11 @@ export class SeasonsService {
2928
)
3029
}
3130

32-
public async findOne(id: string, lean = true): Promise<Season[]> {
31+
public async findOne(id: string, lean = true): Promise<Season> {
3332
return this.seasonModel.findById(
3433
id,
3534
{},
3635
{
37-
// skip: showsArgs.offset,
38-
// limit: showsArgs.limit,
39-
sort: {
40-
number: 0 // Sort on season number
41-
},
4236
lean
4337
}
4438
)

apps/api/src/shared/torrent/torrent.service.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ export class TorrentService implements OnApplicationBootstrap {
9595
this.maxConcurrent = this.configService.get(ConfigService.MAX_CONCURRENT_DOWNLOADS)
9696
}
9797

98-
protected onApplicationBootstrap(): void {
98+
/**
99+
* When application boots we want to check for incomplete or queued downloads ti start
100+
*/
101+
public onApplicationBootstrap(): void {
99102
// Check for incomplete downloads and add them to the downloads
100103
this.checkForIncompleteDownloads()
101104
}

apps/api/src/status/status.service.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ export class StatusService {
4040

4141
return {
4242
version: 'unknown', // TODO:: Get git tag
43-
totalMovies: this.movieModel.countDocuments(),
44-
totalShows: this.showModel.countDocuments(),
45-
totalEpisodes: this.episodesModel.countDocuments(),
43+
totalMovies: await this.movieModel.countDocuments(),
44+
totalShows: await this.showModel.countDocuments(),
45+
totalEpisodes: await this.episodesModel.countDocuments(),
4646
disk: {
4747
free: formatKbToString(disk.available, false),
4848
used: formatKbToString(folderSize, false),

libs/mongo-models/src/download/download.object-type.ts

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { Field, ObjectType } from '@nestjs/graphql'
22

3-
import { Episode, Movie, Subtitle } from '../'
3+
import { Episode } from '../episode/episode.object-type'
4+
import { Movie } from '../movie/movie.object-type'
5+
import { Subtitle } from '../shared/subtitle.object-type'
46

57
@ObjectType()
68
export class Download {
@@ -15,7 +17,7 @@ export class Download {
1517
itemType: string
1618

1719
@Field({ description: 'The type of torrent, default or searched.', defaultValue: 'scraped' })
18-
torrentType: string
20+
torrentType?: string
1921

2022
@Field(type => Episode, {
2123
description: 'The episode if type === "episode".',
@@ -38,16 +40,16 @@ export class Download {
3840
progress: number
3941

4042
@Field({ description: 'Status of the download.', defaultValue: 'queued' })
41-
status: string
43+
status?: string
4244

4345
@Field({ description: 'Remaining time for the download.', nullable: true })
44-
timeRemaining: string
46+
timeRemaining?: string
4547

4648
@Field({ description: 'Formatted download speed.', nullable: true })
47-
speed: string
49+
speed?: string
4850

4951
@Field({ description: 'Number of peers of the download.', nullable: true })
50-
numPeers: number
52+
numPeers?: number
5153

5254
@Field({ description: 'The time at which the download was created.' })
5355
createdAt: number

0 commit comments

Comments
 (0)