I have audio module 1.x installed.
Everything works fine, but as my music library grew larger i noticed when browsing by genre, all entries get displayed on one page (there is no paging support). An example would be: http://SITE/audio/by/genre/metal .
Or even browsing by album loads too long page (ex> http://site/audio/by/album)

Any1 has any idea how to get paging support with this?

Comments

danbryant’s picture

I was able to get this idea working using the views module. I had to build a view for each term I was limiting by :-( but at least its working!

The view is set to filter by the audio_metadata tag (Filter-> audio: tag %tagname1). This allows me to create 1 path (path field in the view) for each metadata tag that I want to limit by.

Its not pretty, potentially a LOT of views … 1 for each audio_metadata term you want to browse by, but it works.

kvbbro’s picture

I had the same problem and have a fix that I applied to the audio.module. Not sure how to get this submitted to be included in the actual module yet. I just had to change 1 line and add another. All in this method:

function audio_page_browse_by

Changed this line from:

//$result = db_query(db_rewrite_sql("SELECT n.nid, n.title, a.tag, a.value FROM {node} n INNER JOIN {audio_metadata} a ON n.vid = a.vid WHERE a.tag = '%s' AND a.clean = '%s' AND n.status = 1 ORDER BY n.created ASC"), $tag, audio_clean_tag($value));

To this:

$result = pager_query(db_rewrite_sql("SELECT n.nid, n.title, a.tag, a.value FROM {node} n INNER JOIN {audio_metadata} a ON n.vid = a.vid WHERE a.tag = '%s' AND a.clean = '%s' AND n.status = 1 ORDER BY n.created ASC"), 10, 0, NULL, $tag, audio_clean_tag($value));

Then added one line:
$output .= theme('pager', NULL, 10);

Here...

      $output = '';
      while ($obj = db_fetch_object($result)) {
        if ($node = node_load($obj->nid)) {
          $output .= node_view($node, TRUE);
        }
      }
     //Add the following line for pager...
      $output .= theme('pager', NULL, 10);

    }
    else {
      drupal_set_title(t("Audio by @tag", array('@tag' => $tag)));