Add playlist functions
This commit is contained in:
@@ -107,11 +107,12 @@ sub parse_duration {
|
||||
my ($duration) = @_;
|
||||
return $duration unless defined $duration;
|
||||
|
||||
my @mapped_increments = ( [ 1, 60, 3600 ], reverse split /:/, $duration );
|
||||
my $seconds = 0;
|
||||
my @times = reverse split /:/, $duration;
|
||||
my @multipliers = ( 1, 60, 3600 );
|
||||
my $seconds = 0;
|
||||
|
||||
while ( my ( $multiplier, $time ) = splice( @mapped_increments, 0, 2 ) ) {
|
||||
$seconds += $multiplier * $time;
|
||||
for ( my $i = 0 ; $i < @times ; $i++ ) {
|
||||
$seconds += $multipliers[$i] * $times[$i] if defined $times[$i];
|
||||
}
|
||||
|
||||
return $seconds;
|
||||
@@ -128,13 +129,13 @@ sub parse_id_name {
|
||||
}
|
||||
|
||||
our @EXPORT = qw(
|
||||
parse_menu_playlists
|
||||
get_item_text
|
||||
get_flex_column_item
|
||||
get_fixed_column_item
|
||||
get_dot_separator_index
|
||||
parse_duration
|
||||
parse_id_name
|
||||
parse_menu_playlists
|
||||
get_item_text
|
||||
get_flex_column_item
|
||||
get_fixed_column_item
|
||||
get_dot_separator_index
|
||||
parse_duration
|
||||
parse_id_name
|
||||
);
|
||||
|
||||
1;
|
||||
|
||||
Reference in New Issue
Block a user