addic7ed_downloader 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 83c1432b32d4da49732cec95bfb9d9e2f8d3f587
4
- data.tar.gz: 571af168a3af02b753dde537266c469ed41422ab
3
+ metadata.gz: 7e8291a5cc00db31a5135428ffbe38b85af7026b
4
+ data.tar.gz: acacc9165cdd48303465df2debec24abc6c4b192
5
5
  SHA512:
6
- metadata.gz: e20a724c07ba974f9394dc670e4a76bf24ac92890f2a72e39183987fdbb8e588c058a1aa98c3c37461a593eafc9ed8455b206207b16c9449cb9fb57aa38e9e18
7
- data.tar.gz: d0046e5dadb87deafe45e69adadc511b9e30150daa756ea76a1a82fe0e6df5ce18586c52ce2a8de7831075ada35c830f70ff658230deb469253460931e7c531c
6
+ metadata.gz: c520ba0be1e905eb0bc8042c68d1fc8d332a9c6000e67bc9ef39e2408a8d154fda43623b83b1321beb150f5cdc4eca1c6758b2545df36a32cecbecc5b3c4f526
7
+ data.tar.gz: 91e6a2056e1689d4a9100d078db36a197a23ad94529ea460debf61425cf684c8af97a12ce4aa5e9abf277c7ba44617acbf09891d102a63869cbb8a647687703a
@@ -1,6 +1,4 @@
1
1
  require 'addic7ed_downloader/search'
2
- require 'addic7ed_downloader/search_filename'
3
- require 'addic7ed_downloader/search_string'
4
2
  require 'addic7ed_downloader/subtitle'
5
3
  require 'addic7ed_downloader/common'
6
4
  require 'addic7ed_downloader/version'
@@ -12,6 +12,24 @@ module Addic7edDownloader
12
12
 
13
13
  attr_accessor :showname, :season, :episode, :lang, :tags, :path
14
14
 
15
+ def self.by_filename(filename, options = {})
16
+ showname = filename[SHOWNAME_REGEXP, 1].strip
17
+ season = filename[SEASON_REGEXP, 1].to_i
18
+ episode = filename[EPISODE_REGEXP, 1].to_i
19
+ options[:tags] = filename[TAGS_REGEXP, 1].split(TAGS_FILTER_REGEXP)
20
+
21
+ new(showname, season, episode, options)
22
+ end
23
+
24
+ def self.by_string(search_string, options = {})
25
+ showname = search_string[SHOWNAME_REGEXP, 1].strip
26
+ season = search_string[SEASON_REGEXP, 1].to_i
27
+ episode = search_string[EPISODE_REGEXP, 1].to_i
28
+ options[:tags] = options[:filename][TAGS_REGEXP, 1].split(TAGS_FILTER_REGEXP) if options[:filename]
29
+
30
+ new(showname, season, episode, options)
31
+ end
32
+
15
33
  def initialize(showname, season, episode, options = {})
16
34
  @showname = showname
17
35
  @season = season.to_i
@@ -81,7 +99,7 @@ module Addic7edDownloader
81
99
 
82
100
  # Create a list with results
83
101
  subtitles = page.css('div#container95m').each_with_object([]) do |subtitle, list|
84
- list << Addic7ed::Subtitle.new(subtitle) if subtitle.at('.NewsTitle')
102
+ list << Subtitle.new(subtitle) if subtitle.at('.NewsTitle')
85
103
  end
86
104
 
87
105
  subtitles.sort!.reverse!
@@ -1,3 +1,3 @@
1
1
  module Addic7edDownloader
2
- VERSION = '0.1.1'.freeze
2
+ VERSION = '0.1.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: addic7ed_downloader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Marchante
@@ -185,8 +185,6 @@ files:
185
185
  - lib/addic7ed_downloader.rb
186
186
  - lib/addic7ed_downloader/common.rb
187
187
  - lib/addic7ed_downloader/search.rb
188
- - lib/addic7ed_downloader/search_filename.rb
189
- - lib/addic7ed_downloader/search_string.rb
190
188
  - lib/addic7ed_downloader/subtitle.rb
191
189
  - lib/addic7ed_downloader/version.rb
192
190
  homepage: https://github.com/iovis9/addic7ed_downloader
@@ -1,12 +0,0 @@
1
- module Addic7edDownloader
2
- module SearchFilename
3
- def self.search(filename, options = {})
4
- showname = filename[SHOWNAME_REGEXP, 1].strip
5
- season = filename[SEASON_REGEXP, 1].to_i
6
- episode = filename[EPISODE_REGEXP, 1].to_i
7
- options[:tags] = filename[TAGS_REGEXP, 1].split(TAGS_FILTER_REGEXP)
8
-
9
- Search.new(showname, season, episode, options)
10
- end
11
- end
12
- end
@@ -1,12 +0,0 @@
1
- module Addic7edDownloader
2
- module SearchString
3
- def self.search(search_string, options = {})
4
- showname = search_string[SHOWNAME_REGEXP, 1].strip
5
- season = search_string[SEASON_REGEXP, 1].to_i
6
- episode = search_string[EPISODE_REGEXP, 1].to_i
7
- options[:tags] = options[:filename][TAGS_REGEXP, 1].split(TAGS_FILTER_REGEXP)
8
-
9
- Search.new(showname, season, episode, options)
10
- end
11
- end
12
- end