plex-ruby
Advanced tools
+3
-0
@@ -0,1 +1,4 @@ | ||
| ## 1.5.1 | ||
| * `Plex::Video` now supports multiple media entries (`@media` renamed to `@medias`) | ||
| ## 1.5.0 | ||
@@ -2,0 +5,0 @@ |
| module Plex | ||
| VERSION = "1.5.0" | ||
| VERSION = "1.5.1" | ||
| end |
| module Plex | ||
| class Video | ||
| ATTRIBUTES = %w(ratingKey key studio type title titleSort contentRating summary | ||
| rating viewCount year tagline thumb art duration | ||
| ATTRIBUTES = %w(ratingKey key studio type title titleSort contentRating summary | ||
| rating viewCount year tagline thumb art duration | ||
| originallyAvailableAt updatedAt) | ||
| attr_reader :media, :genres, :writers, :directors, :roles, :attribute_hash | ||
| attr_reader :medias, :genres, :writers, :directors, :roles, :attribute_hash | ||
| # @param [Nokogiri::XML::Element] nokogiri element that represents this | ||
@@ -21,7 +21,7 @@ # Video | ||
| @media = Plex::Media.new(node.search('Media').first) | ||
| @medias = node.search('Media').map { |m| Plex::Media.new(m) } | ||
| @genres = node.search('Genre').map { |m| Plex::Genre.new(m) } | ||
| @writers = node.search('Writer').map { |m| Plex::Writer.new(m) } | ||
| @directors = node.search('Director').map { |m| Plex::Director.new(m) } | ||
| @roles = node.search('Role').map { |m| Plex::Role.new(m) } | ||
| @directors = node.search('Director').map { |m| Plex::Director.new(m) } | ||
| @roles = node.search('Role').map { |m| Plex::Role.new(m) } | ||
| end | ||
@@ -28,0 +28,0 @@ |
@@ -26,5 +26,5 @@ require 'test_helper' | ||
| } | ||
| @episode.media.must_equal fake_video.media | ||
| @episode.medias.must_equal fake_video.medias | ||
| @episode.genres.must_equal fake_video.genres | ||
@@ -31,0 +31,0 @@ |
@@ -19,5 +19,5 @@ require 'test_helper' | ||
| } | ||
| @movie.media.must_equal fake_video.media | ||
| @movie.medias.must_equal fake_video.medias | ||
| @movie.genres.must_equal fake_video.genres | ||
@@ -24,0 +24,0 @@ |
@@ -14,5 +14,5 @@ require 'test_helper' | ||
| } | ||
| it "should correctly referance its media object" do | ||
| @video.instance_variable_get("@media").must_equal Plex::Media.new(FAKE_VIDEO_NODE_HASH[:Media]) | ||
| @video.instance_variable_get("@medias").must_equal Array( Plex::Media.new(FAKE_VIDEO_NODE_HASH[:Media]) ) | ||
| end | ||
@@ -19,0 +19,0 @@ |