etvnet_seek 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
data/etvnet_seek.gemspec CHANGED
@@ -4,7 +4,7 @@ require "rake"
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = %q{etvnet_seek}
7
- s.version = "0.5.0"
7
+ s.version = "0.6.0"
8
8
 
9
9
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
10
10
 
@@ -1,3 +1,6 @@
1
+ require 'nokogiri'
2
+ require 'open-uri'
3
+
1
4
  class MediaItem
2
5
  attr_reader :text, :link, :additional_info
3
6
  attr_reader :underscore_name, :media_file
@@ -15,6 +18,10 @@ class MediaItem
15
18
  false
16
19
  end
17
20
 
21
+ def has_media_links?
22
+ Nokogiri::HTML(open(Page::BASE_URL + current_item.link)).css("b a.media_file").size > 0
23
+ end
24
+
18
25
  def ==(object)
19
26
  object.text == text and object.link == link
20
27
  end
@@ -11,7 +11,6 @@ require 'etvnet_seek/core/page'
11
11
  require 'etvnet_seek/core/base_page'
12
12
  require 'etvnet_seek/core/media_page'
13
13
  require 'etvnet_seek/core/archive_media_page'
14
- require 'etvnet_seek/core/main_page'
15
14
  require 'etvnet_seek/core/search_page'
16
15
  require 'etvnet_seek/core/freetv_page'
17
16
  require 'etvnet_seek/core/channels_page'
@@ -70,12 +70,7 @@ class Main
70
70
  process('media', current_item.link)
71
71
  end
72
72
  else # media : announces, freetv, category
73
- require 'nokogiri'
74
- require 'open-uri'
75
-
76
- size = Nokogiri::HTML(open(Page::BASE_URL + current_item.link)).css("b a.media_file").size
77
-
78
- if current_item.folder? or current_item.link =~ /action=view_recommended/ or size > 0
73
+ if current_item.folder? or current_item.link =~ /action=view_recommended/ or current_item.has_media_links?
79
74
  process('media', current_item.link)
80
75
  else
81
76
  process("access", current_item)
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 5
7
+ - 6
8
8
  - 0
9
- version: 0.5.0
9
+ version: 0.6.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Alexander Shvets