From 2ebcc8fdaa0e1c63f991e352e9d04b409f9577be Mon Sep 17 00:00:00 2001 From: cvbasta75 <71543701+cvbasta75@users.noreply.github.com> Date: Sun, 12 Sep 2021 20:33:38 +0200 Subject: [PATCH] Update epg_json2xml.pl --- tkm/epg_json2xml.pl | 100 ++++++++++++++++++++++---------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/tkm/epg_json2xml.pl b/tkm/epg_json2xml.pl index f1dba4e..9aeae2d 100755 --- a/tkm/epg_json2xml.pl +++ b/tkm/epg_json2xml.pl @@ -194,51 +194,6 @@ print STDERR "[ EPG WARNING ] Channel ID unknown: " . $cid . "\n"; } - # IMAGE (condition) (loop) - if( exists $item->{'pictures'} ) { - my @image = @{ $item->{'pictures'} }; - - if ( @image ) { - while( my( $image_id, $image ) = each( @image ) ) { # SEARCH FOR IMAGE WITH THE HIGHEST RESOLUTION - my @res = @{ $image->{'resolution'} }; - my $img = $image->{'href'}; - foreach my $res ( @res ) { - if( $res eq '1920' ) { # FULL HD 16:9 - $img_loc = $image_id; - last; - } elsif( $res eq '1440' ) { # FULL HD 4:3 - $img_loc = $image_id; - last; - } elsif( $res eq '1280' ) { # HD 16:9 - $img_loc = $image_id; - last; - } elsif( $res eq '1280' ) { # HD 16:9 - $img_loc = $image_id; - last; - } elsif( $res eq '960' ) { # SD 16:9 - $img_loc = $image_id; - last; - } elsif( $res eq '720' ) { # SD 4:3 - $img_loc = $image_id; - last; - } elsif( $res eq '480' ) { # LOW SD 16:9 - $img_loc = $image_id; - last; - } elsif( $res eq '360' ) { # LOW SD 4:3 - $img_loc = $image_id; - last; - } elsif( $res eq '180' ) { # JUST... WHY?! - $img_loc = $image_id; - last; - } - } - } - if( defined $img_loc ) { - print " {'pictures'}[$img_loc]{'href'} . "\" />\n"; - } - } - } - # TITLE (language) $title =~ s/\&/\&/g; $title =~ s/<[^>]*>//g; @@ -316,11 +271,6 @@ print " $date\n"; } - # COUNTRY (condition) - if( defined $country ) { - print " " . uc($country) . "\n"; - } - # CATEGORIES (USE ONE CATEGORY ONLY) (condition) (language) (settings) if( $setup_category eq $disabled ) { if ( defined $genre1 ) { @@ -368,7 +318,57 @@ } } } + + # IMAGE (condition) (loop) + if( exists $item->{'pictures'} ) { + my @image = @{ $item->{'pictures'} }; + if ( @image ) { + while( my( $image_id, $image ) = each( @image ) ) { # SEARCH FOR IMAGE WITH THE HIGHEST RESOLUTION + my @res = @{ $image->{'resolution'} }; + my $img = $image->{'href'}; + foreach my $res ( @res ) { + if( $res eq '1920' ) { # FULL HD 16:9 + $img_loc = $image_id; + last; + } elsif( $res eq '1440' ) { # FULL HD 4:3 + $img_loc = $image_id; + last; + } elsif( $res eq '1280' ) { # HD 16:9 + $img_loc = $image_id; + last; + } elsif( $res eq '1280' ) { # HD 16:9 + $img_loc = $image_id; + last; + } elsif( $res eq '960' ) { # SD 16:9 + $img_loc = $image_id; + last; + } elsif( $res eq '720' ) { # SD 4:3 + $img_loc = $image_id; + last; + } elsif( $res eq '480' ) { # LOW SD 16:9 + $img_loc = $image_id; + last; + } elsif( $res eq '360' ) { # LOW SD 4:3 + $img_loc = $image_id; + last; + } elsif( $res eq '180' ) { # JUST... WHY?! + $img_loc = $image_id; + last; + } + } + } + if( defined $img_loc ) { + print " {'pictures'}[$img_loc]{'href'} . "\" />\n"; + } + } + } + + # COUNTRY (condition) + if( defined $country ) { + print " " . uc($country) . "\n"; + } + # SEASON/EPISODE (XMLTV_NS) (condition) (settings) if( $setup_episode eq $xmltv_ns ) { if( defined $series ) {