From 5b57cd310e08b00c7bfc3821a3c2d6d8b48405b5 Mon Sep 17 00:00:00 2001 From: Cloud Dumper Date: Fri, 6 Jan 2012 11:29:15 +0100 Subject: [PATCH] Also use track_number to retrieve song track. This adds support for id3v2 tags such as TRACK/TOTAL. --- apps/media/lib_scanner.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/media/lib_scanner.php b/apps/media/lib_scanner.php index c2bea2d836d..320b1f79199 100644 --- a/apps/media/lib_scanner.php +++ b/apps/media/lib_scanner.php @@ -120,7 +120,20 @@ class OC_MEDIA_SCANNER{ $title=stripslashes($data['comments']['title'][0]); } $size=$data['filesize']; - $track=(isset($data['comments']['track']))?$data['comments']['track'][0]:0; + if (isset($data['comments']['track'])) + { + $track = $data['comments']['track'][0]; + } + else if (isset($data['comments']['track_number'])) + { + $track = $data['comments']['track_number'][0]; + $track = explode('/',$track); + $track = $track[0]; + } + else + { + $track = 0; + } $length=isset($data['playtime_seconds'])?round($data['playtime_seconds']):0; } if(!isset(self::$artists[$artist])){ -- 2.39.5