From 3ca32a324b4185c67b29238249493ea5ea1523a5 Mon Sep 17 00:00:00 2001 From: Till Korten Date: Sun, 4 Jun 2017 16:40:33 +0200 Subject: [PATCH] fixed issue with albums without conver not able to create pdf --- src/TTMp32Gme/PrintHandler.pm | 10 ++++++++++ src/templates/printing_contents.html | 3 +-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/TTMp32Gme/PrintHandler.pm b/src/TTMp32Gme/PrintHandler.pm index 4b80150..146c51f 100644 --- a/src/TTMp32Gme/PrintHandler.pm +++ b/src/TTMp32Gme/PrintHandler.pm @@ -86,6 +86,15 @@ sub format_main_oid { "oid: $oid"; } +sub format_cover { + my ( $album ) = @_; + if ( $album->{'picture_filename'} ) { + return 'cover'; + } else { + return ''; + } +} + ## external functions: sub create_print_layout { @@ -108,6 +117,7 @@ sub create_print_layout { $album->{'play_controls'} = $controls; $album->{'main_oid_image'} = format_main_oid( $oid, $oid_map, $httpd, $dbh ); + $album->{'formatted_cover'} = format_cover($album); $content .= $template->fill_in( HASH => $album ); } } diff --git a/src/templates/printing_contents.html b/src/templates/printing_contents.html index b4d3260..3bdec09 100644 --- a/src/templates/printing_contents.html +++ b/src/templates/printing_contents.html @@ -6,8 +6,7 @@

{ $album_title }

- cover + {$formatted_cover}
{ $main_oid_image }