Remove episode and volume filter, they were buggy and useless.

Use the @URL syntax do download a single episode.
This commit is contained in:
Godzil
2018-07-14 20:38:07 +01:00
parent 6448f4ec97
commit f10bead0dc
4 changed files with 0 additions and 44 deletions

View File

@@ -192,9 +192,6 @@ function parse(args: string[]): IConfigLine
// Disables
.option('-c, --cache', 'Disables the cache.')
.option('-m, --merge', 'Disables merging subtitles and videos.')
// Filters
.option('-e, --episode <i>', 'The episode filter.')
.option('-v, --volume <i>', 'The volume filter.')
// Settings
.option('-f, --format <s>', 'The subtitle format. (Default: ass)')
.option('-o, --output <s>', 'The output path.')

View File

@@ -5,9 +5,6 @@ interface IConfig {
// Disables
cache?: boolean;
merge?: boolean;
// Filters
episode?: number;
volume?: number;
// Settings
format?: string;
output?: string;

View File

@@ -113,11 +113,6 @@ function download(cache: {[address: string]: number}, config: IConfig,
baseAddress: string, item: ISeriesEpisode,
done: (err: Error, ign: boolean) => void)
{
if (!filter(config, item))
{
return done(null, false);
}
const address = url.resolve(baseAddress, item.address);
if (cache[address])
@@ -137,30 +132,6 @@ function download(cache: {[address: string]: number}, config: IConfig,
});
}
/**
* Filters the item based on the configuration.
*/
function filter(config: IConfig, item: ISeriesEpisode)
{
// Filter on chapter.
const episodeFilter = config.episode;
// Filter on volume.
const volumeFilter = config.volume;
const currentEpisode = parseInt(item.episode, 10);
const currentVolume = item.volume;
if ( ( (episodeFilter > 0) && (currentEpisode <= episodeFilter) ) ||
( (episodeFilter < 0) && (currentEpisode >= -episodeFilter) ) ||
( (volumeFilter > 0) && (currentVolume <= volumeFilter ) ) ||
( (volumeFilter < 0) && (currentVolume >= -volumeFilter ) ) )
{
return false;
}
return true;
}
/**
* Requests the page and scrapes the episodes and series.
*/