[gnome-music] In AlbumWidget.update, set the cover once
- From: Seif Lotfy <seiflotfy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music] In AlbumWidget.update, set the cover once
- Date: Sun, 9 Jun 2013 06:08:47 +0000 (UTC)
commit ab1b4efe5d01a1ec427ea88ca589351b8b7fbf9c
Author: Guillaume Quintard <guillaume quintard gmail com>
Date: Sat Jun 8 21:48:29 2013 +0200
In AlbumWidget.update, set the cover once
Previously, we set the symbolic icon for the cover, then fetched the
artwork, and this, for every song in the list.
Signed-off-by: Seif Lotfy <seif lotfy com>
src/widgets.js | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/src/widgets.js b/src/widgets.js
index 2b1e724..431a5fb 100644
--- a/src/widgets.js
+++ b/src/widgets.js
@@ -208,6 +208,16 @@ const AlbumWidget = new Lang.Class({
}
let duration = 0;
this.album = album;
+ this.ui.get_object("cover").set_from_pixbuf(this._symbolicIcon);
+ albumArtCache.lookup(256, artist, item.get_string(Grl.METADATA_KEY_ALBUM), Lang.bind(this,
+ function(pixbuf) {
+ if (pixbuf != null) {
+ this.ui.get_object("cover").set_from_pixbuf(pixbuf);
+ this.model.set(iter, [4], [pixbuf]);
+ }
+ }));
+
+
// if the active queue has been set by this album,
// use it as model, otherwise build the liststore
@@ -233,7 +243,6 @@ const AlbumWidget = new Lang.Class({
duration = duration + track.get_duration();
let iter = this.model.append();
let escapedTitle = GLib.markup_escape_text(track.get_title(), track.get_title().length);
- this.ui.get_object("cover").set_from_pixbuf(this._symbolicIcon);
try{
this.player.discoverer.discover_uri(track.get_url());
this.model.set(iter,
@@ -247,14 +256,6 @@ const AlbumWidget = new Lang.Class({
[ escapedTitle, "", "", "", this._symbolicIcon, track, true, errorIconName ]);
}
- albumArtCache.lookup(256, artist, item.get_string(Grl.METADATA_KEY_ALBUM),
Lang.bind(this,
- function(pixbuf) {
- if (pixbuf != null) {
- this.ui.get_object("cover").set_from_pixbuf(pixbuf);
- this.model.set(iter, [4], [pixbuf]);
- }
- }));
-
this.ui.get_object("running_length_label_info").set_text(
(parseInt(duration/60) + 1) + " min");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]