diff --git a/README.md b/README.md index 1034948..fb26e45 100644 --- a/README.md +++ b/README.md @@ -71,8 +71,6 @@ The [command-line interface](http://en.wikipedia.org/wiki/Command-line_interface -u, --user The e-mail address or username. -c, --cache Disables the cache. -m, --merge Disables merging subtitles and videos. - -e, --episode The episode filter. - -v, --volume The volume filter. -f, --format The subtitle format. (Default: ass) -o, --output The output path. -s, --series 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 ` filters episodes (positive is greater than, negative is smaller than). -* `-v or --volume ` filters volumes (positive is greater than, negative is smaller than). - -_These parameters are probably extremely buggy at the moment..._ - ##### Settings * `-f or --format ` sets the subtitle format. (Default: ass) diff --git a/src/batch.ts b/src/batch.ts index eac90e3..46d30e6 100644 --- a/src/batch.ts +++ b/src/batch.ts @@ -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 ', 'The episode filter.') - .option('-v, --volume ', 'The volume filter.') // Settings .option('-f, --format ', 'The subtitle format. (Default: ass)') .option('-o, --output ', 'The output path.') diff --git a/src/interface/IConfig.d.ts b/src/interface/IConfig.d.ts index c191bac..71b0ea5 100644 --- a/src/interface/IConfig.d.ts +++ b/src/interface/IConfig.d.ts @@ -5,9 +5,6 @@ interface IConfig { // Disables cache?: boolean; merge?: boolean; - // Filters - episode?: number; - volume?: number; // Settings format?: string; output?: string; diff --git a/src/series.ts b/src/series.ts index 061e8ee..b3d6ff6 100644 --- a/src/series.ts +++ b/src/series.ts @@ -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. */