Sha256: 8b1563c9ee05967239b256ba9d5e121f31436830e4f47ef14b478cb10c0d9b12
Contents?: true
Size: 1.21 KB
Versions: 31
Compression:
Stored size: 1.21 KB
Contents
# frozen_string_literal: true require 'aranha/default_processor' require 'ehbrs_ruby_utils/videos/opensubtitles/parsers/episode' require 'ehbrs_ruby_utils/videos/opensubtitles/processors/subtitle' require 'eac_ruby_utils/core_ext' module EhbrsRubyUtils module Videos module Opensubtitles module Processors class Episode < ::Aranha::DefaultProcessor enable_simple_cache enable_speaker def perform infov source_uri, subtitles.count subtitles.each(&:perform) next_page.if_present(&:perform) end private def next_page_uncached data.fetch(:next_page_href) .if_present { |v| self.class.new(source_uri + v, extra_data) } end def subtitle_uri(subtitle_data) source_uri + subtitle_data.fetch(:href) end def subtitles_uncached data.fetch(:subtitles).map do |subtitle_data| ::EhbrsRubyUtils::Videos::Opensubtitles::Processors::Subtitle.new( subtitle_uri(subtitle_data), extra_data ) end + next_page.if_present([], &:subtitles) end end end end end end
Version data entries
31 entries across 31 versions & 1 rubygems