mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-01 20:20:10 +00:00
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:
parent
d4a3214b36
commit
fbc65e8f96
@ -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
|
## images/cd-empty.png
|
||||||
##############################################
|
##############################################
|
||||||
@ -43,7 +43,6 @@ use IO::File;
|
|||||||
use Fcntl;
|
use Fcntl;
|
||||||
use File::Basename;
|
use File::Basename;
|
||||||
use File::Copy;
|
use File::Copy;
|
||||||
use Math::Round ();
|
|
||||||
require 'Blocking.pm';
|
require 'Blocking.pm';
|
||||||
require 'HttpUtils.pm';
|
require 'HttpUtils.pm';
|
||||||
use vars qw($readingFnAttributes);
|
use vars qw($readingFnAttributes);
|
||||||
@ -576,13 +575,14 @@ sub MediaList_GetMP3Tags($$) {
|
|||||||
if ($mp3 = MP3::Tag->new($file)) {
|
if ($mp3 = MP3::Tag->new($file)) {
|
||||||
my ($title, $track, $artist, $album, $comment, $year, $genre) = $mp3->autoinfo();
|
my ($title, $track, $artist, $album, $comment, $year, $genre) = $mp3->autoinfo();
|
||||||
my $mp3info = get_mp3info($file);
|
my $mp3info = get_mp3info($file);
|
||||||
|
my $duration = round($mp3info->{SECS}, 0);
|
||||||
|
|
||||||
utf8::encode($title);
|
utf8::encode($title);
|
||||||
utf8::encode($artist);
|
utf8::encode($artist);
|
||||||
utf8::encode($album);
|
utf8::encode($album);
|
||||||
utf8::encode($comment);
|
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);
|
Log3 $hash, 5, "GetMP3Tags: ".Dumper($res);
|
||||||
|
|
||||||
return $res;
|
return $res;
|
||||||
@ -858,7 +858,6 @@ sub MediaList_Crawl($$) {
|
|||||||
|
|
||||||
<li>libjson-xs-perl</li>
|
<li>libjson-xs-perl</li>
|
||||||
<li>libmp3-info-perl</li>
|
<li>libmp3-info-perl</li>
|
||||||
<li>libmath-round-perl</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user