No Enclosure Tag?
| Project: | Audio |
| Version: | 5.x-1.3 |
| Component: | audio_itunes |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active (needs more info) |
Jump to:
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
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
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:
<?phparray('key' => 'enclosure', 'attributes' => audio_itunes_enclosure_attributes($item->nid))
?>
Again, feel free to review it and improve on it.
#3
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