cc-2882: Airtime cannot delete watched folder when is been renamed

- initial commit
This commit is contained in:
James 2011-09-27 14:49:03 -04:00
parent e1fe877ac6
commit b1fa8901ca
7 changed files with 104 additions and 6 deletions

View file

@ -576,6 +576,27 @@ class Application_Model_StoredFile {
{
return Application_Model_StoredFile::Recall(null, null, null, $p_filepath);
}
public static function RecallByPartialFilepath($partial_path){
$path_info = Application_Model_MusicDir::splitFilePath($partial_path);
if (is_null($path_info)) {
return null;
}
$music_dir = Application_Model_MusicDir::getDirByPath($path_info[0]);
$files = CcFilesQuery::create()
->filterByDbDirectory($music_dir->getId())
->filterByDbFilepath("$path_info[1]%")
->find();
$res = array();
foreach ($files as $file){
$storedFile = new Application_Model_StoredFile();
$storedFile->_file = $file;
$res[] = $storedFile;
}
return $res;
}
public static function searchFilesForPlaylistBuilder($datatables) {
global $CC_CONFIG;