Sha256: a749fc4ca0ab1cd166985f6cac112c9e49c7f54fb071b3b35f170a17bababf5c

Contents?: true

Size: 959 Bytes

Versions: 18

Compression:

Stored size: 959 Bytes

Contents

# frozen_string_literal: true

require 'aranha/default_processor'
require 'ehbrs_ruby_utils/videos/opensubtitles/parsers/title'
require 'ehbrs_ruby_utils/videos/opensubtitles/processors/episode'
require 'eac_ruby_utils/core_ext'

module EhbrsRubyUtils
  module Videos
    module Opensubtitles
      module Processors
        class Title < ::Aranha::DefaultProcessor
          enable_simple_cache
          enable_speaker

          def perform
            infov 'Episodes', episodes.count
            episodes.each(&:perform)
          end

          private

          def episode_uri(episode_data)
            source_uri + episode_data.fetch(:href)
          end

          def episodes_uncached
            data.fetch(:episodes).map do |episode_data|
              ::EhbrsRubyUtils::Videos::Opensubtitles::Processors::Episode
                .new(episode_uri(episode_data), extra_data)
            end
          end
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
ehbrs_ruby_utils-0.33.0 lib/ehbrs_ruby_utils/videos/opensubtitles/processors/title.rb
ehbrs_ruby_utils-0.32.0 lib/ehbrs_ruby_utils/videos/opensubtitles/processors/title.rb
ehbrs_ruby_utils-0.31.0 lib/ehbrs_ruby_utils/videos/opensubtitles/processors/title.rb
ehbrs_ruby_utils-0.30.0 lib/ehbrs_ruby_utils/videos/opensubtitles/processors/title.rb
ehbrs_ruby_utils-0.29.0 lib/ehbrs_ruby_utils/videos/opensubtitles/processors/title.rb
ehbrs_ruby_utils-0.28.0 lib/ehbrs_ruby_utils/videos/opensubtitles/processors/title.rb
ehbrs_ruby_utils-0.27.1 lib/ehbrs_ruby_utils/videos/opensubtitles/processors/title.rb
ehbrs_ruby_utils-0.27.0 lib/ehbrs_ruby_utils/videos/opensubtitles/processors/title.rb
ehbrs_ruby_utils-0.26.0 lib/ehbrs_ruby_utils/videos/opensubtitles/processors/title.rb
ehbrs_ruby_utils-0.25.1 lib/ehbrs_ruby_utils/videos/opensubtitles/processors/title.rb
ehbrs_ruby_utils-0.25.0 lib/ehbrs_ruby_utils/videos/opensubtitles/processors/title.rb
ehbrs_ruby_utils-0.24.1 lib/ehbrs_ruby_utils/videos/opensubtitles/processors/title.rb
ehbrs_ruby_utils-0.24.0 lib/ehbrs_ruby_utils/videos/opensubtitles/processors/title.rb
ehbrs_ruby_utils-0.23.0 lib/ehbrs_ruby_utils/videos/opensubtitles/processors/title.rb
ehbrs_ruby_utils-0.22.0 lib/ehbrs_ruby_utils/videos/opensubtitles/processors/title.rb
ehbrs_ruby_utils-0.21.0 lib/ehbrs_ruby_utils/videos/opensubtitles/processors/title.rb
ehbrs_ruby_utils-0.20.0 lib/ehbrs_ruby_utils/videos/opensubtitles/processors/title.rb
ehbrs_ruby_utils-0.19.0 lib/ehbrs_ruby_utils/videos/opensubtitles/processors/title.rb