[rygel] core: Turn AlbumArt lookup condition into requirement
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] core: Turn AlbumArt lookup condition into requirement
- Date: Mon, 19 Jul 2010 17:50:51 +0000 (UTC)
commit be831bcd3e7530a8eebc28153592addce165a07d
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Thu Jul 15 20:40:52 2010 +0300
core: Turn AlbumArt lookup condition into requirement
src/rygel/rygel-media-item.vala | 24 ++++++++++--------------
1 files changed, 10 insertions(+), 14 deletions(-)
---
diff --git a/src/rygel/rygel-media-item.vala b/src/rygel/rygel-media-item.vala
index e7ada12..9b8868e 100644
--- a/src/rygel/rygel-media-item.vala
+++ b/src/rygel/rygel-media-item.vala
@@ -153,24 +153,20 @@ public class Rygel.MediaItem : MediaObject {
}
public void lookup_album_art () {
- if (!this.upnp_class.has_prefix (MediaItem.AUDIO_CLASS)) {
+ assert (this.upnp_class.has_prefix (MediaItem.AUDIO_CLASS) &&
+ this.thumbnails.size == 0);
+
+ var media_art_store = MediaArtStore.get_default ();
+ if (media_art_store == null) {
return;
}
-
- if (!(this.thumbnails.size > 0 && this.thumbnails[0] is AlbumArt)) {
- var media_art_store = MediaArtStore.get_default ();
- if (media_art_store == null) {
- return;
+ try {
+ var thumb = media_art_store.find_media_art_any (this);
+ if (thumb != null) {
+ this.thumbnails.insert (0, thumb);
}
-
- try {
- var thumb = media_art_store.find_media_art_any (this);
- if (thumb != null) {
- this.thumbnails.insert (0, thumb);
- }
- } catch (Error err) {};
- }
+ } catch (Error err) {};
}
internal int compare_transcoders (void *a, void *b) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]