From 89bab572f8b663492b7382d766f4528d2b655003 Mon Sep 17 00:00:00 2001 From: Jim Mason Date: Thu, 19 Oct 2023 11:05:31 +0100 Subject: [PATCH] added Electronic and Loud subcategories for General --- controllers/PrintTags.php | 6 +++++- engine/ILibrary.php | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/controllers/PrintTags.php b/controllers/PrintTags.php index fc4ed118..dfcf9eae 100644 --- a/controllers/PrintTags.php +++ b/controllers/PrintTags.php @@ -77,7 +77,8 @@ protected function loadTags($tags) { $artist = mb_substr($artist, 0, 30); $title = $album["album"]; - $category = "(" . ILibrary::GENRES[$album["category"]] . ")"; + $cat = explode(" - ", ILibrary::GENRES[$album["category"]]); + $category = "(" . $cat[0] . ")"; $maxAlbumLen = 33 - mb_strlen($category); if(mb_strlen($title) > $maxAlbumLen + 3) $title = mb_substr($title, 0, $maxAlbumLen) . "..."; @@ -99,6 +100,7 @@ protected function loadTags($tags) { 'artist' => "\n\n\n" . $artist, 'title' => "\n\n\n\n " . $title, 'category' => "\n\n\n\n" . $category, + 'subcat' => count($cat) > 1 ? "\n\n\n\n\n" . strtoupper($cat[1]) : false, 'date' => date_format(date_create($album['created']), " m-Y"), 'special' => $greek ]; @@ -145,6 +147,8 @@ public function processRequest() { $pdf->currentLabel($album['category'], 'R'); $pdf->SetFontSize(self::FONT_SIZE_DATE); $pdf->verticalText($album['date'], $inst ? -15 : -1, 0); + if($album['subcat']) + $pdf->currentLabel($album['subcat'], 'R'); // insert half-space separator every three digits $tagNum = strrev(implode(" ", str_split(strrev($tag), 3))); diff --git a/engine/ILibrary.php b/engine/ILibrary.php index fd4319b5..4f4cf215 100644 --- a/engine/ILibrary.php +++ b/engine/ILibrary.php @@ -32,6 +32,8 @@ interface ILibrary { "B"=>"Blues", "C"=>"Country", "G"=>"General", + "1"=>"General - Electronic", + "2"=>"General - Loud", "H"=>"Hip-hop", "J"=>"Jazz", "K"=>"Childrens",