From a6bd531aee5b68e04c81142d7334a3850205e7fe Mon Sep 17 00:00:00 2001 From: Bryan Schumaker Date: Sat, 30 Apr 2011 13:52:34 -0400 Subject: [PATCH] ocarina: Fetch image during load I also set absolute sizes for album art. Scaling to size 1 was causing scale_simple() to block forever. --- libsaria/callbacks.py | 1 - ocarina/body/footer/nowplaying.py | 5 +---- ocarina/body/footer/tiny.py | 5 +---- ocarina/callbacks.py | 1 + 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/libsaria/callbacks.py b/libsaria/callbacks.py index 24158c2d..08ad5fb3 100644 --- a/libsaria/callbacks.py +++ b/libsaria/callbacks.py @@ -16,7 +16,6 @@ def pause(): on_load = null_cb def load_file(file): on_load(file) - libsaria.path.lastfm.get_artwork(file) on_like = null_cb def like_song(like): diff --git a/ocarina/body/footer/nowplaying.py b/ocarina/body/footer/nowplaying.py index 3dd96426..15f63609 100644 --- a/ocarina/body/footer/nowplaying.py +++ b/ocarina/body/footer/nowplaying.py @@ -57,10 +57,7 @@ def resize_art(*args): sa_id = page.connect("size-allocate", resize_art) def set_art(path): - height = page.get_allocation().height - if height > 64: - height = 64 - ARTWORK.set_image(path, height) + ARTWORK.set_image(path, 64) def on_like(like): def _on_like1(like): diff --git a/ocarina/body/footer/tiny.py b/ocarina/body/footer/tiny.py index bad29f8e..c6042052 100644 --- a/ocarina/body/footer/tiny.py +++ b/ocarina/body/footer/tiny.py @@ -46,10 +46,7 @@ def resize_art(*args): sa_id = tiny.connect("size-allocate", resize_art) def set_art(path): - height = tiny.get_allocation().height - if height > 24: - height = 24 - ARTWORK.set_image(path, height) + ARTWORK.set_image(path, 24) def update_pos(pos): cur_pos.set_text(pos) diff --git a/ocarina/callbacks.py b/ocarina/callbacks.py index d5bee5d4..7d1d0551 100644 --- a/ocarina/callbacks.py +++ b/ocarina/callbacks.py @@ -22,6 +22,7 @@ def on_load(file): footer.on_load() queue.refresh() body.cur_page_goto() + libsaria.path.lastfm.get_artwork(file) callbacks.on_load = on_load def on_like(like):