File tree 4 files changed +16
-17
lines changed
libs/mongo-models/src/download
4 files changed +16
-17
lines changed Original file line number Diff line number Diff line change 1
1
import { Injectable } from '@nestjs/common'
2
2
import { InjectModel } from '@nestjs/mongoose'
3
-
4
3
import { Season , SeasonModel } from '@pct-org/mongo-models'
5
4
6
5
@Injectable ( )
@@ -29,16 +28,11 @@ export class SeasonsService {
29
28
)
30
29
}
31
30
32
- public async findOne ( id : string , lean = true ) : Promise < Season [ ] > {
31
+ public async findOne ( id : string , lean = true ) : Promise < Season > {
33
32
return this . seasonModel . findById (
34
33
id ,
35
34
{ } ,
36
35
{
37
- // skip: showsArgs.offset,
38
- // limit: showsArgs.limit,
39
- sort : {
40
- number : 0 // Sort on season number
41
- } ,
42
36
lean
43
37
}
44
38
)
Original file line number Diff line number Diff line change @@ -95,7 +95,10 @@ export class TorrentService implements OnApplicationBootstrap {
95
95
this . maxConcurrent = this . configService . get ( ConfigService . MAX_CONCURRENT_DOWNLOADS )
96
96
}
97
97
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 {
99
102
// Check for incomplete downloads and add them to the downloads
100
103
this . checkForIncompleteDownloads ( )
101
104
}
Original file line number Diff line number Diff line change @@ -40,9 +40,9 @@ export class StatusService {
40
40
41
41
return {
42
42
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 ( ) ,
46
46
disk : {
47
47
free : formatKbToString ( disk . available , false ) ,
48
48
used : formatKbToString ( folderSize , false ) ,
Original file line number Diff line number Diff line change 1
1
import { Field , ObjectType } from '@nestjs/graphql'
2
2
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'
4
6
5
7
@ObjectType ( )
6
8
export class Download {
@@ -15,7 +17,7 @@ export class Download {
15
17
itemType : string
16
18
17
19
@Field ( { description : 'The type of torrent, default or searched.' , defaultValue : 'scraped' } )
18
- torrentType : string
20
+ torrentType ? : string
19
21
20
22
@Field ( type => Episode , {
21
23
description : 'The episode if type === "episode".' ,
@@ -38,16 +40,16 @@ export class Download {
38
40
progress : number
39
41
40
42
@Field ( { description : 'Status of the download.' , defaultValue : 'queued' } )
41
- status : string
43
+ status ? : string
42
44
43
45
@Field ( { description : 'Remaining time for the download.' , nullable : true } )
44
- timeRemaining : string
46
+ timeRemaining ? : string
45
47
46
48
@Field ( { description : 'Formatted download speed.' , nullable : true } )
47
- speed : string
49
+ speed ? : string
48
50
49
51
@Field ( { description : 'Number of peers of the download.' , nullable : true } )
50
- numPeers : number
52
+ numPeers ? : number
51
53
52
54
@Field ( { description : 'The time at which the download was created.' } )
53
55
createdAt : number
You can’t perform that action at this time.
0 commit comments