Class: SeriesSub

Inherits:
Object
  • Object
show all
Defined in:
lib/sites/seriessub.rb

Overview

Instance Method Summary collapse

Constructor Details

#initialize(inspector) ⇒ SeriesSub

Returns a new instance of SeriesSub.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/sites/seriessub.rb', line 8

def initialize(inspector)
  @inspector = inspector
  episodes = @inspector.episodes.select { |e| e.need_srt?(@inspector.langs) }

  $stdout.print "------------------------------------------\n"
  $stdout.print "Start srt searching from www.seriessub.com\n"
  $stdout.print "------------------------------------------\n"
  episodes.each do |e|
    @inspector.langs.each do |l|
      unless e.srt.include?(l) 
        $stdout.print "#{e.episode_name_with_format} [#{l}]: "
        if get_srt(e, l)
          inspector.log.info "#{e.episode_name_with_format} [#{l}] // SeriesSub // #{@srt_name}"
          $stdout.print "FOUND\n"
          e.srt << l
          @inspector.growl_episode(e, l)
          break
        else
          $stdout.print "NOT FOUND\n"
        end
      end
    end
  end
end