Skip to content

Commit

Permalink
added Electronic and Loud subcategories for General
Browse files Browse the repository at this point in the history
  • Loading branch information
RocketMan committed Oct 19, 2023
1 parent 0a2778a commit 89bab57
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion controllers/PrintTags.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) . "...";
Expand All @@ -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
];
Expand Down Expand Up @@ -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)));
Expand Down
2 changes: 2 additions & 0 deletions engine/ILibrary.php
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 89bab57

Please sign in to comment.