peerflixrb 6.0.0 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 601e90feab0054afdc5e67f5105ab704b7b7b0f7
4
- data.tar.gz: d6eeffe48387fef754ed3ac4948a54a4cb79d016
3
+ metadata.gz: 6609b3543f679e2b495b514a61823b05537e5e81
4
+ data.tar.gz: a30b2b6ecd00c63fc94e005aea77f6db952a8241
5
5
  SHA512:
6
- metadata.gz: a2c051960245f97b5a75de7121c0a264fe237dec1c323c7c6e3954f647237e048d627c264e224e11c1844def866a1fb787aaf76757e81eb99c6255a8560640b1
7
- data.tar.gz: 65aa8eca938b268425f7c9c9b2d53237085c06a3d347a205065852b7aa71e47a7851e4463a3e2d5b6e721eb444cf91b610af11c1558cff58b845559bde4e7c62
6
+ metadata.gz: 853e0f3035a30d34bb598d5c1043b50b8580cc5239cc2a63db7c05273631fd42699effdb4db510d48d3a037ac89e11c9760886101fe39eea2ea53cc281ba2009
7
+ data.tar.gz: b923418b0ab8dc175cbf461130c0ab89a18f99699912ed1cb00f3884872b4f903f52227f7d90dea50f2942cfd55e4e0b88d2551660c495008b1acd6e34154a3f
@@ -84,9 +84,26 @@ module Peerflixrb
84
84
  YifySubtitles.download(link.imdb_id, 'english')
85
85
  when :show
86
86
  filename = link.filename || link.title
87
- search = Addic7edDownloader::Search.by_filename(filename, lang: options[:language])
88
87
 
89
- return search.download_best unless options[:choose_subtitles]
88
+ # Try to download by filename
89
+ if link.filename
90
+ search = Addic7edDownloader::Search.by_filename(link.filename, lang: options[:language])
91
+
92
+ unless options[:choose_subtitles]
93
+ return search.download_best if search.download_best
94
+ end
95
+ end
96
+
97
+ # Try to download by title (Archer has problems with this because it usually
98
+ # appears as "Archer 2009 - 02x03", which gives Addic7ed API problems)
99
+ if search.nil? || search.results.empty?
100
+ search = Addic7edDownloader::Search.by_filename(link.title, lang: options[:language])
101
+ search.extract_tags(link.filename) if link.filename
102
+
103
+ unless options[:choose_subtitles]
104
+ return search.download_best if search.download_best
105
+ end
106
+ end
90
107
 
91
108
  # Choose subtitle
92
109
  say "Choose subtitles for #{filename.blue}:".yellow
@@ -1,3 +1,3 @@
1
1
  module Peerflixrb
2
- VERSION = '6.0.0'.freeze
2
+ VERSION = '6.0.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: peerflixrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0
4
+ version: 6.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Marchante