fix typo.
[vuplus_openvuplus_3.0] / meta-openvuplus / recipes-enigma2 / python / python-daap / python-daap.patch
1 --- python-daap-0.7.1/daap.py   2007-09-10 20:35:45.000000000 +0200
2 +++ python-daap-0.7.1/daap.py   2010-11-03 19:39:09.000000000 +0100
3 @@ -417,18 +417,21 @@
4          # this returns an HTTP response object
5          response    = self._get_response(r, params)
6          status = response.status
7 -        content = response.read()
8 -        # if we got gzipped data base, gunzip it.
9 -        if response.getheader("Content-Encoding") == "gzip":
10 -            log.debug("gunzipping data")
11 -            old_len = len(content)
12 -            compressedstream = StringIO( content )
13 -            gunzipper = gzip.GzipFile(fileobj=compressedstream)
14 -            content = gunzipper.read()
15 -            log.debug("expanded from %s bytes to %s bytes", old_len, len(content))
16 -        # close this, we're done with it
17 +       #Dr.Best --> fix 
18 +       if status == 200:
19 +               content = response.read()
20 +               # if we got gzipped data base, gunzip it.
21 +               if response.getheader("Content-Encoding") == "gzip":
22 +                   log.debug("gunzipping data")
23 +                   old_len = len(content)
24 +                   compressedstream = StringIO( content )
25 +                   gunzipper = gzip.GzipFile(fileobj=compressedstream)
26 +                   content = gunzipper.read()
27 +                   log.debug("expanded from %s bytes to %s bytes", old_len, len(content))
28 +       # close this, we're done with it
29          response.close()
30  
31 +
32          if status == 401:
33              raise DAAPError('DAAPClient: %s: auth required'%r)
34          elif status == 403:
35 @@ -511,7 +514,7 @@
36  # the atoms we want. Making this list smaller reduces memory footprint,
37  # and speeds up reading large libraries. It also reduces the metainformation
38  # available to the client.
39 -daap_atoms = "dmap.itemid,dmap.itemname,daap.songalbum,daap.songartist,daap.songformat,daap.songtime,daap.songsize,daap.songgenre,daap.songyear,daap.songtracknumber"
40 +daap_atoms = "dmap.itemid,dmap.itemname,daap.songalbum,daap.songartist,daap.songformat,daap.songtime,daap.songsize,daap.songgenre,daap.songyear,daap.songtracknumber,daap.songtrackcount,daap.songbitrate"
41  
42  class DAAPDatabase(object):
43  
44 @@ -560,7 +563,12 @@
45          'id':'miid',
46          'type':'asfm',
47          'time':'astm',
48 -        'size':'assz'}
49 +        'size':'assz',
50 +        'year':'asyr',
51 +        'genre':'asgn',
52 +       'tracknr': 'astn',
53 +       'trackcount': 'astc',
54 +       'bitrate': 'asbr'}
55  
56      def __init__(self, database, atom):
57          self.database = database