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
@ -87,10 +87,16 @@ class BulkAdd extends Extension {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$pathinfo = pathinfo($fullpath);
|
$pathinfo = pathinfo($fullpath);
|
||||||
$tags = $subdir;
|
$matches = array();
|
||||||
$tags = str_replace("/", " ", $tags);
|
if(preg_match("/\d+ - (.*)\.([a-zA-Z]+)/", $pathinfo["basename"], $matches)) {
|
||||||
$tags = str_replace("__", " ", $tags);
|
$tags = $matches[1];
|
||||||
$tags = trim($tags);
|
}
|
||||||
|
else {
|
||||||
|
$tags = $subdir;
|
||||||
|
$tags = str_replace("/", " ", $tags);
|
||||||
|
$tags = str_replace("__", " ", $tags);
|
||||||
|
$tags = trim($tags);
|
||||||
|
}
|
||||||
$list .= "<br>".html_escape("$shortpath (".str_replace(" ", ", ", $tags).")... ");
|
$list .= "<br>".html_escape("$shortpath (".str_replace(" ", ", ", $tags).")... ");
|
||||||
try{
|
try{
|
||||||
$this->add_image($fullpath, $pathinfo["basename"], $tags);
|
$this->add_image($fullpath, $pathinfo["basename"], $tags);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user