summaryrefslogtreecommitdiff
path: root/audio/py-musique/patches/patch-aa
blob: e9517443bf01e145f81a5e6081f07cd3bc3fb685 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$NetBSD: patch-aa,v 1.1 2005/05/21 23:20:24 augustss Exp $
--- bin/pymusique.orig	2005-04-10 22:57:54.000000000 +0200
+++ bin/pymusique	2005-05-20 20:17:36.000000000 +0200
@@ -460,7 +460,13 @@
         if not os.path.isdir(self.config['songdir']):
             os.mkdir(self.config['songdir'])
         metadata = self.download['metaData']
-        filename = metadata['playlistArtistName'] + ' - ' + metadata['playlistName'] + ' - ' + metadata['songName']
+	trackNo = ''
+ 	if 'trackNumber' in metadata:
+            trackNo = metadata['trackNumber']
+	    if len(trackNo) < 2:
+		trackNo = '0' + trackNo
+	    trackNo = trackNo + ' - '
+        filename = metadata['playlistArtistName'] + ' - ' + metadata['playlistName'] + ' - ' + trackNo + metadata['songName']
         filename = os.path.join(self.config['songdir'], filename.replace('/', '-') + '.m4a')
         file(filename, 'wb').write(data)
         try: