movie_organizer 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG +5 -0
- data/lib/movie_organizer/media.rb +1 -0
- data/lib/movie_organizer/version.rb +1 -1
- data/spec/lib/movie_organizer/media_spec.rb +2 -1
- data/spec/lib/movie_organizer/movie_spec.rb +60 -32
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a28b7b48ec7f557670cc640b987534dba854888ecb6fa82652edb99af1999e61
|
4
|
+
data.tar.gz: 6274d25406a319fb04e31c599b17941d5d9b860fa55752f38db5296e375f7913
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa2d1fff8f2f40c78d3c661261cae8aa292b0f703ca46c75fafd302be6d81f7a1374eebb8a58b4c54162c64b2734168c9f889d7628ed05d9edca96bfd8dd100c
|
7
|
+
data.tar.gz: 55b058b03139ae43e85e1c81b99ecaafaa546a54a0a880d92cce972457510af6e8fcd2b95bca8e860cf4b0dfb3c2a50b3642fa6c73eb2e0f77a8094bb1c8726f
|
data/.gitignore
CHANGED
data/CHANGELOG
CHANGED
@@ -82,6 +82,7 @@ module MovieOrganizer
|
|
82
82
|
cleanstr = cleanstr.gsub(/BrRip/i, '').strip
|
83
83
|
cleanstr = cleanstr.gsub(/ECI/i, '').strip
|
84
84
|
cleanstr = cleanstr.gsub(/HDTV/i, '').strip
|
85
|
+
cleanstr = cleanstr.gsub(/WEBRip/i, '').strip
|
85
86
|
cleanstr = cleanstr.gsub(/x264/, '').strip
|
86
87
|
cleanstr = cleanstr.gsub(/-lol/i, '').strip
|
87
88
|
# cleanstr = cleanstr.gsub(/[\.\s-]us[\.\s-]/i, ' ').strip
|
@@ -27,7 +27,8 @@ module MovieOrganizer
|
|
27
27
|
movies = [
|
28
28
|
'Coco.2017.1080p.BluRay.x264-[BOGUS.IT]',
|
29
29
|
'Beetlejuice',
|
30
|
-
'Justice.League.2017.1080p.BluRay.x264-[YTS.AM]'
|
30
|
+
'Justice.League.2017.1080p.BluRay.x264-[YTS.AM]',
|
31
|
+
'Jumanji.Welcome.To.The.Jungle.2017.1080p.WEBRip.x264-[YTS.AM].mp4'
|
31
32
|
]
|
32
33
|
|
33
34
|
movies.each do |filename|
|
@@ -5,48 +5,76 @@ module MovieOrganizer
|
|
5
5
|
RSpec.describe Movie, type: :lib do
|
6
6
|
include_context 'media_shared'
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
movies = {
|
9
|
+
'Coco.2017.1080p.BluRay.x264-[BOGUS.IT]' => {
|
10
|
+
year: '2017',
|
11
|
+
name: 'Coco (2017).mp4'
|
12
|
+
},
|
13
|
+
'Beetlejuice' => {
|
14
|
+
year: nil,
|
15
|
+
name: 'Beetlejuice ().mp4'
|
16
|
+
},
|
17
|
+
'Justice.League.2017.1080p.BluRay.x264-[YTS.AM]' => {
|
18
|
+
year: '2017',
|
19
|
+
name: 'Justice League (2017).mp4'
|
20
|
+
},
|
21
|
+
'Jumanji.Welcome.To.The.Jungle.2017.1080p.WEBRip.x264-[YTS.AM]' => {
|
22
|
+
year: '2017',
|
23
|
+
name: 'Jumanji Welcome To The Jungle (2017).mp4'
|
24
|
+
}
|
25
|
+
}
|
14
26
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
27
|
+
movies.each_pair do |filename, data|
|
28
|
+
context filename do
|
29
|
+
before(:each) do
|
30
|
+
@filepath = create_test_file(filename: filename, extension: 'mp4').first
|
31
|
+
@expected_filename = data[:name]
|
32
|
+
@expected_year = data[:year]
|
33
|
+
@movie = Movie.new(@filepath, default_options)
|
34
|
+
end
|
19
35
|
|
20
|
-
|
21
|
-
|
22
|
-
|
36
|
+
context '.processed_filename' do
|
37
|
+
it "correctly processes the filename: [#{filename}]" do
|
38
|
+
expect(
|
39
|
+
@movie.processed_filename
|
40
|
+
).to eq(@expected_filename)
|
41
|
+
end
|
42
|
+
end
|
23
43
|
|
24
|
-
|
25
|
-
|
44
|
+
context '.year' do
|
45
|
+
it 'returns the correct year' do
|
46
|
+
expect(@movie.year).to eq(@expected_year)
|
47
|
+
end
|
48
|
+
end
|
26
49
|
end
|
27
50
|
end
|
28
51
|
|
29
|
-
context '
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
).
|
52
|
+
context 'single movie' do
|
53
|
+
let(:filename) do
|
54
|
+
create_test_file(
|
55
|
+
filename: 'Foreign+Correspondent+(1940)+1080p', extension: 'mp4'
|
56
|
+
).first
|
34
57
|
end
|
35
|
-
|
58
|
+
let(:movie) { Movie.new(filename, default_options) }
|
59
|
+
|
60
|
+
context '#new' do
|
61
|
+
it 'is a Movie' do
|
62
|
+
expect(movie).to be_a(Movie)
|
63
|
+
end
|
36
64
|
|
37
|
-
|
38
|
-
|
39
|
-
|
65
|
+
it 'sets filename accessor' do
|
66
|
+
expect(movie.filename).to eq(filename)
|
67
|
+
end
|
40
68
|
end
|
41
|
-
end
|
42
69
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
70
|
+
context '.process!' do
|
71
|
+
it 'moves the file to the configured location' do
|
72
|
+
settings = Settings.new
|
73
|
+
settings[:movies][:directory] = MovieOrganizer.root.join('tmp', 'files', 'movies').to_s
|
74
|
+
settings.save
|
75
|
+
movie.process!
|
76
|
+
expect(File.exist?(filename)).to eq(true)
|
77
|
+
end
|
50
78
|
end
|
51
79
|
end
|
52
80
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: movie_organizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Blackburn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|