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.39.0 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.38.0 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.37.0 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.36.0 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.35.1 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.35.0 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.34.0 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.33.0 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.32.0 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.31.1 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.31.0 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.30.0 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.29.0 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.28.3 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.28.2 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.28.1 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.28.0 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.27.0 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.26.0 lib/ehbrs/videos/unsupported/file/fix.rb
ehbrs-tools-0.25.1 lib/ehbrs/videos/unsupported/file/fix.rb