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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- N2EyYjc5MzVhNGVkNGQ2MjVmODk1NzIwOGJkNWU3Yzg0NDY4ZDVjNg==
4
+ YzlmNWMwZDA5NmU3NjJmZjEwNjAwZWUxYjBlYmIwMDgwOTU5ZmI5NA==
5
5
  data.tar.gz: !binary |-
6
- NGUzZGRlOTJhZGEyZTcwYWQxZjMzZTI0ZmE5NmFkODQ4OTkxNGZhYw==
6
+ MDUyYzg5N2U2ZDRmYjA0OWNiODMzNzEzYWE2NmQxODZhZjViZDFiNg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ODlmY2I4Zjc4ZGI5YmZkNDI0NjJmMTc3ZmVmMjMxZjY3YjFmYWQ2MDM5ZjM5
10
- NTBiZmY0YjU2OTRlOGRjMDBmNzMzYzgwZWY4ODdhNTk3MWI3YmJlYzM3OTAx
11
- MzM4OGEyMzBiM2I2ODM0YzFkODA4YmYyMmEzYmQyODI1YWY0NjA=
9
+ ZDkxNWU4NjhiODM1Nzg2NWI5OWRlNDRjYWI0ZjU2ZTFmOGU0MDlhMjM3NDJi
10
+ OTE0MDZkZWQ5YmUzOTM4YzgwZWM2MjUwYmQwMDBmMmQ4NWNmOWM4OGZiYmIy
11
+ ZmE1OWJiYzAwZThiOTU0OTg0NjM1NjA2YjQ3NGNjY2M5ODQxZWY=
12
12
  data.tar.gz: !binary |-
13
- MmU3NzAxZjJkOWY3MDUzODkyMjczNGZjMTFkYmYzY2RhZWJlYjIxMGVlNDEx
14
- Y2RlYzc0MTgzNmI2NGM5NGEzZDM1NjBlZGE1YjgzZGMzZWZlYzdhNjFjM2Rk
15
- YTRhYzE4NjA3NTYzZjExYWEwZDI0ODlhZGNhYjU0MWQ0ZDhiNDQ=
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, series_title
9
- set_unless_nil :season_number, season_number
10
- set_unless_nil :episode_title, 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, quality
13
- set_unless_nil :extension, extension, default: DEFAULT_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 << extension.gsub('.', '') # remove . so the join is easier
24
- formatted.join('.')
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!
@@ -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
@@ -1,3 +1,3 @@
1
1
  module WhereTo
2
- VERSION = "0.9.4"
2
+ VERSION = "0.9.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: where_to
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Toniazzo