Merge lp:~mhr3/unity-lens-video/fix-1058097 into lp:unity-lens-video/remote-videos-scope-trunk

Proposed by Michal Hruby
Status: Merged
Merge reported by: Michal Hruby
Merged at revision: not available
Proposed branch: lp:~mhr3/unity-lens-video/fix-1058097
Merge into: lp:unity-lens-video/remote-videos-scope-trunk
Diff against target: 43 lines (+9/-7)
1 file modified
src/unity-scope-video-remote (+9/-7)
To merge this branch: bzr merge lp:~mhr3/unity-lens-video/fix-1058097
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Paweł Stołowski (community) Approve
David Callé Approve
Review via email: mp+126956@code.launchpad.net

This proposal supersedes a proposal from 2012-09-28.

Commit message

Refresh online results periodically, not on every view switch

Description of the change

The online videos category in dash flickers every time user switches from a different lens to video lens. This is caused by unnecessary refresh of the results, which causes their removal and re-adding.

To post a comment you must log in.
Revision history for this message
David Callé (davidc3) wrote :

Works fine for me, but I think you a word in the comment.

review: Approve
Revision history for this message
Paweł Stołowski (stolowski) wrote :

The change indeed improves results for online videos. +1

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Francis Ginther (fginther) wrote :

The automerge job was migrated to an updated system. It found this outstanding MP, but failed due to a configuration issue on the automerge host. Closer inspection reveals that this MP has already been merged to trunk and is no longer valid.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/unity-scope-video-remote'
2--- src/unity-scope-video-remote 2012-09-26 13:12:05 +0000
3+++ src/unity-scope-video-remote 2012-09-28 13:07:25 +0000
4@@ -82,12 +82,12 @@
5 self.scope = Unity.Scope.new("/net/launchpad/scope/remotevideos")
6 self.scope.search_in_global = False
7 self.scope.connect("search-changed", self.on_search_changed)
8- self.scope.connect("notify::active", self.on_lens_active)
9 self.scope.connect("filters-changed", self.on_filtering_or_preference_changed)
10 self.scope.props.sources.connect("notify::filtering",
11 self.on_filtering_or_preference_changed)
12- self.scope.connect ("activate-uri", self.on_activate_uri)
13- self.scope.connect('preview-uri', self.on_preview_uri)
14+ self.scope.connect("activate-uri", self.on_activate_uri)
15+ self.scope.connect("preview-uri", self.on_preview_uri)
16+ self.scope.connect("generate-search-key", lambda scope, search: search.props.search_string.strip())
17 self.session = Soup.SessionAsync()
18 self.session.props.user_agent = "Unity Video Lens Remote Scope v0.4"
19 self.session.add_feature_by_type(SoupGNOME.ProxyResolverGNOME)
20@@ -96,6 +96,8 @@
21 self.preferences = Unity.PreferencesManager.get_default()
22 self.preferences.connect("notify::remote-content-search", self.on_filtering_or_preference_changed)
23 self.scope.export()
24+ # refresh the at least once every 30 minutes
25+ GLib.timeout_add_seconds(REFRESH_INTERVAL/2, self.refresh_online_videos)
26
27 def update_recommendations(self):
28 """Query the server for 'recommendations'.
29@@ -153,10 +155,10 @@
30 """Run another search when a filter or preference change is notified."""
31 self.scope.queue_search_changed(Unity.SearchType.DEFAULT)
32
33- def on_lens_active(self, *_):
34- """ Run a search when the lens is opened """
35- if self.scope.props.active:
36- self.scope.queue_search_changed(Unity.SearchType.DEFAULT)
37+ def refresh_online_videos(self, *_):
38+ """ Periodically refresh the results """
39+ self.scope.queue_search_changed(Unity.SearchType.DEFAULT)
40+ return True
41
42 def source_activated(self, source):
43 """Return the state of a sources filter option."""

Subscribers

People subscribed via source and target branches

to all changes: