Merge lp:~osomon/moovida/player_feedback into lp:moovida

Proposed by Olivier Tilloy
Status: Superseded
Proposed branch: lp:~osomon/moovida/player_feedback
Merge into: lp:moovida
Diff against target: 208 lines (+58/-29)
3 files modified
elisa-plugins/elisa/plugins/poblesec/player_audio.py (+3/-0)
elisa-plugins/elisa/plugins/poblesec/player_video.py (+29/-27)
elisa-plugins/elisa/plugins/poblesec/widgets/player/status_display.py (+26/-2)
To merge this branch: bzr merge lp:~osomon/moovida/player_feedback
Reviewer Review Type Date Requested Status
Moovida Developers Pending
Review via email: mp+15282@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Olivier Tilloy (osomon) wrote :

This bundle fixes various bugs in the player OSD:

1) The OSD wasn't really cleared when necessary, despite various attempts to fix that (see https://bugs.launchpad.net/moovida/+bug/432269 among others). The issue was less easy to observe but it was there (hint: a slow network connection helps to reproduce the issue).

2) The default thumbnail for music was that of videos (https://bugs.launchpad.net/moovida/+bug/463733).

3) The posters for TV episodes were never shown in the OSD, despite the fact that we had their URIs in the DB (https://bugs.launchpad.net/moovida/+bug/485933).

With all that the OSD is hopefully less buggy and a tad more useful.

Thanks for the review!

Unmerged revisions

1607. By Olivier Tilloy

Removed an outdated FIXME.

1606. By Olivier Tilloy

Get, cache and display in the OSD the episode's poster URI if needed.

1605. By Olivier Tilloy

Do not re-load default preview artwork, it's already there.

1604. By Olivier Tilloy

Fix the default preview artwork for the audio player.

1603. By Olivier Tilloy

Clear the OSD when the player is stopped.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'elisa-plugins/elisa/plugins/poblesec/player_audio.py'
2--- elisa-plugins/elisa/plugins/poblesec/player_audio.py 2009-05-27 11:57:22 +0000
3+++ elisa-plugins/elisa/plugins/poblesec/player_audio.py 2009-11-26 16:45:27 +0000
4@@ -50,3 +50,6 @@
5 'will be used.',
6 }
7 default_config = player_default_config()
8+
9+ default_preview = 'elisa.plugins.poblesec.player.thumbnail.default_album'
10+
11
12=== modified file 'elisa-plugins/elisa/plugins/poblesec/player_video.py'
13--- elisa-plugins/elisa/plugins/poblesec/player_video.py 2009-11-23 09:55:40 +0000
14+++ elisa-plugins/elisa/plugins/poblesec/player_video.py 2009-11-26 16:45:27 +0000
15@@ -14,7 +14,8 @@
16 # See "LICENSE.Moovida" in the root directory of this distribution package
17 # for details on that license.
18
19-from elisa.core.utils import locale_helper
20+from elisa.core.utils import locale_helper, caching
21+
22 from elisa.plugins.poblesec.widgets.player.status_display import VideoStatusDisplay,\
23 BARS
24 from elisa.plugins.poblesec.widgets.player.control_ribbon import ControlRibbon
25@@ -425,6 +426,14 @@
26 """
27 return self.animated.opacity > 0
28
29+ def clear(self):
30+ """
31+ Clear the status widget.
32+ """
33+ self.status.clear()
34+ self.cover_overlay.cover.clear()
35+
36+
37 class Player(gobject.GObject, Loggable):
38
39 STOPPED = 0
40@@ -1062,6 +1071,8 @@
41 PlayerClass = Player
42 PlayerOsdClass = PlayerOsd
43
44+ default_preview = 'elisa.plugins.poblesec.player.thumbnail.default_movie'
45+
46 def __init__(self):
47 super(PlayerController, self).__init__()
48
49@@ -1189,21 +1200,14 @@
50 return True
51
52 def _on_current_model_changed(self, player, model):
53- default_video_icon = 'elisa.plugins.poblesec.player.thumbnail.default_movie'
54- default_music_album_icon = 'elisa.plugins.poblesec.player.thumbnail.default_album'
55-
56 self.info("Played model changed to %r", model)
57
58 # internal functions
59 def dfr_error(failure, source):
60 self.warning("failure in %s : %s" % (source, failure))
61
62- def got_artwork(file_path, default_resource=None):
63+ def got_artwork(file_path):
64 if not file_path:
65- # no artwork found
66- if default_resource:
67- self.frontend.load_from_theme(default_resource,
68- self.player_osd.status.preview)
69 return
70
71 self.player_osd.status.preview.set_from_file(file_path)
72@@ -1216,21 +1220,11 @@
73
74 osd_details = self.player_osd.status.status_display_details
75
76- # clear the OSD
77- osd_details.title.label = ""
78- osd_details.details.label = ""
79- osd_details.details_2.label = ""
80+ self.player_osd.clear()
81 self.background.clear()
82- self.player_osd.cover_overlay.cover.clear()
83
84- # FIXME: by default we display the video icon, this is fine in
85- # the case of video playable_models but not for audio
86- # playable_models. There's no way to make the difference
87- # between and audio-only and video playable model, the correct
88- # solution would be to fix all the plugins that directly give
89- # PlayableModel instances to the player and instead, create
90- # VideoModels or TrackModels.
91- self.frontend.load_from_theme(default_video_icon,
92+ # Load default preview
93+ self.frontend.load_from_theme(self.default_preview,
94 self.player_osd.status.preview)
95
96 # we want to update the layout for dynamic changes
97@@ -1242,7 +1236,7 @@
98 def got_artist(artist, album):
99 osd_details.details_2.label = artist
100 dfr = self.album_helper.get_image(album, None)
101- dfr.addCallback(got_artwork, default_music_album_icon)
102+ dfr.addCallback(got_artwork)
103 dfr.addErrback(dfr_error, "in got_artwork")
104 return dfr
105
106@@ -1267,22 +1261,29 @@
107 elif isinstance(model, VideoModel):
108 osd_details.title.label = model.title or ''
109 dfr = model.get_poster()
110- dfr.addCallback(got_artwork, default_video_icon)
111+ dfr.addCallback(got_artwork)
112 elif isinstance(model, Video):
113 # a model from database
114 osd_details.title.label = model.name
115- got_artwork(model.thumbnail_uri, default_video_icon)
116+ got_artwork(model.thumbnail_uri)
117 elif isinstance(model, Movie):
118 # a movie model from database
119 osd_details.title.label = model.title
120 poster = getattr(model, 'thumbnail_path', None)
121 if poster:
122- got_artwork(poster, default_video_icon)
123+ got_artwork(poster)
124 elif isinstance(model, TVEpisode):
125 # a TV Episode model from database
126 poster = getattr(model, 'thumbnail_path', None)
127 if poster:
128- got_artwork(poster, default_video_icon)
129+ got_artwork(poster)
130+ else:
131+ poster_uri = model.poster_uri
132+ if poster_uri:
133+ cache_path = caching.get_pictures_cache_path()
134+ dfr = caching.get_and_cache_to_file(MediaUri(poster_uri),
135+ cache_path)
136+ dfr.addCallback(got_artwork)
137
138 def got_tvshow(tvshow, season):
139 osd_details.details.label = tvshow.name
140@@ -1395,6 +1396,7 @@
141 (player_position / gst.SECOND)
142 self.show_on_screen_display()
143 elif status == player.STOPPED:
144+ self.player_osd.clear()
145 self.background.clear()
146 self.exit()
147 return True
148
149=== modified file 'elisa-plugins/elisa/plugins/poblesec/widgets/player/status_display.py'
150--- elisa-plugins/elisa/plugins/poblesec/widgets/player/status_display.py 2009-07-27 12:16:25 +0000
151+++ elisa-plugins/elisa/plugins/poblesec/widgets/player/status_display.py 2009-11-26 16:45:27 +0000
152@@ -74,6 +74,14 @@
153 self.left.width = 0.50
154 self.right.width = 0.50
155
156+ def clear(self):
157+ """
158+ Clear the position and duration labels.
159+ """
160+ self.left.label = ''
161+ self.right.label = ''
162+
163+
164 BARS = enum.Enum("SEEKING_BAR", "VOLUME_BAR", "BUFFERING_BAR")
165
166
167@@ -259,7 +267,7 @@
168
169 """
170 right part of the status widget
171- with the scroll bar, title, details and player status
172+ with the progress bar, title, details and player status
173 """
174
175 def create_widgets(self):
176@@ -300,6 +308,17 @@
177 self.pack_start(self.progress_bars)
178 self.progress_bars.visible = True
179
180+ def clear(self):
181+ """
182+ Clear the progress bar, the title and details labels.
183+ """
184+ self.title.label = ''
185+ self.details.label = ''
186+ self.details_2.label = ''
187+ self.progress_bars.seeking_bar.current_index = 0
188+ self.progress_bars.seeking_bar_label.clear()
189+ self.progress_bars.buffering_bar.stop_animation()
190+
191
192 class StatusDisplay(HBox):
193 """
194@@ -492,8 +511,13 @@
195
196 pbc.volume_bar_label.label = "%s %s%%" % (_('Volume'), int(volume_level))
197
198+ def clear(self):
199+ """
200+ Clear the preview image and the status details.
201+ """
202+ self.preview.clear()
203+ self.status_display_details.clear()
204
205-
206 @classmethod
207 def _demo_widget(cls, *args, **kwargs):
208 widget = cls()

Subscribers

People subscribed via source and target branches