Skip to content

Commit

Permalink
Fixed main screen update
Browse files Browse the repository at this point in the history
  • Loading branch information
9and3r committed Nov 14, 2014
1 parent e62f710 commit 1b6046e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions mopidy_touchscreen/main_screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ def update(self, screen, update_all):
self.core.playback.time_position.get() / 1000)) + "/" +
time.strftime('%M:%S', time.gmtime(
self.track.length / 1000)))
if update_all:
if self.image_now_loaded:
if update_all:
if self.image is not None:
screen.blit(self.image, (self.base_size / 2, self.base_size + self.base_size / 2))
self.image_now_loaded = False
if self.image_now_loaded:
screen.blit(self.image, (self.base_size / 2, self.base_size + self.base_size / 2))
self.image_now_loaded = False
self.touch_text_manager.render(screen)
return screen

Expand Down Expand Up @@ -187,8 +189,9 @@ def download_image(self, artist_index):
self.touch_text_manager.set_object("artist_name", current)

def track_playback_ended(self, tl_track, time_position):

self.image = None
if self.image is not None:
self.dirty_area.append(self.image.get_rect())
self.image = None

# There is no cover so it will use all the screen size for the text
width = self.size[0] - self.base_size
Expand Down

0 comments on commit 1b6046e

Please sign in to comment.