Browse Source

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

Use the @URL syntax do download a single episode.
Godzil 5 years ago
parent
commit
f10bead0dc
4 changed files with 0 additions and 44 deletions
  1. 0 9
      README.md
  2. 0 3
      src/batch.ts
  3. 0 3
      src/interface/IConfig.d.ts
  4. 0 29
      src/series.ts

+ 0 - 9
README.md

@@ -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)

+ 0 - 3
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 <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.')

+ 0 - 3
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;

+ 0 - 29
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.
  */