<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -15,6 +15,12 @@ module Panda
   class Video
     attr_accessor :vals
     
+    def find_encoding(profile_title)
+      self.encodings.find { |e| 
+          e.profile_title == profile_title and e.status == 'success'
+        }
+    end
+    
     def self.new_with_attrs(vals)
       video = new
       video.vals = {}
@@ -33,60 +39,58 @@ module Panda
       return video
     end
     
-    class &lt;&lt; self
-      def find(token)
-        response = request(:get, &quot;/videos/#{token}&quot;)
-        p = self.new_with_attrs(response[:video])
-        return p
-      end
-  
-      def create
-        response = request(:post, &quot;/videos&quot;)
-        p = self.new_with_attrs(response[:video])
-        return p
-      end
-  
-      def videos
-        response = request(:get, &quot;/videos&quot;)
-        return response[:videos].map {|v| self.new_with_attrs(v[:video]) }
-      end
+    def self.find(token)
+      response = request(:get, &quot;/videos/#{token}&quot;)
+      p = self.new_with_attrs(response[:video])
+      return p
+    end
+
+    def self.create
+      response = request(:post, &quot;/videos&quot;)
+      p = self.new_with_attrs(response[:video])
+      return p
+    end
+
+    def self.videos
+      response = request(:get, &quot;/videos&quot;)
+      return response[:videos].map {|v| self.new_with_attrs(v[:video]) }
+    end
+
+    # Makes request to remote service.
+    def self.request(method, path, params={})
+      raise Panda::AccountKeyNotSet if Panda.account_key.nil?
+      params[:account_key] = Panda.account_key
+      path += &quot;.yaml&quot;
+      http = Net::HTTP.new(Panda.api_domain, Panda.api_port)
   
-      # Makes request to remote service.
-      def request(method, path, params={})
-        raise Panda::AccountKeyNotSet if Panda.account_key.nil?
-        params[:account_key] = Panda.account_key
-        path += &quot;.yaml&quot;
-        http = Net::HTTP.new(Panda.api_domain, Panda.api_port)
-    
-        case method
-        when :get
-          response = http.request_get(&quot;#{path}?account_key=#{Panda.account_key}&quot;)
-        when :post
-          req = Net::HTTP::Post.new(path)
-          req.form_data = params
-          response = http.request(req)
-        end
-    
-        puts &quot;--&gt; #{response.code} #{response.message} (#{response.body.length})&quot;
-        puts response.body
-        handle_response(response)
+      case method
+      when :get
+        response = http.request_get(&quot;#{path}?account_key=#{Panda.account_key}&quot;)
+      when :post
+        req = Net::HTTP::Post.new(path)
+        req.form_data = params
+        response = http.request(req)
       end
   
-      # Handles response and error codes from remote service.
-  
-      def handle_response(response)
-        case response.code.to_i
-          when 200...400
-            YAML.load(response.body)
-          when 401
-            raise(Panda::UnauthorizedAccess.new(response))
-          when 404
-            raise(Panda::ResourceNotFound.new(response))
-          when 500...600
-            raise(Panda::ServerError.new(response))
-          else
-            raise(Panda::PandaError.new(response, &quot;Unknown response code: #{response.code}&quot;))
-        end
+      puts &quot;--&gt; #{response.code} #{response.message} (#{response.body.length})&quot;
+      puts response.body
+      handle_response(response)
+    end
+
+    # Handles response and error codes from remote service.
+
+    def self.handle_response(response)
+      case response.code.to_i
+        when 200...400
+          YAML.load(response.body)
+        when 401
+          raise(Panda::UnauthorizedAccess.new(response))
+        when 404
+          raise(Panda::ResourceNotFound.new(response))
+        when 500...600
+          raise(Panda::ServerError.new(response))
+        else
+          raise(Panda::PandaError.new(response, &quot;Unknown response code: #{response.code}&quot;))
       end
     end
   end</diff>
      <filename>lib/panda/video.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>94290989d23bf1bf692b46aceca6bd11672a8bbf</id>
    </parent>
  </parents>
  <author>
    <name>Damien Tanner</name>
    <email>damien@new-bamboo.co.uk</email>
  </author>
  <url>http://github.com/newbamboo/panda_gem/commit/d6b7149a160da74f5d7ea273e7c35684db394258</url>
  <id>d6b7149a160da74f5d7ea273e7c35684db394258</id>
  <committed-date>2008-07-03T06:16:02-07:00</committed-date>
  <authored-date>2008-07-03T06:16:02-07:00</authored-date>
  <message>find_encoding method</message>
  <tree>794b979e7d7344521cf0ec801f8376589bf15329</tree>
  <committer>
    <name>Damien Tanner</name>
    <email>damien@new-bamboo.co.uk</email>
  </committer>
</commit>
