plex-ruby
Advanced tools
+15
-0
@@ -32,1 +32,16 @@ ## 0.0.1.alpha | ||
| * I feel this a production ready, will continue to add features | ||
| ## 1.1.0 | ||
| * Added `Plex::Section` category methods | ||
| * ie. `library.section(2).years # [{key: '2008', title: '2008'},...]` | ||
| * `library.section(1).by_first_letter('H') # [Plex::Movie, ...]` | ||
| * Read the docs for more info | ||
| ## 1.1.1 | ||
| * Fix code breaking bug in 1.1.0 | ||
| ## 1.2.0 | ||
| * `Plex::Client#play_media` now can take an Object that `responds_to(:key)` |
@@ -57,4 +57,4 @@ module Plex | ||
| # | ||
| # @param [String] the key of the video that we want to play. (see | ||
| # Episode#key) (see Movie#key) | ||
| # @param [String, Object] the key of the video that we want to play. Or an | ||
| # Object that responds to :key (see Episode#key) (see Movie#key) | ||
| # @param [String] no clue what this does, its the Plex Remote Command API though | ||
@@ -66,2 +66,7 @@ # @param [String] no clue what this does, its the Plex Remote Command API though | ||
| def play_media(key, user_agent = nil, http_cookies = nil, view_offset = nil) | ||
| if !key.is_a?(String) && key.respond_to?(:key) | ||
| key = key.key | ||
| end | ||
| url = player_url+'/application/playMedia?' | ||
@@ -68,0 +73,0 @@ url += "path=#{CGI::escape(server.url+key)}" |
| module Plex | ||
| VERSION = "1.1.1" | ||
| VERSION = "1.2.0" | ||
| end |
+3
-2
@@ -53,4 +53,5 @@ # Plex-Ruby [](https://secure.travis-ci.org/ekosz/Plex-Ruby.png) | ||
| episodes = bsg.seasons.last.episodes # Array the last seasons episodes | ||
| puts "#{episodes.first.title} - #{episodes.first.summary}" # Looks good | ||
| client.play_media(episodes.first.key) # Play it! | ||
| episode = episodes[4] # The fith episode in the season | ||
| puts "#{episode.title} - #{episode.summary}" # Looks good | ||
| client.play_media(episode) # Play it! | ||
| ``` | ||
@@ -57,0 +58,0 @@ |
@@ -42,2 +42,10 @@ require 'test_helper' | ||
| it "should exsept an object that responds to :key for #play_media" do | ||
| object = Plex::Episode.new(FakeParent.new, '/libary/metadata/6') | ||
| assert @client.play_media(object) | ||
| FakeWeb.last_request.path.must_equal( | ||
| "/system/players/#{@client.name}/application/playMedia?path=#{CGI::escape(@client.url+object.key)}&key=#{CGI::escape(object.key)}" | ||
| ) | ||
| end | ||
| it "should properly commnicate its #screenshot method" do | ||
@@ -44,0 +52,0 @@ assert @client.screenshot(100, 100, 75) |