Changeset 1679
- Timestamp:
- 08/20/08 22:22:33 (3 months ago)
- Location:
- trunk
- Files:
-
- 3 modified
-
docs/CHANGELOG (modified) (1 diff)
-
lib/class/browse.class.php (modified) (9 diffs)
-
templates/show_songs.inc.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/docs/CHANGELOG
r1670 r1679 5 5 -------------------------------------------------------------------------- 6 6 v.3.5-Alpha1 7 - Add ability to sort by artist name, album name on song browse 7 8 - Implemented caching on artist and album browse, added total 8 9 artist time to the many artist view -
trunk/lib/class/browse.class.php
r1675 r1679 111 111 } // end switch 112 112 113 // If we've set a filter we need to reset the totals 114 self::reset_total(); 115 self::set_start(0); 116 113 117 return true; 114 118 … … 125 129 self::reset_supplemental_objects(); 126 130 self::set_simple_browse(0); 131 self::set_start(0); 127 132 128 133 } // reset … … 277 282 case 'playlist_song': 278 283 case 'song': 279 $valid_array = array('title','year','track','time' );284 $valid_array = array('title','year','track','time','album','artist'); 280 285 break; 281 286 case 'artist': … … 333 338 public static function set_join($type,$table,$source,$dest) { 334 339 335 $_SESSION['browse']['join'][self::$type] = strtoupper($type) . ' JOIN ' . $table . ' ON ' . $source . '=' . $dest;340 $_SESSION['browse']['join'][self::$type] = array($table=>strtoupper($type) . ' JOIN ' . $table . ' ON ' . $source . '=' . $dest); 336 341 337 342 } // set_join … … 565 570 */ 566 571 private static function get_sort_sql() { 567 572 568 573 if (!is_array($_SESSION['browse']['sort'][self::$type])) { return ''; } 569 574 … … 600 605 */ 601 606 private static function get_join_sql() { 602 607 603 608 if (!is_array($_SESSION['browse']['join'][self::$type])) { 604 609 return ''; … … 610 615 $sql .= $join . ' '; 611 616 } 612 617 613 618 return $sql; 614 619 … … 816 821 case 'album': 817 822 $sql = '`album`.`name`'; 818 self::set_join('left','`album`','`album`.`id`','`song`.`id`'); 823 self::set_join('left','`album`','`album`.`id`','`song`.`album`'); 824 break; 825 case 'artist': 826 $sql = '`artist`.`name`'; 827 self::set_join('left','`artist`','`artist`.`id`','`song`.`artist`'); 819 828 break; 820 829 default: … … 1080 1089 $order_sql = rtrim($order_sql,"ORDER BY "); 1081 1090 $order_sql = rtrim($order_sql,","); 1082 $sql = $sql . $order_sql;1091 $sql = $sql . self::get_join_sql() . $order_sql; 1083 1092 } // if not simple 1084 1093 -
trunk/templates/show_songs.inc.php
r1672 r1679 39 39 <th class="cel_add"><?php echo _('Add'); ?></th> 40 40 <th class="cel_song"><?php echo Ajax::text('?page=browse&action=set_sort&type=song&sort=title',_('Song Title'),'sort_song_title'); ?></th> 41 <th class="cel_artist"><?php echo _('Artist'); ?></th>41 <th class="cel_artist"><?php echo Ajax::text('?page=browse&action=set_sort&type=song&sort=artist',_('Artist'),'sort_song_artist'); ?></th> 42 42 <th class="cel_album"><?php echo Ajax::text('?page=browse&action=set_sort&type=song&sort=album',_('Album'),'sort_song_album'); ?></th> 43 43 <th class="cel_tags"><?php echo _('Tags'); ?></th> … … 68 68 <th class="cel_add"><?php echo _('Add'); ?></th> 69 69 <th class="cel_song"><?php echo Ajax::text('?page=browse&action=set_sort&type=song&sort=title',_('Song Title'),'sort_song_title_bottom'); ?></th> 70 <th class="cel_artist"><?php echo _('Artist'); ?></th>71 <th class="cel_album"><?php echo _('Album'); ?></th>70 <th class="cel_artist"><?php echo Ajax::text('?page=browse&action=set_sort&type=song&sort=artist',_('Artist'),'sort_song_artist_bottom'); ?></th> 71 <th class="cel_album"><?php echo Ajax::text('?page=browse&action=set_sort&type=song&sort=album',_('Album'),'sort_song_album_bottom'); ?></th> 72 72 <th class="cel_tags"><?php echo _('Tags'); ?></th> 73 73 <th class="cel_track"><?php echo Ajax::text('?page=browse&action=set_sort&type=song&sort=track',_('Track'),'sort_song_track_bottom'); ?></th>
