diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-06-22 00:54:20 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-06-22 00:54:20 +0000 |
commit | bba84d172a89e5621c29f2e4359d87bb09f346ff (patch) | |
tree | 83b9f02bbcb15d7df0bd3b9b40b800fa8b4984b3 /modules/id3 | |
parent | 0f5c3ddf3aa9e75289af56536806c220fec5d776 (diff) | |
download | ampache-bba84d172a89e5621c29f2e4359d87bb09f346ff.tar.gz ampache-bba84d172a89e5621c29f2e4359d87bb09f346ff.tar.bz2 ampache-bba84d172a89e5621c29f2e4359d87bb09f346ff.zip |
last commit before beta3 release
Diffstat (limited to 'modules/id3')
-rwxr-xr-x | modules/id3/vainfo.class.php | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/modules/id3/vainfo.class.php b/modules/id3/vainfo.class.php index 94366c20..81b96446 100755 --- a/modules/id3/vainfo.class.php +++ b/modules/id3/vainfo.class.php @@ -383,16 +383,28 @@ class vainfo { */ function _parse_filename($filename) { - /* Currently Broken */ - return array(); + $results = array(); $pattern = $this->_dir_pattern . $this->_file_pattern; preg_match_all("/\%\w/",$pattern,$elements); - - $preg_pattern = preg_replace("/\%\w/","(.+)",$pattern); - $preg_pattern .= "\..+$"; + + $preg_pattern = preg_quote($pattern); + $preg_pattern = preg_replace("/\%\w/","(.+)",$preg_pattern); + $preg_pattern = str_replace("/","\/",$preg_pattern); + $preg_pattern = "/" . $preg_pattern . "\..+$/"; preg_match($preg_pattern,$filename,$matches); + /* Cut out the Full line, we don't need that */ + array_shift($matches); + /* Foreach through what we've found */ + foreach ($matches as $key=>$value) { + $new_key = translate_pattern_code($elements['0'][$key]); + if ($new_key) { + $results[$new_key] = $value; + } + } // end foreach matches + + return $results; } // _parse_filename |