hi,
i'd also like to get the media node to report it's media file in the RSS (and attached files for nodes using the attach media route)

is this possible now of a new feature?

Comments

rhys’s picture

Yes, I've got to look into this a bit more, since it revolves around using the hook_nodeapi and 'rss item', but I'm not familiar with it's use.

rhys’s picture

Status: Active » Needs review

Could you check that changing the contents of hook_nodeapi() in mmedia_nodes.module to the following succeeds for you?

/**
 * Implementation of hook_nodeapi().
 */
function mmedia_nodes_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {
  if ($op == 'load') {
    $node->mid = db_result(db_query("SELECT mid FROM {media_nodes} WHERE nid = %d", $node->nid));
  }
  elseif ($op == 'rss item' && $node->mid && ($media = media_load($node->mid))) {
    $size = filesize($media->path . $media->name .'.'. $media->ext);
    $url = media_filename($media);
    return array(array('key' => 'enclosure', 'attributes' => array('url' => url($url, array('absolute' => true)), 'length' => $size, 'type' => file_get_mimetype($url)))); 
  }
}
rhys’s picture

Issue summary: View changes

I'm closing this, as I won't be fixing it. D6 is considered End of Life once D8 comes out.

rhys’s picture

Status: Needs review » Closed (won't fix)