[gnome-music] Don't duplicate request artwork
- From: Vadim Rutkovsky <vrutkovsky src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music] Don't duplicate request artwork
- Date: Wed, 8 May 2013 18:26:34 +0000 (UTC)
commit e42e66f272b924532870fe58bf2d0355ee691318
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date: Wed May 8 20:26:09 2013 +0200
Don't duplicate request artwork
As we're stripping symbols from album and artist names we're spamming server with
multiple identical requests. The server stops accepting requests and the app hangs up.
Fixed bug 699768
src/albumArtCache.js | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/albumArtCache.js b/src/albumArtCache.js
index 51454be..eabd911 100644
--- a/src/albumArtCache.js
+++ b/src/albumArtCache.js
@@ -37,6 +37,7 @@ const AlbumArtCache = new Lang.Class({
this.parent();
this.logLookupErrors = false;
+ this.requested_uris = [];
this.cacheDir = GLib.build_filenamev([
GLib.get_user_cache_dir(),
"media-art"
@@ -104,6 +105,9 @@ const AlbumArtCache = new Lang.Class({
getFromUri: function(uri, artist, album, width, height, callback) {
if (uri == null) return;
+ if (this.requested_uris.indexOf(uri) > 0) return;
+
+ this.requested_uris.push(uri);
let key = this._keybuilder_funcs[0].call(this, artist, album),
path = GLib.build_filenamev([
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]