98_Medialist.pm: bugfixing "round" problem

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@20005 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Tobias.Faust 2019-08-16 09:46:20 +00:00
parent d4a3214b36
commit fbc65e8f96

View File

@ -22,7 +22,7 @@
##############################################
#
##############################################
## install package libmp3-tag-perl, libjson-xs-perl, libmp3-info-perl, libmath-round-perl
## install package libmp3-tag-perl, libjson-xs-perl, libmp3-info-perl
##
## images/cd-empty.png
##############################################
@ -43,7 +43,6 @@ use IO::File;
use Fcntl;
use File::Basename;
use File::Copy;
use Math::Round ();
require 'Blocking.pm';
require 'HttpUtils.pm';
use vars qw($readingFnAttributes);
@ -576,13 +575,14 @@ sub MediaList_GetMP3Tags($$) {
if ($mp3 = MP3::Tag->new($file)) {
my ($title, $track, $artist, $album, $comment, $year, $genre) = $mp3->autoinfo();
my $mp3info = get_mp3info($file);
my $duration = round($mp3info->{SECS}, 0);
utf8::encode($title);
utf8::encode($artist);
utf8::encode($album);
utf8::encode($comment);
$res = {"Artist" => $artist, "Title" => $title, "Album" => $album, "Time" => math::round($mp3info->{SECS}), "File" => $file, "Cover" => ""};
$res = {"Artist" => $artist, "Title" => $title, "Album" => $album, "Time" => $duration, "File" => $file, "Cover" => ""};
Log3 $hash, 5, "GetMP3Tags: ".Dumper($res);
return $res;
@ -858,7 +858,6 @@ sub MediaList_Crawl($$) {
<li>libjson-xs-perl</li>
<li>libmp3-info-perl</li>
<li>libmath-round-perl</li>
</ul>
<br>
<br>