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
@@ -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'
|
data/lib/etvnet_seek/main.rb
CHANGED
@@ -70,12 +70,7 @@ class Main
|
|
70
70
|
process('media', current_item.link)
|
71
71
|
end
|
72
72
|
else # media : announces, freetv, category
|
73
|
-
|
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)
|