ehbrs-tools 0.39.0 → 0.39.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +40 -39
  3. data/lib/ehbrs/tools/runner/music/lyrics.rb +2 -2
  4. data/lib/ehbrs/tools/runner/music/lyrics_book.rb +1 -1
  5. data/lib/ehbrs/tools/runner/videos/extract.rb +2 -2
  6. data/lib/ehbrs/tools/runner/videos/languages/file_runner.rb +1 -1
  7. data/lib/ehbrs/tools/runner/videos/languages.rb +1 -1
  8. data/lib/ehbrs/tools/runner/videos/probe.rb +2 -2
  9. data/lib/ehbrs/tools/runner/videos/unsupported.rb +7 -7
  10. data/lib/ehbrs/tools/version.rb +1 -1
  11. metadata +4 -34
  12. data/lib/ehbrs/videos/convert_job.rb +0 -99
  13. data/lib/ehbrs/videos/extract/package.rb +0 -75
  14. data/lib/ehbrs/videos/extract/package_file.rb +0 -53
  15. data/lib/ehbrs/videos/extract.rb +0 -11
  16. data/lib/ehbrs/videos/file.rb +0 -67
  17. data/lib/ehbrs/videos/profiles/base.rb +0 -35
  18. data/lib/ehbrs/videos/profiles/same_quality.rb +0 -21
  19. data/lib/ehbrs/videos/track.rb +0 -20
  20. data/lib/ehbrs/videos/unsupported/check_result.rb +0 -24
  21. data/lib/ehbrs/videos/unsupported/check_set.rb +0 -43
  22. data/lib/ehbrs/videos/unsupported/check_support.rb +0 -71
  23. data/lib/ehbrs/videos/unsupported/checks/codec_extra_unlisted.rb +0 -29
  24. data/lib/ehbrs/videos/unsupported/checks/codec_extra_unsupported.rb +0 -28
  25. data/lib/ehbrs/videos/unsupported/checks/codec_unlisted.rb +0 -25
  26. data/lib/ehbrs/videos/unsupported/checks/codec_unsupported.rb +0 -27
  27. data/lib/ehbrs/videos/unsupported/checks/invalid_extension.rb +0 -27
  28. data/lib/ehbrs/videos/unsupported/checks.rb +0 -13
  29. data/lib/ehbrs/videos/unsupported/file/fix.rb +0 -45
  30. data/lib/ehbrs/videos/unsupported/file.rb +0 -50
  31. data/lib/ehbrs/videos/unsupported/fix_profile.rb +0 -44
  32. data/lib/ehbrs/videos/unsupported/fixes/supported_codec.rb +0 -36
  33. data/lib/ehbrs/videos/unsupported/fixes/supported_container.rb +0 -17
  34. data/lib/ehbrs/videos/unsupported/profiles/aoc.rb +0 -27
  35. data/lib/ehbrs/videos/unsupported/profiles/base.rb +0 -116
  36. data/lib/ehbrs/videos/unsupported/profiles/philco.rb +0 -28
  37. data/lib/ehbrs/videos/unsupported/profiles/samsung.rb +0 -33
  38. data/lib/ehbrs/videos/unsupported/profiles.rb +0 -13
  39. data/lib/ehbrs/videos/unsupported/search.rb +0 -75
  40. data/lib/ehbrs/videos/unsupported/track.rb +0 -32
  41. data/lib/ehbrs/videos.rb +0 -9
@@ -1,116 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Ehbrs
4
- module Videos
5
- module Unsupported
6
- module Profiles
7
- class Base
8
- enable_simple_cache
9
- include ::Singleton
10
-
11
- CONSTANT_PREFIXES = %w[video audio subtitle other].freeze
12
-
13
- def added_checks
14
- @added_checks ||= []
15
- end
16
-
17
- def add_check(name, *args)
18
- check_path = "ehbrs/videos/unsupported/checks/#{name}"
19
- added_checks << check_path.camelize.constantize.new(*args)
20
- end
21
-
22
- def base_checks
23
- [unlisted_codec_check] + unsupported_codec_checks +
24
- supported_codecs.flat_map { |codec| codec_extra_checks(codec) }
25
- end
26
-
27
- def checks
28
- base_checks + added_checks
29
- end
30
-
31
- def file_checks
32
- checks.select { |c| check_type(c) == :container }
33
- end
34
-
35
- def track_checks
36
- checks.select { |c| check_type(c) == :stream }
37
- end
38
-
39
- def codec_extra_checks(codec)
40
- codec_unlisted_extra_check(codec).if_present([]) { |v| [v] } +
41
- codec_unsupported_extras(codec).map do |extra|
42
- Ehbrs::Videos::Unsupported::Checks::CodecExtraUnsupported.new(codec, extra)
43
- end
44
- end
45
-
46
- def codec_unlisted_extra_check(codec)
47
- extras = codec_unsupported_extras(codec) + codec_supported_extras(codec)
48
- return nil unless extras.any?
49
-
50
- Ehbrs::Videos::Unsupported::Checks::CodecExtraUnlisted.new(
51
- codec, extras.sort.uniq
52
- )
53
- end
54
-
55
- def name
56
- self.class.name.demodulize.underscore
57
- end
58
-
59
- def to_s
60
- name
61
- end
62
-
63
- def unsupported_codec_checks
64
- unsupported_codecs.map do |codec|
65
- Ehbrs::Videos::Unsupported::Checks::CodecUnsupported.new(codec)
66
- end
67
- end
68
-
69
- def unsupported_codecs_uncached
70
- codecs_by_constant('unsupported')
71
- end
72
-
73
- def unlisted_codec_check
74
- ::Ehbrs::Videos::Unsupported::Checks::CodecUnlisted.new(
75
- (supported_codecs + unsupported_codecs).sort.uniq
76
- )
77
- end
78
-
79
- def supported_codecs_uncached
80
- codecs_by_constant('supported')
81
- end
82
-
83
- def codecs_by_constant(middle)
84
- CONSTANT_PREFIXES.inject([]) { |a, e| a + codecs_by_prefix(e, middle) }
85
- end
86
-
87
- def codecs_by_prefix(prefix, middle)
88
- self.class.const_get("#{prefix}_#{middle}_codecs".upcase)
89
- rescue NameError
90
- []
91
- end
92
-
93
- def codec_extras(codec, suffix)
94
- self.class.const_get("#{codec}_extra_#{suffix}".upcase)
95
- rescue NameError
96
- []
97
- end
98
-
99
- def codec_unsupported_extras(codec)
100
- codec_extras(codec, 'unsupported')
101
- end
102
-
103
- def codec_supported_extras(codec)
104
- codec_extras(codec, 'supported')
105
- end
106
-
107
- private
108
-
109
- def check_type(check)
110
- check.class.const_get(:TYPE)
111
- end
112
- end
113
- end
114
- end
115
- end
116
- end
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'ehbrs/videos/unsupported/profiles/base'
4
-
5
- module Ehbrs
6
- module Videos
7
- module Unsupported
8
- module Profiles
9
- class Philco < ::Ehbrs::Videos::Unsupported::Profiles::Base
10
- AUDIO_SUPPORTED_CODECS = %w[aac ac3 eac3 mp3 vorbis wmav2].freeze
11
- AUDIO_UNSUPPORTED_CODECS = %w[dts opus].freeze
12
-
13
- VIDEO_SUPPORTED_CODECS = %w[h264 mpeg4].freeze
14
- VIDEO_UNSUPPORTED_CODECS = %w[hevc msmpeg4v3].freeze
15
-
16
- SUBTITLE_SUPPORTED_CODECS = %w[ass dvd dvd_subtitle hdmv_pgs_subtitle mov_text
17
- subrip].freeze
18
- SUBTITLE_UNSUPPORTED_CODECS = %w[mov].freeze
19
-
20
- OTHER_SUPPORTED_CODECS = %w[png ttf].freeze
21
-
22
- MPEG4_EXTRA_SUPPORTED = %w[xvid].freeze
23
- MPEG4_EXTRA_UNSUPPORTED = %w[divx dx50].freeze
24
- end
25
- end
26
- end
27
- end
28
- end
@@ -1,33 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'ehbrs/videos/unsupported/checks/invalid_extension'
4
- require 'ehbrs/videos/unsupported/profiles/base'
5
-
6
- module Ehbrs
7
- module Videos
8
- module Unsupported
9
- module Profiles
10
- class Samsung < ::Ehbrs::Videos::Unsupported::Profiles::Base
11
- AUDIO_SUPPORTED_CODECS = %w[aac ac3 eac3 mp3 vorbis].freeze
12
- AUDIO_UNSUPPORTED_CODECS = %w[dts].freeze
13
-
14
- VIDEO_SUPPORTED_CODECS = %w[h264 mpeg4 hevc mjpeg].freeze
15
- VIDEO_UNSUPPORTED_CODECS = %w[].freeze
16
-
17
- SUBTITLE_SUPPORTED_CODECS = %w[ass dvd dvd_subtitle hdmv_pgs_subtitle subrip].freeze
18
- SUBTITLE_UNSUPPORTED_CODECS = %w[mov mov_text].freeze
19
-
20
- OTHER_SUPPORTED_CODECS = %w[png ttf].freeze
21
-
22
- MPEG4_EXTRA_SUPPORTED = %w[].freeze
23
- MPEG4_EXTRA_UNSUPPORTED = %w[dx50 xvid].freeze
24
-
25
- def initialize
26
- super()
27
- add_check('invalid_extension', '.m4v')
28
- end
29
- end
30
- end
31
- end
32
- end
33
- end
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Ehbrs
6
- module Videos
7
- module Unsupported
8
- module Profiles
9
- require_sub __FILE__
10
- end
11
- end
12
- end
13
- end
@@ -1,75 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_fs/traversable'
4
- require 'eac_ruby_utils/core_ext'
5
- require 'ehbrs/videos/unsupported/file'
6
-
7
- module Ehbrs
8
- module Videos
9
- module Unsupported
10
- class Search
11
- include ::EacFs::Traversable
12
- enable_speaker
13
- enable_simple_cache
14
-
15
- VALID_EXTENSIONS = %w[.avi .mp4 .mkv .m4v].freeze
16
-
17
- def initialize(root, file_options)
18
- @root = root
19
- @file_options = file_options
20
- @files = 0
21
- @videos = 0
22
- @unsupported = 0
23
- run
24
- end
25
-
26
- def traverser_recursive
27
- true
28
- end
29
-
30
- def traverser_sort
31
- true
32
- end
33
-
34
- private
35
-
36
- def run
37
- start_banner
38
- traverser_check_path(@root)
39
- end_banner
40
- end
41
-
42
- def traverser_check_file(file)
43
- @files += 1
44
- check_video(file) if video_file?(file)
45
- end
46
-
47
- def check_video(file)
48
- @videos += 1
49
- v = ::Ehbrs::Videos::Unsupported::File.new(file, @file_options)
50
- return if v.all_passed?
51
-
52
- @unsupported += 1
53
- v.banner
54
- v.check_fix
55
- end
56
-
57
- def start_banner
58
- infom "Searching in: \"#{@root}\""
59
- end
60
-
61
- def end_banner
62
- infom "Unsupported/Videos/Files: #{@unsupported}/#{@videos}/#{@files}"
63
- end
64
-
65
- def video_file?(path)
66
- valid_extensions.include?(::File.extname(path))
67
- end
68
-
69
- def valid_extensions
70
- self.class::VALID_EXTENSIONS
71
- end
72
- end
73
- end
74
- end
75
- end
@@ -1,32 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'ehbrs/videos/unsupported/check_support'
4
-
5
- module Ehbrs
6
- module Videos
7
- module Unsupported
8
- class Track < ::SimpleDelegator
9
- include ::Ehbrs::Videos::Unsupported::CheckSupport
10
-
11
- enable_speaker
12
- enable_simple_cache
13
- attr_reader :video
14
-
15
- def initialize(video, track)
16
- @video = video
17
- super(track)
18
- end
19
-
20
- def banner
21
- aggressions_banner("Track #{self}")
22
- end
23
-
24
- def check_set_key
25
- :track_check_set
26
- end
27
-
28
- delegate :options, to: :video
29
- end
30
- end
31
- end
32
- end
data/lib/ehbrs/videos.rb DELETED
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Ehbrs
6
- module Videos
7
- require_sub __FILE__
8
- end
9
- end