bulk add uses tags from filename if filename is '123 - tag1 tag2 tag3.ext' folder name otherwise
This commit is contained in:
parent
e7df4edbee
commit
4b2cba4642
1 changed files with 10 additions and 4 deletions
|
@ -87,10 +87,16 @@ class BulkAdd extends Extension {
|
|||
}
|
||||
else {
|
||||
$pathinfo = pathinfo($fullpath);
|
||||
$tags = $subdir;
|
||||
$tags = str_replace("/", " ", $tags);
|
||||
$tags = str_replace("__", " ", $tags);
|
||||
$tags = trim($tags);
|
||||
$matches = array();
|
||||
if(preg_match("/\d+ - (.*)\.([a-zA-Z]+)/", $pathinfo["basename"], $matches)) {
|
||||
$tags = $matches[1];
|
||||
}
|
||||
else {
|
||||
$tags = $subdir;
|
||||
$tags = str_replace("/", " ", $tags);
|
||||
$tags = str_replace("__", " ", $tags);
|
||||
$tags = trim($tags);
|
||||
}
|
||||
$list .= "<br>".html_escape("$shortpath (".str_replace(" ", ", ", $tags).")... ");
|
||||
try{
|
||||
$this->add_image($fullpath, $pathinfo["basename"], $tags);
|
||||
|
|
Reference in a new issue