pull a bunch of small fixes from #659

This commit is contained in:
Shish
2019-06-14 13:16:58 +01:00
parent 5765978afd
commit f078b283bd
13 changed files with 61 additions and 61 deletions

View File

@ -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;
}