CC-3144 : Search box shows Track, Show Contents box shows Genre

replaces track number with genre.
This commit is contained in:
Naomi Aro 2011-12-01 11:16:29 +01:00
parent 31ded8b047
commit f15429c8d6
3 changed files with 16 additions and 16 deletions

View File

@ -442,10 +442,10 @@ class Application_Model_StoredFile {
{ {
$serverName = $_SERVER['SERVER_NAME']; $serverName = $_SERVER['SERVER_NAME'];
$serverPort = $_SERVER['SERVER_PORT']; $serverPort = $_SERVER['SERVER_PORT'];
return $this->constructGetFileUrl($serverName, $serverPort); return $this->constructGetFileUrl($serverName, $serverPort);
} }
/** /**
* Get the URL to access this file using the server name/address that * Get the URL to access this file using the server name/address that
* is specified in the airtime.conf config file. If either of these is * is specified in the airtime.conf config file. If either of these is
@ -453,13 +453,13 @@ class Application_Model_StoredFile {
*/ */
public function getFileUrlUsingConfigAddress(){ public function getFileUrlUsingConfigAddress(){
global $CC_CONFIG; global $CC_CONFIG;
if (isset($CC_CONFIG['baseUrl'])){ if (isset($CC_CONFIG['baseUrl'])){
$serverName = $CC_CONFIG['baseUrl']; $serverName = $CC_CONFIG['baseUrl'];
} else { } else {
$serverName = $_SERVER['SERVER_NAME']; $serverName = $_SERVER['SERVER_NAME'];
} }
if (isset($CC_CONFIG['basePort'])){ if (isset($CC_CONFIG['basePort'])){
$serverPort = $CC_CONFIG['basePort']; $serverPort = $CC_CONFIG['basePort'];
} else { } else {
@ -468,7 +468,7 @@ class Application_Model_StoredFile {
return $this->constructGetFileUrl($serverName, $serverPort); return $this->constructGetFileUrl($serverName, $serverPort);
} }
private function constructGetFileUrl($p_serverName, $p_serverPort){ private function constructGetFileUrl($p_serverName, $p_serverPort){
return "http://$p_serverName:$p_serverPort/api/get-media/file/".$this->getGunId().".".$this->getFileExtension(); return "http://$p_serverName:$p_serverPort/api/get-media/file/".$this->getGunId().".".$this->getFileExtension();
} }
@ -604,7 +604,7 @@ class Application_Model_StoredFile {
{ {
return Application_Model_StoredFile::Recall(null, null, null, $p_filepath); return Application_Model_StoredFile::Recall(null, null, null, $p_filepath);
} }
public static function RecallByPartialFilepath($partial_path){ public static function RecallByPartialFilepath($partial_path){
$path_info = Application_Model_MusicDir::splitFilePath($partial_path); $path_info = Application_Model_MusicDir::splitFilePath($partial_path);
@ -625,11 +625,11 @@ class Application_Model_StoredFile {
} }
return $res; return $res;
} }
public static function searchFilesForPlaylistBuilder($datatables) { public static function searchFilesForPlaylistBuilder($datatables) {
global $CC_CONFIG; global $CC_CONFIG;
$displayData = array("track_title", "artist_name", "album_title", "track_number", "length", "ftype"); $displayData = array("track_title", "artist_name", "album_title", "genre", "length", "ftype");
$plSelect = "SELECT "; $plSelect = "SELECT ";
$fileSelect = "SELECT "; $fileSelect = "SELECT ";
@ -812,11 +812,11 @@ class Application_Model_StoredFile {
// create temp file name (CC-3086) // create temp file name (CC-3086)
$command = "mktemp --tmpdir=".$p_targetDir; $command = "mktemp --tmpdir=".$p_targetDir;
$tempFilePath= exec($command); $tempFilePath= exec($command);
if($tempFilePath == ""){ if($tempFilePath == ""){
die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "Unable to create tmp file."}, "id" : "id"}'); die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "Unable to create tmp file."}, "id" : "id"}');
} }
if (strpos($contentType, "multipart") !== false) { if (strpos($contentType, "multipart") !== false) {
if (isset($_FILES['file']['tmp_name']) && is_uploaded_file($_FILES['file']['tmp_name'])) { if (isset($_FILES['file']['tmp_name']) && is_uploaded_file($_FILES['file']['tmp_name'])) {
// Open temp file // Open temp file
@ -854,7 +854,7 @@ class Application_Model_StoredFile {
} else } else
die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": "Failed to open output stream."}, "id" : "id"}'); die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": "Failed to open output stream."}, "id" : "id"}');
} }
return $tempFilePath; return $tempFilePath;
} }
@ -919,11 +919,11 @@ class Application_Model_StoredFile {
$this->_file->setDbSoundCloudLinkToFile($link_to_file) $this->_file->setDbSoundCloudLinkToFile($link_to_file)
->save(); ->save();
} }
public function getSoundCloudLinkToFile(){ public function getSoundCloudLinkToFile(){
return $this->_file->getDbSoundCloudLinkToFile(); return $this->_file->getDbSoundCloudLinkToFile();
} }
public function setSoundCloudFileId($p_soundcloud_id) public function setSoundCloudFileId($p_soundcloud_id)
{ {
$this->_file->setDbSoundCloudId($p_soundcloud_id) $this->_file->setDbSoundCloudId($p_soundcloud_id)
@ -955,7 +955,7 @@ class Application_Model_StoredFile {
public function uploadToSoundCloud() public function uploadToSoundCloud()
{ {
global $CC_CONFIG; global $CC_CONFIG;
$file = $this->_file; $file = $this->_file;
if(is_null($file)) { if(is_null($file)) {
return "File does not exist"; return "File does not exist";

View File

@ -11,7 +11,7 @@
<th>Title</th> <th>Title</th>
<th>Creator</th> <th>Creator</th>
<th>Album</th> <th>Album</th>
<th>Track</th> <th>Genre</th>
<th>Length</th> <th>Length</th>
<th>Type</th> <th>Type</th>
</tr> </tr>

View File

@ -318,7 +318,7 @@ function createDataTable(data) {
/* Title */ { "sName": "track_title" }, /* Title */ { "sName": "track_title" },
/* Creator */ { "sName": "artist_name" }, /* Creator */ { "sName": "artist_name" },
/* Album */ { "sName": "album_title" }, /* Album */ { "sName": "album_title" },
/* Track */ { "sName": "track_number" }, /* Genre */ { "sName": "genre" },
/* Length */ { "sName": "length" }, /* Length */ { "sName": "length" },
/* Type */ { "sName": "ftype", "bSearchable": false } /* Type */ { "sName": "ftype", "bSearchable": false }
], ],