<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -353,10 +353,13 @@ class Video &lt; SimpleDB::Base
   # API
   # ===
   
+  # Hash of paramenters for video and encodings when video.xml/yaml requested.
+  # 
+  # See the specs for an example of what this returns
+  # 
   def show_response
-    # :filename, :original_filename, :parent, :status, :duration, :container, :width, :height, :video_codec, :video_bitrate, :fps, :audio_codec, :audio_bitrate, :audio_sample_rate, :profile, :profile_title, :player, :encoding_time, :encoded_at, :updated_at, :created_at
-    
-    r = {:video =&gt; {
+    r = {
+      :video =&gt; {
         :id =&gt; self.key,
         :status =&gt; self.status
       }
@@ -364,7 +367,11 @@ class Video &lt; SimpleDB::Base
     
     # Common attributes for originals and encodings
     if self.status == 'original' or self.encoding?
-      r[:video].merge!([:filename, :original_filename, :screenshot, :thumbnail, :width, :height, :duration].map_to_hash {|k| {k =&gt; self.send(k)} })
+      [:filename, :original_filename, :width, :height, :duration].each do |k|
+        r[:video][k] = self.send(k)
+      end
+      r[:video][:screenshot]  = self.clipping.filename(:screenshot)
+      r[:video][:thumbnail]   = self.clipping.filename(:thumbnail)
     end
     
     # If the video is a parent, also return the data for all its encodings
@@ -374,7 +381,9 @@ class Video &lt; SimpleDB::Base
     
     # Reutrn extra attributes if the video is an encoding
     if self.encoding?
-      r[:video].merge!([:parent, :profile, :profile_title, :encoded_at, :encoding_time].map_to_hash {|k| {k =&gt; self.send(k)} })
+      r[:video].merge! \
+        [:parent, :profile, :profile_title, :encoded_at, :encoding_time].
+          map_to_hash { |k| {k =&gt; self.send(k)} }
     end
     
     return r</diff>
      <filename>app/models/video.rb</filename>
    </modified>
    <modified>
      <diff>@@ -373,8 +373,44 @@ describe Video do
     
     @video.add_to_queue
   end
-
-  # def show_response
+  
+  describe &quot;show_response&quot; do
+    before :each do
+      @encoding = Video.new
+      @encoding.filename = 'abc.flv'
+      @encoding.key = '1234'
+      
+      @video.stub!(:encodings).and_return([])
+    end
+    
+    it &quot;should contain a hash of parameters for the video&quot; do
+      @video.show_response.should == {
+        :video =&gt; {
+          :thumbnail=&gt;&quot;abc.mov_50_thumb.jpg&quot;, 
+          :height=&gt;360, 
+          :filename=&gt;&quot;abc.mov&quot;, 
+          :screenshot=&gt;&quot;abc.mov_50.jpg&quot;, 
+          :status=&gt;&quot;original&quot;, 
+          :duration=&gt;100, 
+          :original_filename=&gt;&quot;original_filename.mov&quot;, 
+          :width=&gt;480, 
+          :encodings=&gt; [], 
+          :id=&gt;&quot;abc&quot;
+        }
+      }
+    end
+    
+    it &quot;should contain an array of encodings if defined&quot; do
+      @video.stub!(:encodings).and_return([@encoding])
+      
+      @video.show_response[:video][:encodings].first.should == {
+        :video =&gt; {
+          :status=&gt;nil, 
+          :id=&gt;&quot;1234&quot;
+        }
+      }
+    end
+  end
   
   it &quot;should return correct API create response hash&quot; do
     @video.create_response.should == {:video =&gt; {:id =&gt; 'abc'}}</diff>
      <filename>spec/models/video_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>fcf08b342b45452e9c034ca5e0bc9c48b912ef6d</id>
    </parent>
  </parents>
  <author>
    <name>Martyn Loughran</name>
    <email>martyn@new-bamboo.co.uk</email>
  </author>
  <url>http://github.com/reddavis/panda/commit/d3a2e8c76c66e2553e22d55fd7e93ab5524762d4</url>
  <id>d3a2e8c76c66e2553e22d55fd7e93ab5524762d4</id>
  <committed-date>2008-10-20T12:34:57-07:00</committed-date>
  <authored-date>2008-10-20T12:32:37-07:00</authored-date>
  <message>Fixed video.(xml/yaml): Test and fix a bug in the show_response method.</message>
  <tree>4cf9e48213c92d23def3264f52ea01c3214acec4</tree>
  <committer>
    <name>Martyn Loughran</name>
    <email>martyn@new-bamboo.co.uk</email>
  </committer>
</commit>
