No Enclosure Tag?

tonyp001 - December 8, 2007 - 18:08
Project:Audio
Version:5.x-1.3
Component:audio_itunes
Category:support request
Priority:normal
Assigned:Unassigned
Status:active (needs more info)
Description

So, I installed the Audio module and enabled the Audio iTunes piece, but I'm having some trouble getting it work.

I created a view and made it a "View RSS: iTunes RSS Feed," and tried to submit it to iTunes, but it doesn't work and iTunes states "The feed has no episodes." The RSS feed populates with audio nodes, so I'm not sure why it's giving me this error.

Does anyone have an idea for why this is happening?

#1

tonyp001 - December 8, 2007 - 20:26
Title:iTunes: "The feed has no epsiodes"» No Enclosure Tag?

It appears that the Audio iTunes piece is not writing the enclosure tag, which is required by iTunes. Has anyone run across this problem before?

#2

tonyp001 - December 9, 2007 - 22:10
Status:active» patch (code needs review)

I was able to fix the issue by adding an enclosure tag in the $extra variable (around line 445). However, I had to write some additional code to retrieve the attributes used in the tag. I'm new to Drupal so there may have been a better way, but I posted the code below for anyone who might need it:

<?php
function audio_itunes_enclosure_attributes($vid){
    global
$base_url;
   
   
$result = db_fetch_array(db_query("SELECT * FROM {audio_file} WHERE vid=%d", $vid));
   
$attributes = array('url' => $base_url."/".$result['filepath'], 'length'=> $result['filesize'], 'type'=> $result['filemime']);
    return
$attributes;
}
?>

Also, here's the code I added to the $extra variable:

<?php
array('key' => 'enclosure', 'attributes' => audio_itunes_enclosure_attributes($item->nid))
?>

Again, feel free to review it and improve on it.

#3

drewish - December 12, 2007 - 02:34

the audio module itself should be writing that... one other thing to check is that anonymous users have access to download the audio. most RSS feeds aren't authenticated.

#4

drewish - December 18, 2007 - 00:03
Status:patch (code needs review)» active (needs more info)
 
 

Drupal is a registered trademark of Dries Buytaert.