Class: Podnapisi

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

Overview

Instance Method Summary collapse

Constructor Details

#initialize(inspector) ⇒ Podnapisi

Returns a new instance of Podnapisi.



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

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.podnapisi.net\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}] // Podnapisi // #{@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