Sha256: 66812cfbc050a39d326dcbd438b583dffed46f63ac46859c4ceabf26bb44c2a0

Contents?: true

Size: 1.03 KB

Versions: 50

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

require 'ehbrs/videos/convert_job'
require 'ehbrs/videos/file'
require 'ehbrs/videos/unsupported/fix_profile'

module Ehbrs
  module Videos
    module Unsupported
      class File < ::Ehbrs::Videos::File
        module Fix
          def check_fix
            return unless options.fetch(:fix)

            if fix_blocks.any?
              infom '  * Cannot fix:'
              fix_blocks.each do |fb|
                infom "    * #{fb.check.check_name}"
              end
            else
              infom '  * Fixing...'
              infom "  * Fixed in: \"#{fix}\""
            end
          end

          private

          def all_fix_blocks_uncached
            fix_blocks + tracks.flat_map(&:fix_blocks)
          end

          def fix_profile_uncached
            ::Ehbrs::Videos::Unsupported::FixProfile.new(self)
          end

          def fix
            job = ::Ehbrs::Videos::ConvertJob.new(path, fix_profile)
            job.run
            job.target
          end
        end
      end
    end
  end
end

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
ehbrs-tools-0.25.0 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.24.0 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.23.1 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.23.0 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.22.0 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.21.0 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.20.0 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.19.0 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.18.0 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.17.0 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.16.5 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.16.4 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.16.3 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.16.2 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.16.1 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.16.0 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.15.0 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.14.1 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.14.0 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.13.1 lib/ehbrs/videos/unsupported/file/fix.rb