File tree 1 file changed +6
-2
lines changed
apps/graphql-api/src/shared/subtitles
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { Download } from '@pct-org/mongo-models'
4
4
import { TorrentFile } from 'webtorrent'
5
5
import * as OpenSubtitles from 'opensubtitles-api'
6
6
import { createWriteStream } from 'fs'
7
+ import { resolve } from 'path'
7
8
8
9
import { ConfigService } from '../config/config.service'
9
10
import { SubtitleInterface } from './subtitle.interface'
@@ -52,7 +53,10 @@ export class SubtitlesService {
52
53
this . logger . log ( `[${ download . _id } ]: Search for subtitles` )
53
54
54
55
const filename = torrent . name
55
- const location = `${ this . configService . get ( ConfigService . DOWNLOAD_LOCATION ) } /${ download . _id } `
56
+ const location = resolve (
57
+ this . configService . get ( ConfigService . DOWNLOAD_LOCATION ) ,
58
+ download . _id
59
+ )
56
60
57
61
let imdbid = download . _id
58
62
let season = null
@@ -70,7 +74,7 @@ export class SubtitlesService {
70
74
const subtitles = await this . client . search ( {
71
75
sublanguageid : 'all' ,
72
76
filesize : torrent . length ,
73
- path : ` ${ location } / ${ torrent . path } ` ,
77
+ path : resolve ( location , torrent . path ) ,
74
78
imdbid,
75
79
filename,
76
80
season,
You can’t perform that action at this time.
0 commit comments