CC-3329: Library: Add "track number" to the list of available columns to show (was in 1.9, disappeared in 2.0)
- updated the view columns to include track_number from db as track - updated sql query to include track_number from db
This commit is contained in:
parent
14a9225b97
commit
190490d6f4
2 changed files with 11 additions and 5 deletions
|
@ -583,7 +583,7 @@ class Application_Model_StoredFile {
|
|||
{
|
||||
global $CC_CONFIG;
|
||||
|
||||
$displayData = array("track_title", "artist_name", "album_title", "genre", "length", "year", "utime", "mtime", "ftype");
|
||||
$displayData = array("track_title", "artist_name", "album_title", "genre", "length", "year", "utime", "mtime", "ftype", "track_number");
|
||||
|
||||
$plSelect = "SELECT ";
|
||||
$fileSelect = "SELECT ";
|
||||
|
@ -610,6 +610,9 @@ class Application_Model_StoredFile {
|
|||
} else if ($key === "mtime") {
|
||||
$plSelect .= $key.", ";
|
||||
$fileSelect .= $key.", ";
|
||||
} else if ($key === "track_number") {
|
||||
$plSelect .= "NULL AS ".$key.", ";
|
||||
$fileSelect .= $key.", ";
|
||||
} else {
|
||||
$plSelect .= "NULL AS ".$key.", ";
|
||||
$fileSelect .= $key.", ";
|
||||
|
@ -621,7 +624,8 @@ class Application_Model_StoredFile {
|
|||
UNION
|
||||
(".$fileSelect."id FROM ".$CC_CONFIG["filesTable"]." AS FILES WHERE file_exists = 'TRUE')) AS RESULTS";
|
||||
|
||||
$results = Application_Model_StoredFile::searchFiles($fromTable, $datatables);
|
||||
$results = Application_Model_StoredFile::searchFiles($fromTable, $datatables);
|
||||
|
||||
|
||||
foreach($results['aaData'] as &$row){
|
||||
|
||||
|
@ -733,6 +737,7 @@ class Application_Model_StoredFile {
|
|||
$sql = $selectorRows." FROM ".$fromTable." ORDER BY ".$orderby." OFFSET ".$data["iDisplayStart"]." LIMIT ".$data["iDisplayLength"];
|
||||
}
|
||||
|
||||
//display sql executed in airtime log for testing
|
||||
//Logging::log($sql);
|
||||
|
||||
$results = $CC_DBC->getAll($sql);
|
||||
|
|
|
@ -309,7 +309,8 @@ function createDataTable(data) {
|
|||
/* Year */ {"sTitle": "Year", "sName": "year", "mDataProp": "year", "sClass": "library_year"},
|
||||
/* Length */ {"sTitle": "Length", "sName": "length", "mDataProp": "length", "sClass": "library_length"},
|
||||
/* Upload Time */ {"sTitle": "Uploaded", "sName": "utime", "mDataProp": "utime", "sClass": "library_upload_time"},
|
||||
/* Last Modified */ {"sTitle": "Last Modified", "sName": "mtime", "bVisible": false, "mDataProp": "mtime", "sClass": "library_modified_time"}
|
||||
/* Last Modified */ {"sTitle": "Last Modified", "sName": "mtime", "bVisible": false, "mDataProp": "mtime", "sClass": "library_modified_time"},
|
||||
/* Track Number */ {"sTitle": "Track", "sName": "track", "bSearchable": false, "bVisible": false, "mDataProp": "track_number", "sClass": "library_track"}
|
||||
],
|
||||
"aaSorting": [[2,'asc']],
|
||||
"sPaginationType": "full_numbers",
|
||||
|
@ -358,7 +359,7 @@ function createDataTable(data) {
|
|||
|
||||
"oColReorder": {
|
||||
"iFixedColumns": 2,
|
||||
"aiOrder": [ 0,1,2,3,4,5,6,7,8,9 ]
|
||||
"aiOrder": [ 0,1,2,3,4,5,6,7,8,9,10 ]
|
||||
}
|
||||
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue