]> source.dussan.org Git - nextcloud-server.git/commitdiff
Also use track_number to retrieve song track.
authorCloud Dumper <clouddumper@gmail.com>
Fri, 6 Jan 2012 10:29:15 +0000 (11:29 +0100)
committerRobin Appelman <icewind1991@gmail.com>
Sat, 7 Jan 2012 23:30:57 +0000 (00:30 +0100)
This adds support for id3v2 tags such as TRACK/TOTAL.

apps/media/lib_scanner.php

index c2bea2d836d95f5e0b85fe205be4611473ccf23d..320b1f79199aefc06a814d1d7d915ee77c5d5443 100644 (file)
@@ -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])){