gnome-prototypes-team / gnome-music

Gnome Music
https://live.gnome.org/Music
Other
5 stars 13 forks source link

artists view: don't get grilo's author key if artist is stored in artist key #108

Closed vrutkovs closed 11 years ago

vrutkovs commented 11 years ago
File: ./gnomemusic/view.py
Function: _add_item at line 487
Total time: 0.009724 s

Line #      Hits         Time  Per Hit   % Time  Line Contents
==============================================================
   487                                               @profile
   488                                               def _add_item(self, source, param, item):
   489        50          369      7.4      3.8          self._offset += 1
   490        50           94      1.9      1.0          if item is None:
   491                                                       return
   492        50           43      0.9      0.4          artist = "Unknown"
   493        50         1240     24.8     12.8          if item.get_author():
   494        50          459      9.2      4.7              artist = item.get_author()
   495        50         1712     34.2     17.6          if item.get_string(Grl.METADATA_KEY_ARTIST):
   496        50          845     16.9      8.7              artist = item.get_string(Grl.METADATA_KEY_ARTIST)
   497        50          180      3.6      1.9          if not artist.lower() in self._artists:
   498        19         1142     60.1     11.7              itr = self._model.append()
   499        19           73      3.8      0.8              self._artists[artist.lower()] = {"iter": itr, "albums": []}
   500        19         3396    178.7     34.9              self._model.set(itr, 2, artist)
   501                                           
   502        50          171      3.4      1.8          self._artists[artist.lower()]["albums"].append(item)
kyoushuu commented 11 years ago

We should use get_artist instead of get_author. This is where Tracker stores the artist, and if we use author instead, the media art hashes won't match.

kyoushuu commented 11 years ago

Sorry, misunderstood the problem. Changing the title to clarify things. Still, we must prioritize get_artist().