Changeset 1185

Show
Ignore:
Timestamp:
07/11/08 21:51:29 (6 months ago)
Author:
alban
Message:

Ignore les documents sans cast. Fixe #14

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/app/views/podcasts/feed.rxml

    r1009 r1185  
    55                xml.description @podcast.description 
    66                xml.lastBuildDate @podcast.date 
    7                          
     7 
    88                for document in @podcast.documents 
    9                  xml.item do 
    10                          xml.title document.title 
    11                          xml.author document.author.name 
    12                          xml.itunes :duration, document.length 
    13                          xml.itunes :keywords, document.tags[0..11].join(",") 
    14                          xml.description document.description 
     9         cast = document.casts.first 
     10         next if cast.nil? 
    1511 
    16          cast = document.casts.first 
     12           xml.item do 
     13                 xml.title document.title 
     14                 xml.author document.author.name 
     15                 xml.itunes :duration, document.length 
     16                 xml.itunes :keywords, document.tags[0..11].join(",") 
     17                 xml.description document.description 
     18 
    1719         cast_url = url_for(:controller => 'casts', :action => 'play', :name => cast.name, :only_path => false) + ".mp3" 
    18           
     20 
    1921         xml.enclosure :url => cast_url, :length => cast.size, :type => "audio/mpeg" 
    2022         xml.guid cast_url 
    2123         xml.pubDate document.updated_at.strftime("%a, %e %b %Y %T %Z") 
    22                 end 
     24          end 
    2325                end 
    2426        end