ehbrs-tools 0.38.0 → 0.39.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +5 -5
  3. data/Gemfile.lock +103 -81
  4. data/exe/ehbrs +1 -1
  5. data/lib/ehbrs/executables.rb +1 -8
  6. data/lib/ehbrs/observers/base.rb +2 -3
  7. data/lib/ehbrs/observers/with_persistence.rb +1 -1
  8. data/lib/ehbrs/tools/runner/finances/bb_browser.rb +2 -2
  9. data/lib/ehbrs/tools/runner/fs/used_space.rb +1 -1
  10. data/lib/ehbrs/tools/runner/google/translate.rb +1 -1
  11. data/lib/ehbrs/tools/runner/music/lyrics.rb +2 -2
  12. data/lib/ehbrs/tools/runner/music/lyrics_book.rb +1 -1
  13. data/lib/ehbrs/tools/runner/vg/ps2/rename.rb +34 -0
  14. data/lib/ehbrs/tools/runner/vg/ps2.rb +19 -0
  15. data/lib/ehbrs/tools/runner/videos/extract.rb +2 -2
  16. data/lib/ehbrs/tools/runner/videos/languages/file_runner.rb +3 -2
  17. data/lib/ehbrs/tools/runner/videos/languages.rb +2 -2
  18. data/lib/ehbrs/tools/runner/videos/probe.rb +2 -2
  19. data/lib/ehbrs/tools/runner/videos/unsupported.rb +7 -7
  20. data/lib/ehbrs/tools/runner/web_utils/videos/upload.rb +1 -1
  21. data/lib/ehbrs/tools/runner_with/filesystem_renamer.rb +103 -0
  22. data/lib/ehbrs/{videos/extract.rb → tools/runner_with.rb} +2 -2
  23. data/lib/ehbrs/tools/version.rb +1 -1
  24. data/lib/ehbrs/user_dirs.rb +1 -1
  25. metadata +16 -75
  26. data/lib/ehbrs/gems.rb +0 -37
  27. data/lib/ehbrs/videos/convert_job.rb +0 -99
  28. data/lib/ehbrs/videos/extract/package.rb +0 -75
  29. data/lib/ehbrs/videos/extract/package_file.rb +0 -53
  30. data/lib/ehbrs/videos/file.rb +0 -67
  31. data/lib/ehbrs/videos/profiles/base.rb +0 -35
  32. data/lib/ehbrs/videos/profiles/same_quality.rb +0 -21
  33. data/lib/ehbrs/videos/track.rb +0 -19
  34. data/lib/ehbrs/videos/unsupported/check_result.rb +0 -24
  35. data/lib/ehbrs/videos/unsupported/check_set.rb +0 -43
  36. data/lib/ehbrs/videos/unsupported/check_support.rb +0 -73
  37. data/lib/ehbrs/videos/unsupported/checks/codec_extra_unlisted.rb +0 -29
  38. data/lib/ehbrs/videos/unsupported/checks/codec_extra_unsupported.rb +0 -28
  39. data/lib/ehbrs/videos/unsupported/checks/codec_unlisted.rb +0 -25
  40. data/lib/ehbrs/videos/unsupported/checks/codec_unsupported.rb +0 -27
  41. data/lib/ehbrs/videos/unsupported/checks/invalid_extension.rb +0 -27
  42. data/lib/ehbrs/videos/unsupported/checks.rb +0 -13
  43. data/lib/ehbrs/videos/unsupported/file/fix.rb +0 -45
  44. data/lib/ehbrs/videos/unsupported/file.rb +0 -50
  45. data/lib/ehbrs/videos/unsupported/fix_profile.rb +0 -44
  46. data/lib/ehbrs/videos/unsupported/fixes/supported_codec.rb +0 -36
  47. data/lib/ehbrs/videos/unsupported/fixes/supported_container.rb +0 -17
  48. data/lib/ehbrs/videos/unsupported/profiles/aoc.rb +0 -27
  49. data/lib/ehbrs/videos/unsupported/profiles/base.rb +0 -116
  50. data/lib/ehbrs/videos/unsupported/profiles/philco.rb +0 -28
  51. data/lib/ehbrs/videos/unsupported/profiles/samsung.rb +0 -33
  52. data/lib/ehbrs/videos/unsupported/profiles.rb +0 -13
  53. data/lib/ehbrs/videos/unsupported/search.rb +0 -75
  54. data/lib/ehbrs/videos/unsupported/track.rb +0 -32
  55. 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