pull a bunch of small fixes from #659
This commit is contained in:
@ -281,20 +281,20 @@ function manual_include(string $fname): ?string
|
||||
function path_to_tags(string $path): string
|
||||
{
|
||||
$matches = [];
|
||||
$tags = "";
|
||||
if(preg_match("/\d+ - (.*)\.([a-zA-Z0-9]+)/", basename($path), $matches)) {
|
||||
$tags = "";
|
||||
if (preg_match("/\d+ - (.*)\.([a-zA-Z0-9]+)/", basename($path), $matches)) {
|
||||
$tags = $matches[1];
|
||||
}
|
||||
|
||||
$dir_tags = dirname($path);
|
||||
$dir_tags = str_replace("/", " ", $dir_tags);
|
||||
$dir_tags = str_replace("__", " ", $dir_tags);
|
||||
$dir_tags = trim($dir_tags);
|
||||
if ($dir_tags != "") {
|
||||
$tags = trim($tags)." ".trim($dir_tags);
|
||||
}
|
||||
$tags = trim ( $tags );
|
||||
|
||||
}
|
||||
|
||||
$dir_tags = dirname($path);
|
||||
$dir_tags = str_replace("/", " ", $dir_tags);
|
||||
$dir_tags = str_replace("__", " ", $dir_tags);
|
||||
$dir_tags = trim($dir_tags);
|
||||
if ($dir_tags != "") {
|
||||
$tags = trim($tags)." ".trim($dir_tags);
|
||||
}
|
||||
$tags = trim($tags);
|
||||
|
||||
return $tags;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user