Make tslint happy!

This commit is contained in:
Godzil 2018-06-01 21:23:05 +01:00
parent 849c7612aa
commit 7c04fb7282
10 changed files with 60 additions and 55 deletions

View File

@ -32,7 +32,7 @@ export default function(args: string[], done: (err?: Error) => void)
}
catch (e)
{
log.warn(`Invalid resolution ${config.resolution}p. Setting to 1080p`);
log.warn('Invalid resolution ' + config.resolution + 'p. Setting to 1080p');
config.video_format = resol_table['1080'].format;
config.video_quality = resol_table['1080'].quality;
}
@ -46,7 +46,10 @@ export default function(args: string[], done: (err?: Error) => void)
tasks(config, batchPath, (err, tasksArr) =>
{
if (err) return done(err);
if (err)
{
return done(err);
}
let i = 0;

View File

@ -8,6 +8,6 @@ batch(process.argv, (err: any) =>
console.error(err.stack || err);
process.exit(-1);
}
console.log('Done!');
console.info('Done!');
process.exit(0);
});

View File

@ -271,7 +271,7 @@ function scrapePage(config: IConfig, address: string, done: (err: Error, page?:
const regexp = /\s*([^\n\r\t\f]+)\n?\s*[^0-9]*([0-9][\-0-9.]*)?,?\n?\s\s*[^0-9]*((PV )?[S0-9][P0-9.]*[a-fA-F]?)/;
const look = $('#showmedia_about_media').text();
const seasonTitle = $('span[itemprop="title"]').text();
let episodeTitle = $('#showmedia_about_name').text().replace(/[“”]/g, '');
const episodeTitle = $('#showmedia_about_name').text().replace(/[“”]/g, '');
const data = regexp.exec(look);
if (!swf || !data)

View File

@ -2,7 +2,7 @@
import cheerio = require('cheerio');
import episode from './episode';
import fs = require('fs');
const fse = require('fs-extra');
import fse = require('fs-extra');
import my_request = require('./my_request');
import path = require('path');
import url = require('url');
@ -153,7 +153,7 @@ function page(config: IConfig, address: string, done: (err: Error, result?: ISer
episode: '',
volume: 0,
});
done(null, {episodes: episodes.reverse(), series: ""});
done(null, {episodes: episodes.reverse(), series: ''});
}
else
{
@ -195,7 +195,7 @@ function page(config: IConfig, address: string, done: (err: Error, result?: ISer
});
if (episodeCount === 0)
{
log.warn("No episodes found for " + title + ". Could it be a movie?");
log.warn('No episodes found for ' + title + '. Could it be a movie?');
}
done(null, {episodes: episodes.reverse(), series: title});
});

View File

@ -33,10 +33,10 @@ export default function(input: string|Buffer, done: (err: Error, subtitle?: stri
*/
function event(block: ISubtitleEvent): string
{
var format = 'Layer,Start,End,Style,Name,MarginL,MarginR,MarginV,Effect,Text';
const format = 'Layer,Start,End,Style,Name,MarginL,MarginR,MarginV,Effect,Text';
return '[Events]\n' +
'Format: ' + format + '\n' + [].concat(block.event).map(style => ('Dialogue: 0,' +
'Format: ' + format + '\n' + [].concat(block.event).map((style) => ('Dialogue: 0,' +
style.$.start + ',' +
style.$.end + ',' +
style.$.style + ',' +
@ -70,13 +70,13 @@ function script(block: ISubtitle): string
*/
function style(block: ISubtitleStyle): string
{
var format = 'Name,Fontname,Fontsize,PrimaryColour,SecondaryColour,' +
const format = 'Name,Fontname,Fontsize,PrimaryColour,SecondaryColour,' +
'OutlineColour,BackColour,Bold,Italic,Underline,StrikeOut,ScaleX,' +
'ScaleY,Spacing,Angle,BorderStyle,Outline,Shadow,Alignment,' +
'MarginL,MarginR,MarginV,Encoding';
return '[V4+ Styles]\n' +
'Format: ' + format + '\n' + [].concat(block.style).map(style => 'Style: ' +
'Format: ' + format + '\n' + [].concat(block.style).map((style) => 'Style: ' +
style.$.name + ',' +
style.$.font_name + ',' +
style.$.font_size + ',' +

View File

@ -2,7 +2,7 @@
import ass from './ass';
import srt from './srt';
export default <IFormatterTable> {
ass: ass,
srt: srt
};
export default {
ass,
srt
} as IFormatterTable;

View File

@ -27,7 +27,8 @@ export default function(rtmpUrl: string, rtmpInputPath: string, swfUrl: string,
'-i "' + rtmpInputPath + '" ' +
'-c copy -bsf:a aac_adtstoasc ' +
'"' + filePath + '.mp4"';
childProcess.exec(cmd, {
childProcess.exec(cmd,
{
maxBuffer: Infinity,
}, done);
}

View File

@ -17,11 +17,12 @@
"member-ordering": false,
"no-shadowed-variable": false,
"array-type": [true, "array"],
"object-literal-sort-keys": false,
"trailing-comma": false,
"no-any": false,
"no-arg": true,
"no-bitwise": true,
"space-within-parens": false,
"no-object-literal-type-assertion": false,
"no-console": [true,
"debug",
"time",