where_to 0.9.4 → 0.9.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/where_to/episode_formatter.rb +14 -9
- data/lib/where_to/locator.rb +3 -1
- data/lib/where_to/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YzlmNWMwZDA5NmU3NjJmZjEwNjAwZWUxYjBlYmIwMDgwOTU5ZmI5NA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MDUyYzg5N2U2ZDRmYjA0OWNiODMzNzEzYWE2NmQxODZhZjViZDFiNg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZDkxNWU4NjhiODM1Nzg2NWI5OWRlNDRjYWI0ZjU2ZTFmOGU0MDlhMjM3NDJi
|
10
|
+
OTE0MDZkZWQ5YmUzOTM4YzgwZWM2MjUwYmQwMDBmMmQ4NWNmOWM4OGZiYmIy
|
11
|
+
ZmE1OWJiYzAwZThiOTU0OTg0NjM1NjA2YjQ3NGNjY2M5ODQxZWY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NmNlOGI1MWU2MGNmNDQwYjdhMTVhZTU3NDcyMjMwZjA0NWEyMTRjNGNjNTE3
|
14
|
+
YmVkZDkwODA2N2ZjNTZmZDI0MWYxMmMxYTU4ZDUyYTBjZDNmMGQ1NDliZWUw
|
15
|
+
NDBiM2EyMmNlNDNmMzBhZjY3N2IwODgwZGJlNDI3M2M5ZDgyYzc=
|
@@ -1,16 +1,17 @@
|
|
1
1
|
module WhereTo
|
2
2
|
class EpisodeFormatter
|
3
3
|
attr_accessor :series_title, :season_number, :episode_title, :episode_number
|
4
|
-
attr_accessor :quality, :extension
|
4
|
+
attr_accessor :quality, :extension, :group
|
5
5
|
DEFAULT_EXTENSION = '.mkv'
|
6
6
|
|
7
|
-
def initialize(hash = {}, series_title: hash[:series_title], season_number: hash[:season_number], episode_title: hash[:episode_title], episode_number: hash[:episode_number], extension: hash[:extension], quality: hash[:quality])
|
8
|
-
set_unless_nil :series_title,
|
9
|
-
set_unless_nil :season_number,
|
10
|
-
set_unless_nil :episode_title,
|
7
|
+
def initialize(hash = {}, series_title: hash[:series_title], season_number: hash[:season_number], episode_title: hash[:episode_title], episode_number: hash[:episode_number], extension: hash[:extension], quality: hash[:quality], group: hash[:group])
|
8
|
+
set_unless_nil :series_title, series_title
|
9
|
+
set_unless_nil :season_number, season_number
|
10
|
+
set_unless_nil :episode_title, episode_title
|
11
11
|
set_unless_nil :episode_number, episode_number
|
12
|
-
set_unless_nil :quality,
|
13
|
-
set_unless_nil :extension,
|
12
|
+
set_unless_nil :quality, quality
|
13
|
+
set_unless_nil :extension, extension, default: DEFAULT_EXTENSION
|
14
|
+
set_unless_nil :group, group
|
14
15
|
end
|
15
16
|
|
16
17
|
def format!
|
@@ -20,8 +21,12 @@ module WhereTo
|
|
20
21
|
formatted << "SxxEyy".gsub('xx', season_number.to_s.rjust(2, '0')).gsub('yy', episode_number.to_s.rjust(2, '0'))
|
21
22
|
formatted << episode_title.downcase.gsub(' ', '.')
|
22
23
|
formatted << quality.downcase if quality
|
23
|
-
formatted
|
24
|
-
|
24
|
+
formatted = formatted.join('.')
|
25
|
+
|
26
|
+
formatted << "-#{group}" if group
|
27
|
+
formatted << extension
|
28
|
+
|
29
|
+
formatted
|
25
30
|
end
|
26
31
|
|
27
32
|
def validate!
|
data/lib/where_to/locator.rb
CHANGED
@@ -5,7 +5,7 @@ require 'yaml'
|
|
5
5
|
module WhereTo
|
6
6
|
class Locator
|
7
7
|
attr_accessor :series_title, :airdate, :season, :season_airdate
|
8
|
-
attr_accessor :episode_title, :episode_number, :episode_quality, :episode_extension
|
8
|
+
attr_accessor :episode_title, :episode_number, :episode_quality, :episode_extension, :group
|
9
9
|
|
10
10
|
def initialize(hash = {})
|
11
11
|
load_values_from hash
|
@@ -47,6 +47,7 @@ module WhereTo
|
|
47
47
|
_params[:episode_number] = episode_number
|
48
48
|
_params[:quality] = episode_quality
|
49
49
|
_params[:extension] = episode_extension
|
50
|
+
_params[:group] = group
|
50
51
|
_params
|
51
52
|
end
|
52
53
|
|
@@ -65,6 +66,7 @@ module WhereTo
|
|
65
66
|
set_unless_nil :episode_number, hash[:episode_number]
|
66
67
|
set_unless_nil :episode_quality, hash[:episode_quality]
|
67
68
|
set_unless_nil :episode_extension, hash[:episode_extension]
|
69
|
+
set_unless_nil :group, hash[:group]
|
68
70
|
end
|
69
71
|
end
|
70
72
|
end
|
data/lib/where_to/version.rb
CHANGED