serienrenamer 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/plugin/textfile.rb +4 -0
- data/lib/serienrenamer.rb +1 -1
- data/test/test_helper.rb +1 -1
- data/test/test_plugin_textfile.rb +21 -0
- metadata +2 -2
data/lib/plugin/textfile.rb
CHANGED
@@ -37,6 +37,10 @@ module Plugin
|
|
37
37
|
next if File.size(file) > 128 || File.zero?(file)
|
38
38
|
|
39
39
|
data = File.open(file, "rb").read
|
40
|
+
|
41
|
+
# only files with one line with the title are interesting
|
42
|
+
next if data.lines.to_a.size > 1
|
43
|
+
|
40
44
|
if data != nil && data.match(/\w+/) &&
|
41
45
|
Serienrenamer::Episode.contains_episode_information?(data)
|
42
46
|
matched_episodes.push(data)
|
data/lib/serienrenamer.rb
CHANGED
data/test/test_helper.rb
CHANGED
@@ -36,7 +36,7 @@ class TestHelper
|
|
36
36
|
|
37
37
|
create_test_dirs([ dir ]) unless File.directory?(dirpath)
|
38
38
|
|
39
|
-
filenametxt = File.new(File.join(dirpath,
|
39
|
+
filenametxt = File.new(File.join(dirpath, filename), "w")
|
40
40
|
filenametxt.write(title)
|
41
41
|
filenametxt.close
|
42
42
|
end
|
@@ -9,6 +9,7 @@ require File.dirname(__FILE__) + '/test_helper.rb'
|
|
9
9
|
class TestPluginTextfile < Test::Unit::TestCase
|
10
10
|
@@directories = {
|
11
11
|
'hmym' => 'HMMG.705',
|
12
|
+
'hmmg' => 'HMMG.711',
|
12
13
|
}
|
13
14
|
|
14
15
|
def setup
|
@@ -16,6 +17,19 @@ class TestPluginTextfile < Test::Unit::TestCase
|
|
16
17
|
@@directories["hmym"],
|
17
18
|
"How.I.Met.Your.Mother.S07E05.Die.Exkursion.German.Dubbed.HDTV.XviD-ITG"
|
18
19
|
)
|
20
|
+
|
21
|
+
# two files which contains possible information
|
22
|
+
TestHelper.write_episode_textfile(
|
23
|
+
@@directories["hmmg"],
|
24
|
+
"How.I.Met.Your.Mother.S07E11.Plan.B.German.Dubbed.HDTV.XviD-ITG"
|
25
|
+
)
|
26
|
+
TestHelper.write_episode_textfile(
|
27
|
+
@@directories["hmmg"],
|
28
|
+
"Show ......... : How I Met Your Mother 7x11
|
29
|
+
IMDB ......... : http://www.imdb.com/title/tt0460649/
|
30
|
+
Notes ........ : ",
|
31
|
+
"nfo.nfo"
|
32
|
+
)
|
19
33
|
TestHelper.cwd
|
20
34
|
end
|
21
35
|
|
@@ -30,6 +44,13 @@ class TestPluginTextfile < Test::Unit::TestCase
|
|
30
44
|
assert_equal("S07E05 - Die Exkursion.avi", how.to_s)
|
31
45
|
end
|
32
46
|
|
47
|
+
def test_select_right_textfile
|
48
|
+
how = Serienrenamer::Episode.new(@@directories['hmmg'])
|
49
|
+
data = Plugin::Textfile.generate_episode_information(how)[0]
|
50
|
+
how.add_episode_information(data, true)
|
51
|
+
assert_equal("S07E11 - Plan B.avi", how.to_s)
|
52
|
+
end
|
53
|
+
|
33
54
|
def test_information_extraction_with_directory_parameter
|
34
55
|
how = @@directories['hmym']
|
35
56
|
data = Plugin::Textfile.generate_episode_information(how)[0]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serienrenamer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-03-
|
12
|
+
date: 2012-03-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: wlapi
|