movies 0.1.6 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,6 +2,7 @@ require "json"
2
2
  require "rest-client"
3
3
  require "date"
4
4
  require "yaml"
5
+ require "movies/filter"
5
6
 
6
7
  class Movies
7
8
  attr_reader :title, :year, :rated, :plot, :genres, :director, :writers, :actors, :poster, :runtime, :rating, :votes, :id
@@ -33,14 +34,14 @@ class Movies
33
34
  end
34
35
  Movies.new("http://www.imdbapi.com/?t=#{URI.encode(title)}", params).prepare
35
36
  end
36
-
37
+
37
38
  def self.find_by_release_name(title, params = {})
38
39
  if title.nil? or title.empty?
39
40
  raise ArgumentError.new("Title can not be blank.")
40
41
  end
41
42
 
42
- params.merge!(y: $1) if title =~ /((19|20)\d{2})/
43
- Movies.new("http://www.imdbapi.com/?t=#{URI.encode(Movies.cleaner(title))}", params).prepare
43
+ mf = MovieFilter.new(title: title)
44
+ Movies.new("http://www.imdbapi.com/?t=#{URI.encode(mf.title)}", mf.to_param).prepare
44
45
  end
45
46
 
46
47
  def prepare
@@ -104,22 +105,6 @@ class Movies
104
105
  "http://www.imdb.com/title/#{@id}/"
105
106
  end
106
107
 
107
- def self.excluded
108
- @_excluded ||= YAML.load_file("#{File.dirname(__FILE__)}/movies/exclude.yml")["excluded"]
109
- end
110
-
111
- def self.cleaner(string)
112
- [/((19|20)\d{2}).*$/, /\./, /\s*-\s*/, /\s{2,}/].each do |regex|
113
- string = string.gsub(regex, ' ')
114
- end
115
-
116
- excluded.each do |clean|
117
- string = string.gsub(/#{clean}.*$/i, ' ')
118
- end
119
-
120
- string.strip
121
- end
122
-
123
108
  private
124
109
  def content
125
110
  @_content ||= JSON.parse(download)
@@ -0,0 +1,41 @@
1
+ class MovieFilter
2
+ def initialize(args)
3
+ args.keys.each { |name| instance_variable_set "@" + name.to_s, args[name] }
4
+ end
5
+
6
+ def year
7
+ @year ||= @title.to_s.match(/((19|20)\d{2})/).to_a[1]
8
+ @year.to_i if @year
9
+ end
10
+
11
+ def title
12
+ @_title ||= cleaner
13
+ end
14
+
15
+ def to_param
16
+ params = {}
17
+ if year
18
+ params.merge!(y: year.to_i)
19
+ end
20
+
21
+ return params
22
+ end
23
+
24
+ def cleaner
25
+ string = @title
26
+ [/((19|20)\d{2}).*$/, /\./, /\s*-\s*/, /\s{2,}/].each do |regex|
27
+ string = string.gsub(regex, ' ')
28
+ end
29
+
30
+ excluded.each do |clean|
31
+ string = string.gsub(/#{clean}.*$/i, ' ')
32
+ end
33
+
34
+ string.strip
35
+ end
36
+
37
+ private
38
+ def excluded
39
+ @_excluded ||= YAML.load_file("#{File.dirname(__FILE__)}/exclude.yml")["excluded"]
40
+ end
41
+ end
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "movies"
6
- s.version = "0.1.6"
6
+ s.version = "0.1.8"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Linus Oleander"]
9
9
  s.email = ["linus@oleander.nu"]
@@ -0,0 +1,173 @@
1
+ require "spec_helper"
2
+
3
+ describe MovieFilter do
4
+ it "should be possible to add title" do
5
+ MovieFilter.new(title: "Title").title.should eq("Title")
6
+ end
7
+
8
+ it "should have a year" do
9
+ MovieFilter.new(year: 1988).year.should eq(1988)
10
+ end
11
+
12
+ it "should have able to convert filter to param" do
13
+ MovieFilter.new(title: "Title", year: 2011).to_param.should eq({
14
+ y: 2011
15
+ })
16
+ end
17
+
18
+ context "#cleaner" do
19
+ it "should not contain 'EXTENDED'" do
20
+ MovieFilter.new(title: "The Town 2010 EXTENDED 720p BRRip XviD AC3-Rx").title.should_not match(/extended/i)
21
+ end
22
+
23
+ it "should not contain 'XviD'" do
24
+ MovieFilter.new(title: "The Town 2010 EXTENDED 720p BRRip XviD AC3-Rx").title.should_not match(/xvid/i)
25
+ end
26
+
27
+ it "should not contain '720p'" do
28
+ MovieFilter.new(title: "The Town 2010 EXTENDED 720p BRRip XviD AC3-Rx").title.should_not match(/720p/i)
29
+ end
30
+
31
+ it "should not contain '1080p'" do
32
+ MovieFilter.new(title: "The Town 2010 EXTENDED 1080p BRRip XviD AC3-Rx").title.should_not match(/1080p/i)
33
+ end
34
+
35
+ it "should not contain 'BRRip'" do
36
+ MovieFilter.new(title: "The Town 2010 EXTENDED 1080p BRRip XviD AC3-Rx").title.should_not match(/BRRip/i)
37
+ end
38
+
39
+ it "should not contain 'CAM'" do
40
+ MovieFilter.new(title: "Paul 2011 CAM XViD-UNDEAD").title.should_not match(/cam/i)
41
+ end
42
+
43
+ it "should not contain 'TELESYNC'" do
44
+ MovieFilter.new(title: "Easy A TELESYNC XviD-TWiZTED").title.should_not match(/telesync/i)
45
+ end
46
+
47
+ it "should not contain 'TELECINE'" do
48
+ MovieFilter.new(title: "Easy A TELECINE XviD-TWiZTED").title.should_not match(/telecine/i)
49
+ end
50
+
51
+ it "should not contain 'RX'" do
52
+ MovieFilter.new(title: "The Company Men 2010 DVDRip XviD-Rx").title.should_not match(/rx/i)
53
+ end
54
+
55
+ it "should not contain 'DVDSCR'" do
56
+ MovieFilter.new(title: "Black Swan (2010) DVDSCR Xvid-Nogrp").title.should_not match(/dvdscr/)
57
+ end
58
+
59
+ it "should not contain 'Screener'" do
60
+ MovieFilter.new(title: "Devil 2010 Screener Xvid AC3 LKRG").title.should_not match(/screener/i)
61
+ end
62
+
63
+ it "should not contain 'HDTV'" do
64
+ MovieFilter.new(title: "Bones S06E19 HDTV XviD-LOL").title.should_not match(/hdtv/i)
65
+ end
66
+
67
+ it "should not contain 'DVDRip'" do
68
+ MovieFilter.new(title: "The Company Men 2010 DVDRip XviD-Rx").title.should_not match(/dvdrip/i)
69
+ end
70
+
71
+ it "should not contain 'WorkPrint'" do
72
+ MovieFilter.new(title: "Elephant White 2011 WorkPrint XviD AC3-ViSiON").title.should_not match(/workprint/i)
73
+ end
74
+
75
+ it "should not contain 'Bluray'" do
76
+ MovieFilter.new(title: "Last Night 2010 Bluray 720p Bluray DTS x264-CHD").title.should_not match(/bluray/i)
77
+ end
78
+
79
+ it "should not contain 'Blu-ray'" do
80
+ MovieFilter.new(title: "Big Mommas Like Father Like Son 2011 Blu-ray RE 720 DTS Mysilu").title.should_not match(/blu-ray/i)
81
+ end
82
+
83
+ it "should not contain 'MDVDR'" do
84
+ MovieFilter.new(title: "Exposed DVD Tupac Breaking The Oath 2010 NTSC MDVDR-C4DV").title.should_not match(/mdvdr/i)
85
+ end
86
+
87
+ it "should not contain 'NTSC'" do
88
+ MovieFilter.new(title: "Exposed DVD Tupac Breaking The Oath 2010 NTSC MDVDR-C4DV").title.should_not match(/ntsc/i)
89
+ end
90
+
91
+ it "should not contain 'DVD-R'" do
92
+ MovieFilter.new(title: "Lawrence Of Arabia 1962 iNTERNAL DVDRiP XviD-DVD-R").title.should_not match(/dvd-r/i)
93
+ end
94
+
95
+ it "should not contain 'x264-SFM'" do
96
+ MovieFilter.new(title: "Great British Food Revival S01E04 720p HDTV x264-SFM").title.should_not match(/x264-sfm|sfm/i)
97
+ end
98
+
99
+ it "should not contain 'UNRATED'" do
100
+ MovieFilter.new(title: "The Other Guys 2010 UNRATED DVDRip XviD AC3-YeFsTe").title.should_not match(/unrated/i)
101
+ end
102
+
103
+ it "should not contain 'IMAGiNE'" do
104
+ MovieFilter.new(title: "Hop 2011 TS READNFO XViD - IMAGiNE").title.should_not match(/imagine/i)
105
+ end
106
+
107
+ it "should not contain 'SCR'" do
108
+ MovieFilter.new(title: "The Last Exorcism SCR XViD - IMAGiNE").title.should_not match(/scr/i)
109
+ end
110
+
111
+ it "should not contain 'AC3-*'" do
112
+ MovieFilter.new(title: "Biutiful 2010 DVDRip XviD AC3-TiMPE").title.should_not match(/ac3-timpe|ac3/i)
113
+ end
114
+
115
+ it "should not contain 'LIMITED'" do
116
+ MovieFilter.new(title: "Stone LIMITED BDRip XviD-SAPHiRE").title.should_not match(/limited/i)
117
+ end
118
+
119
+ it "should not contain 'SWESUB'" do
120
+ MovieFilter.new(title: "Sex And The City 2 2010 SWESUB DVDRip XviD AC3-Rx").title.should_not match(/swesub/i)
121
+ end
122
+
123
+ it "should not contain 'SUB'" do
124
+ MovieFilter.new(title: "Sex And The City 2 2010 SUB DVDRip XviD AC3-Rx").title.should_not match(/sub/i)
125
+ end
126
+
127
+ it "should not contain 'NTSC'" do
128
+ MovieFilter.new(title: "Piranha 2010 NTSC DVDR-TWiZTED").title.should_not match(/ntsc/i)
129
+ end
130
+
131
+ it "should not contain 'PAL'" do
132
+ MovieFilter.new(title: "Sex And The City 2 2010 SUB PAL DVDRip XviD AC3-Rx").title.should_not match(/pal/i)
133
+ end
134
+
135
+ it "should not contain a year" do
136
+ MovieFilter.new(title: "VC Arcade 1942 Wii-LaKiTu").title.should_not match(/1942/)
137
+ end
138
+
139
+ it "should not contain dots" do
140
+ MovieFilter.new(title: "Sex.And.The.City.2.2010.SUB.DVDRip.XviD.AC3-Rx").title.should_not match(/\./)
141
+ end
142
+
143
+ it "should not contain dash" do
144
+ MovieFilter.new(title: "Sex.And.The.City.2.2010.SUB.DVDRip.XviD.AC3-Rx").title.should_not match(/-/)
145
+ end
146
+
147
+ it "should not contain to much whitespace" do
148
+ MovieFilter.new(title: "A B").title.should eq("A B")
149
+ end
150
+
151
+ it "should strip ingoing params" do
152
+ MovieFilter.new(title: " A B ").title.should eq("A B")
153
+ end
154
+
155
+ it "should remove TV related data" do
156
+ MovieFilter.new(title: "Bones S06E19 HDTV XviD-LOL").title.should_not match(/s06e19/i)
157
+ end
158
+
159
+ it "should not contain 'R5'" do
160
+ MovieFilter.new(title: "Just Go With It R5 LiNE XviD-Rx").title.should_not match(/r5/i)
161
+ end
162
+
163
+ it "should not contain 'R6'" do
164
+ MovieFilter.new(title: "Just Go With It R6 LiNE XviD-Rx").title.should_not match(/r6/i)
165
+ end
166
+
167
+ it "should be able to parse the year" do
168
+ MovieFilter.new(title: "Sex.And.The.City.2.2010.SUB.DVDRip.XviD.AC3-Rx").year.should eq(2010)
169
+ MovieFilter.new(title: "VC Arcade 1942 Wii-LaKiTu").year.should eq(1942)
170
+ MovieFilter.new(title: "VC Arcade 1942 Wii-LaKiTu", year: 1920).year.should eq(1920)
171
+ end
172
+ end
173
+ end
@@ -213,3 +213,57 @@
213
213
  jvB2lU0CAAA=
214
214
 
215
215
  http_version: "1.1"
216
+ - !ruby/struct:VCR::HTTPInteraction
217
+ request: !ruby/struct:VCR::Request
218
+ method: :get
219
+ uri: http://www.imdbapi.com:80/?t=True%20Grit&year=1969
220
+ body:
221
+ headers:
222
+ accept:
223
+ - "*/*; q=0.5, application/xml"
224
+ accept-encoding:
225
+ - gzip, deflate
226
+ timeout:
227
+ - "3"
228
+ response: !ruby/struct:VCR::Response
229
+ status: !ruby/struct:VCR::ResponseStatus
230
+ code: 200
231
+ message: OK
232
+ headers:
233
+ cache-control:
234
+ - no-cache
235
+ pragma:
236
+ - no-cache
237
+ content-type:
238
+ - text/html; charset=utf-8
239
+ content-encoding:
240
+ - gzip
241
+ expires:
242
+ - "-1"
243
+ vary:
244
+ - Accept-Encoding
245
+ server:
246
+ - Microsoft-IIS/7.0
247
+ x-aspnet-version:
248
+ - 4.0.30319
249
+ x-powered-by:
250
+ - ASP.NET
251
+ date:
252
+ - Thu, 07 Jul 2011 13:07:32 GMT
253
+ content-length:
254
+ - "540"
255
+ body: !binary |
256
+ H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3m
257
+ kuwdaUcjKasqgcplVmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZk
258
+ AWz2zkrayZ4hgKrIHz9+fB8/In7xR2+Ktsw/evTRm3qdp5/XRfvR6KPfJ89q
259
+ +mhvZ3eH/nqVtfmM/nz5+fbuPfydl3nW8Ed7e+nTfJpqw8/zZQ1Qx7PLfNmu
260
+ 63yUPq2zRTZKv5s3bV4vqc3Tos6nbQXwp+08W6YnVb4cpd+p8pJ/pSbfJSRy
261
+ NLAfjlLXlhocA0CDBvn5efqkLmYXeTNKv8jaNn2aLSpq/+2sKPM8fd3mxfI8
262
+ L2fooZlT26osAOJlWbUE4Dhtq/XFPP1q/HpM79fNPCvTeV6umjRLm3Y9mVT1
263
+ Mr2u1suL9KpaEAptnU3fprPqaknt6vQ8a+nHx026WNezvM7rMYBXGC2Bn7ft
264
+ 6tHdu0U2XuSzItsuFrPJeFot7haLjFC++8XdL37y/pMvfvrs3YufPv7Bl09/
265
+ YufFLv1d3n+SLZ8sf++3z9qfejO9+vLp77P3xU9/cf3i+Pf8Pce//0/ujn//
266
+ 17/3vb2d8U+vLqizV+tlWyxA9t10Xqf3d9JFsWzwRdYWywv6/GCMyfnJqs1B
267
+ s/u7n97bpb/PntIfbbu7v3Pv4NP79MGrvFlVywaQwAsf/ZL/BzMqslUcAgAA
268
+
269
+ http_version: "1.1"
@@ -107,3 +107,57 @@
107
107
  s/u7n97bpb/PntIfbbu7v3Pv4NP79MGrvFlVywaQwAsf/ZL/BzMqslUcAgAA
108
108
 
109
109
  http_version: "1.1"
110
+ - !ruby/struct:VCR::HTTPInteraction
111
+ request: !ruby/struct:VCR::Request
112
+ method: :get
113
+ uri: http://www.imdbapi.com:80/?t=True%20Grit&year=2010
114
+ body:
115
+ headers:
116
+ accept:
117
+ - "*/*; q=0.5, application/xml"
118
+ accept-encoding:
119
+ - gzip, deflate
120
+ timeout:
121
+ - "3"
122
+ response: !ruby/struct:VCR::Response
123
+ status: !ruby/struct:VCR::ResponseStatus
124
+ code: 200
125
+ message: OK
126
+ headers:
127
+ cache-control:
128
+ - no-cache
129
+ pragma:
130
+ - no-cache
131
+ content-type:
132
+ - text/html; charset=utf-8
133
+ content-encoding:
134
+ - gzip
135
+ expires:
136
+ - "-1"
137
+ vary:
138
+ - Accept-Encoding
139
+ server:
140
+ - Microsoft-IIS/7.0
141
+ x-aspnet-version:
142
+ - 4.0.30319
143
+ x-powered-by:
144
+ - ASP.NET
145
+ date:
146
+ - Thu, 07 Jul 2011 13:07:39 GMT
147
+ content-length:
148
+ - "540"
149
+ body: !binary |
150
+ H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3m
151
+ kuwdaUcjKasqgcplVmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZk
152
+ AWz2zkrayZ4hgKrIHz9+fB8/In7xR2+Ktsw/evTRm3qdp5/XRfvR6KPfJ89q
153
+ +mhvZ3eH/nqVtfmM/nz5+fbuPfydl3nW8Ed7e+nTfJpqw8/zZQ1Qx7PLfNmu
154
+ 63yUPq2zRTZKv5s3bV4vqc3Tos6nbQXwp+08W6YnVb4cpd+p8pJ/pSbfJSRy
155
+ NLAfjlLXlhocA0CDBvn5efqkLmYXeTNKv8jaNn2aLSpq/+2sKPM8fd3mxfI8
156
+ L2fooZlT26osAOJlWbUE4Dhtq/XFPP1q/HpM79fNPCvTeV6umjRLm3Y9mVT1
157
+ Mr2u1suL9KpaEAptnU3fprPqaknt6vQ8a+nHx026WNezvM7rMYBXGC2Bn7ft
158
+ 6tHdu0U2XuSzItsuFrPJeFot7haLjFC++8XdL37y/pMvfvrs3YufPv7Bl09/
159
+ YufFLv1d3n+SLZ8sf++3z9qfejO9+vLp77P3xU9/cf3i+Pf8Pce//0/ujn//
160
+ 17/3vb2d8U+vLqizV+tlWyxA9t10Xqf3d9JFsWzwRdYWywv6/GCMyfnJqs1B
161
+ s/u7n97bpb/PntIfbbu7v3Pv4NP79MGrvFlVywaQwAsf/ZL/BzMqslUcAgAA
162
+
163
+ http_version: "1.1"
@@ -3,6 +3,7 @@ require "webmock/rspec"
3
3
  require "movies"
4
4
  require "vcr"
5
5
  require "uri"
6
+ require "movies/filter"
6
7
 
7
8
  RSpec.configure do |config|
8
9
  config.mock_with :rspec
@@ -13,7 +14,7 @@ VCR.config do |c|
13
14
  c.cassette_library_dir = "spec/fixtures/vcr_cassettes"
14
15
  c.stub_with :webmock
15
16
  c.default_cassette_options = {
16
- record: :none
17
+ record: :new_episodes
17
18
  }
18
19
  c.allow_http_connections_when_no_cassette = false
19
20
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: movies
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.6
5
+ version: 0.1.8
6
6
  platform: ruby
7
7
  authors:
8
8
  - Linus Oleander
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-05-01 00:00:00 +02:00
13
+ date: 2011-07-11 00:00:00 +02:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -85,8 +85,9 @@ files:
85
85
  - Rakefile
86
86
  - lib/movies.rb
87
87
  - lib/movies/exclude.yml
88
+ - lib/movies/filter.rb
88
89
  - movies.gemspec
89
- - spec/exclude_spec.rb
90
+ - spec/filter_spec.rb
90
91
  - spec/fixtures/vcr_cassettes/bug1.yml
91
92
  - spec/fixtures/vcr_cassettes/bug2.yml
92
93
  - spec/fixtures/vcr_cassettes/bug3.yml
@@ -128,7 +129,7 @@ signing_key:
128
129
  specification_version: 3
129
130
  summary: Movies is the bridge between IMDb's unofficial API; imdbapi.com and Ruby.
130
131
  test_files:
131
- - spec/exclude_spec.rb
132
+ - spec/filter_spec.rb
132
133
  - spec/fixtures/vcr_cassettes/bug1.yml
133
134
  - spec/fixtures/vcr_cassettes/bug2.yml
134
135
  - spec/fixtures/vcr_cassettes/bug3.yml
@@ -1,151 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe "exclude.yaml" do
4
- it "should not contain 'EXTENDED'" do
5
- Movies.cleaner("The Town 2010 EXTENDED 720p BRRip XviD AC3-Rx").should_not match(/extended/i)
6
- end
7
-
8
- it "should not contain 'XviD'" do
9
- Movies.cleaner("The Town 2010 EXTENDED 720p BRRip XviD AC3-Rx").should_not match(/xvid/i)
10
- end
11
-
12
- it "should not contain '720p'" do
13
- Movies.cleaner("The Town 2010 EXTENDED 720p BRRip XviD AC3-Rx").should_not match(/720p/i)
14
- end
15
-
16
- it "should not contain '1080p'" do
17
- Movies.cleaner("The Town 2010 EXTENDED 1080p BRRip XviD AC3-Rx").should_not match(/1080p/i)
18
- end
19
-
20
- it "should not contain 'BRRip'" do
21
- Movies.cleaner("The Town 2010 EXTENDED 1080p BRRip XviD AC3-Rx").should_not match(/BRRip/i)
22
- end
23
-
24
- it "should not contain 'CAM'" do
25
- Movies.cleaner("Paul 2011 CAM XViD-UNDEAD").should_not match(/cam/i)
26
- end
27
-
28
- it "should not contain 'TELESYNC'" do
29
- Movies.cleaner("Easy A TELESYNC XviD-TWiZTED").should_not match(/telesync/i)
30
- end
31
-
32
- it "should not contain 'TELECINE'" do
33
- Movies.cleaner("Easy A TELECINE XviD-TWiZTED").should_not match(/telecine/i)
34
- end
35
-
36
- it "should not contain 'RX'" do
37
- Movies.cleaner("The Company Men 2010 DVDRip XviD-Rx").should_not match(/rx/i)
38
- end
39
-
40
- it "should not contain 'DVDSCR'" do
41
- Movies.cleaner("Black Swan (2010) DVDSCR Xvid-Nogrp").should_not match(/dvdscr/)
42
- end
43
-
44
- it "should not contain 'Screener'" do
45
- Movies.cleaner("Devil 2010 Screener Xvid AC3 LKRG").should_not match(/screener/i)
46
- end
47
-
48
- it "should not contain 'HDTV'" do
49
- Movies.cleaner("Bones S06E19 HDTV XviD-LOL").should_not match(/hdtv/i)
50
- end
51
-
52
- it "should not contain 'DVDRip'" do
53
- Movies.cleaner("The Company Men 2010 DVDRip XviD-Rx").should_not match(/dvdrip/i)
54
- end
55
-
56
- it "should not contain 'WorkPrint'" do
57
- Movies.cleaner("Elephant White 2011 WorkPrint XviD AC3-ViSiON").should_not match(/workprint/i)
58
- end
59
-
60
- it "should not contain 'Bluray'" do
61
- Movies.cleaner("Last Night 2010 Bluray 720p Bluray DTS x264-CHD").should_not match(/bluray/i)
62
- end
63
-
64
- it "should not contain 'Blu-ray'" do
65
- Movies.cleaner("Big Mommas Like Father Like Son 2011 Blu-ray RE 720 DTS Mysilu").should_not match(/blu-ray/i)
66
- end
67
-
68
- it "should not contain 'MDVDR'" do
69
- Movies.cleaner("Exposed DVD Tupac Breaking The Oath 2010 NTSC MDVDR-C4DV").should_not match(/mdvdr/i)
70
- end
71
-
72
- it "should not contain 'NTSC'" do
73
- Movies.cleaner("Exposed DVD Tupac Breaking The Oath 2010 NTSC MDVDR-C4DV").should_not match(/ntsc/i)
74
- end
75
-
76
- it "should not contain 'DVD-R'" do
77
- Movies.cleaner("Lawrence Of Arabia 1962 iNTERNAL DVDRiP XviD-DVD-R").should_not match(/dvd-r/i)
78
- end
79
-
80
- it "should not contain 'x264-SFM'" do
81
- Movies.cleaner("Great British Food Revival S01E04 720p HDTV x264-SFM").should_not match(/x264-sfm|sfm/i)
82
- end
83
-
84
- it "should not contain 'UNRATED'" do
85
- Movies.cleaner("The Other Guys 2010 UNRATED DVDRip XviD AC3-YeFsTe").should_not match(/unrated/i)
86
- end
87
-
88
- it "should not contain 'IMAGiNE'" do
89
- Movies.cleaner("Hop 2011 TS READNFO XViD - IMAGiNE").should_not match(/imagine/i)
90
- end
91
-
92
- it "should not contain 'SCR'" do
93
- Movies.cleaner("The Last Exorcism SCR XViD - IMAGiNE").should_not match(/scr/i)
94
- end
95
-
96
- it "should not contain 'AC3-*'" do
97
- Movies.cleaner("Biutiful 2010 DVDRip XviD AC3-TiMPE").should_not match(/ac3-timpe|ac3/i)
98
- end
99
-
100
- it "should not contain 'LIMITED'" do
101
- Movies.cleaner("Stone LIMITED BDRip XviD-SAPHiRE").should_not match(/limited/i)
102
- end
103
-
104
- it "should not contain 'SWESUB'" do
105
- Movies.cleaner("Sex And The City 2 2010 SWESUB DVDRip XviD AC3-Rx").should_not match(/swesub/i)
106
- end
107
-
108
- it "should not contain 'SUB'" do
109
- Movies.cleaner("Sex And The City 2 2010 SUB DVDRip XviD AC3-Rx").should_not match(/sub/i)
110
- end
111
-
112
- it "should not contain 'NTSC'" do
113
- Movies.cleaner("Piranha 2010 NTSC DVDR-TWiZTED").should_not match(/ntsc/i)
114
- end
115
-
116
- it "should not contain 'PAL'" do
117
- Movies.cleaner("Sex And The City 2 2010 SUB PAL DVDRip XviD AC3-Rx").should_not match(/pal/i)
118
- end
119
-
120
- it "should not contain a year" do
121
- Movies.cleaner("VC Arcade 1942 Wii-LaKiTu").should_not match(/1942/)
122
- end
123
-
124
- it "should not contain dots" do
125
- Movies.cleaner("Sex.And.The.City.2.2010.SUB.DVDRip.XviD.AC3-Rx").should_not match(/\./)
126
- end
127
-
128
- it "should not contain dash" do
129
- Movies.cleaner("Sex.And.The.City.2.2010.SUB.DVDRip.XviD.AC3-Rx").should_not match(/-/)
130
- end
131
-
132
- it "should not contain to much whitespace" do
133
- Movies.cleaner("A B").should eq("A B")
134
- end
135
-
136
- it "should strip ingoing params" do
137
- Movies.cleaner(" A B ").should eq("A B")
138
- end
139
-
140
- it "should remove TV related data" do
141
- Movies.cleaner("Bones S06E19 HDTV XviD-LOL").should_not match(/s06e19/i)
142
- end
143
-
144
- it "should not contain 'R5'" do
145
- Movies.cleaner("Just Go With It R5 LiNE XviD-Rx").should_not match(/r5/i)
146
- end
147
-
148
- it "should not contain 'R6'" do
149
- Movies.cleaner("Just Go With It R6 LiNE XviD-Rx").should_not match(/r6/i)
150
- end
151
- end