Remove episode and volume filter, they were buggy and useless.
Use the @URL syntax do download a single episode.
This commit is contained in:
parent
6448f4ec97
commit
f10bead0dc
@ -71,8 +71,6 @@ The [command-line interface](http://en.wikipedia.org/wiki/Command-line_interface
|
||||
-u, --user <s> The e-mail address or username.
|
||||
-c, --cache Disables the cache.
|
||||
-m, --merge Disables merging subtitles and videos.
|
||||
-e, --episode <i> The episode filter.
|
||||
-v, --volume <i> The volume filter.
|
||||
-f, --format <s> The subtitle format. (Default: ass)
|
||||
-o, --output <s> The output path.
|
||||
-s, --series <s> The series override.
|
||||
@ -117,13 +115,6 @@ Download *Fairy Tail* to `C:\Anime`:
|
||||
* `-c or --cache` disables the cache in batch mode.
|
||||
* `-m or --merge` disables merging subtitles and videos.
|
||||
|
||||
##### Filters
|
||||
|
||||
* `-e or --episode <i>` filters episodes (positive is greater than, negative is smaller than).
|
||||
* `-v or --volume <i>` filters volumes (positive is greater than, negative is smaller than).
|
||||
|
||||
_These parameters are probably extremely buggy at the moment..._
|
||||
|
||||
##### Settings
|
||||
|
||||
* `-f or --format <s>` sets the subtitle format. (Default: ass)
|
||||
|
||||
@ -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.')
|
||||
|
||||
3
src/interface/IConfig.d.ts
vendored
3
src/interface/IConfig.d.ts
vendored
@ -5,9 +5,6 @@ interface IConfig {
|
||||
// Disables
|
||||
cache?: boolean;
|
||||
merge?: boolean;
|
||||
// Filters
|
||||
episode?: number;
|
||||
volume?: number;
|
||||
// Settings
|
||||
format?: string;
|
||||
output?: string;
|
||||
|
||||
@ -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.
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user