Ticket #3195: mythweb-music-albums-first.patch

File mythweb-music-albums-first.patch, 2.3 KB (added by otto at kolsi dot fi, 13 years ago)
  • modules/music/mp3act_functions.php

     
    453453
    454454      $output = '<div class="head">
    455455        <h2 class="music">'.$artist.'</h2></div>
    456         <p><strong>'.t('Songs').'</strong></p>
    457         <ul class="music">';
    458 
    459       $query = 'SELECT ms.song_id, ms.track, ms.name, ms.length, ms.numplays, '.
    460         'SEC_TO_TIME(ms.length/1000) AS length, music_artists.artist_name, track, music_albums.album_name '.
    461         'FROM music_songs AS ms '.
    462         'LEFT JOIN music_artists ON ms.artist_id=music_artists.artist_id '.
    463         'LEFT JOIN music_albums ON ms.album_id=music_albums.album_id '.
    464         'WHERE ms.artist_id='.$sql_itemid.';';
    465       $result = mysql_query($query);
    466       if (!$result)
    467         break;
    468 
    469       while ($row = mysql_fetch_array($result))
    470       {
    471         $output .= getHtmlSong($row['song_id'], '',
    472           $row['album_name'], $row['track'], $row['name'],
    473           $row['length'], $row['numplays']);
    474       }
    475       mysql_free_result($result);
    476       $output .= '</ul><br />
    477456        <p><strong>'.sprintf(t('Albums with songs by %s'),'<i>'.$artist.'</i>').'</strong></p>
    478457        <ul class="music">';
    479458
     
    498477          $artist, $row['year'], $row['num_tracks'], $row['length']);
    499478      }
    500479      mysql_free_result($result);
     480
     481      $output .= '</ul><p><strong>'.t('Songs').'</strong></p>
     482        <ul class="music">';
     483
     484      $query = 'SELECT ms.song_id, ms.track, ms.name, ms.length, ms.numplays, '.
     485        'SEC_TO_TIME(ms.length/1000) AS length, music_artists.artist_name, track, music_albums.album_name '.
     486        'FROM music_songs AS ms '.
     487        'LEFT JOIN music_artists ON ms.artist_id=music_artists.artist_id '.
     488        'LEFT JOIN music_albums ON ms.album_id=music_albums.album_id '.
     489        'WHERE ms.artist_id='.$sql_itemid.';';
     490      $result = mysql_query($query);
     491      if (!$result)
     492        break;
     493
     494      while ($row = mysql_fetch_array($result))
     495      {
     496        $output .= getHtmlSong($row['song_id'], '',
     497          $row['album_name'], $row['track'], $row['name'],
     498          $row['length'], $row['numplays']);
     499      }
     500      mysql_free_result($result);
    501501      $output .= '</ul>';
    502502      break;
    503503