diff options
author | Cloud Dumper <clouddumper@gmail.com> | 2012-01-06 11:29:15 +0100 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2012-01-08 00:30:57 +0100 |
commit | 5b57cd310e08b00c7bfc3821a3c2d6d8b48405b5 (patch) | |
tree | f4b8d14e950a438a3d2b8b5e93eb531cf21eeae3 /apps/media/lib_scanner.php | |
parent | 6b95d7427a7d29dd60bc8f464a04b2a004de9eaf (diff) | |
download | nextcloud-server-5b57cd310e08b00c7bfc3821a3c2d6d8b48405b5.tar.gz nextcloud-server-5b57cd310e08b00c7bfc3821a3c2d6d8b48405b5.zip |
Also use track_number to retrieve song track.
This adds support for id3v2 tags such as TRACK/TOTAL.
Diffstat (limited to 'apps/media/lib_scanner.php')
-rw-r--r-- | apps/media/lib_scanner.php | 15 |
1 files changed, 14 insertions, 1 deletions
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])){ |