Merge lp:~rainct/zeitgeist/least-popular-959615 into lp:~zeitgeist/zeitgeist/bluebird

Proposed by Siegfried Gevatter on 2012-04-10
Status: Needs review
Proposed branch: lp:~rainct/zeitgeist/least-popular-959615
Merge into: lp:~zeitgeist/zeitgeist/bluebird
Diff against target: 76 lines (+10/-11)
2 files modified
src/datamodel.vala (+7/-8)
test/dbus/engine-test.py (+3/-3)
To merge this branch: bzr merge lp:~rainct/zeitgeist/least-popular-959615
Reviewer Review Type Date Requested Status
Zeitgeist Framework Team 2012-04-10 Pending
Review via email: mp+101406@code.launchpad.net

This proposal supersedes a proposal from 2012-03-29.

To post a comment you must log in.

Unmerged revisions

458. By Siegfried Gevatter on 2012-03-29

Fix sorting of LEAST_POPULAR_* result types (LP: #959615)

They should query for least popular X but return the most
(not least) recent event for it.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/datamodel.vala'
--- src/datamodel.vala 2012-03-27 14:30:23 +0000
+++ src/datamodel.vala 2012-04-10 16:04:18 +0000
@@ -243,40 +243,39 @@
243 {243 {
244 switch (result_type)244 switch (result_type)
245 {245 {
246 // FIXME: Why are LEAST_POPULAR_* using ASC?
247 case ResultType.LEAST_RECENT_EVENTS:246 case ResultType.LEAST_RECENT_EVENTS:
248 case ResultType.LEAST_RECENT_EVENT_ORIGIN:247 case ResultType.LEAST_RECENT_EVENT_ORIGIN:
249 case ResultType.LEAST_POPULAR_EVENT_ORIGIN:
250 case ResultType.LEAST_RECENT_SUBJECTS:248 case ResultType.LEAST_RECENT_SUBJECTS:
251 case ResultType.LEAST_POPULAR_SUBJECTS:
252 case ResultType.LEAST_RECENT_CURRENT_URI:249 case ResultType.LEAST_RECENT_CURRENT_URI:
253 case ResultType.LEAST_POPULAR_CURRENT_URI:
254 case ResultType.LEAST_RECENT_ACTOR:250 case ResultType.LEAST_RECENT_ACTOR:
255 case ResultType.LEAST_POPULAR_ACTOR:
256 case ResultType.OLDEST_ACTOR:251 case ResultType.OLDEST_ACTOR:
257 case ResultType.LEAST_RECENT_ORIGIN:252 case ResultType.LEAST_RECENT_ORIGIN:
258 case ResultType.LEAST_POPULAR_ORIGIN:
259 case ResultType.LEAST_RECENT_SUBJECT_INTERPRETATION:253 case ResultType.LEAST_RECENT_SUBJECT_INTERPRETATION:
260 case ResultType.LEAST_POPULAR_SUBJECT_INTERPRETATION:
261 case ResultType.LEAST_RECENT_MIMETYPE:254 case ResultType.LEAST_RECENT_MIMETYPE:
262 case ResultType.LEAST_POPULAR_MIMETYPE:
263 return true;255 return true;
264256
265 case ResultType.MOST_RECENT_EVENTS:257 case ResultType.MOST_RECENT_EVENTS:
266 case ResultType.MOST_RECENT_EVENT_ORIGIN:258 case ResultType.MOST_RECENT_EVENT_ORIGIN:
267 case ResultType.MOST_POPULAR_EVENT_ORIGIN:259 case ResultType.MOST_POPULAR_EVENT_ORIGIN:
260 case ResultType.LEAST_POPULAR_EVENT_ORIGIN:
268 case ResultType.MOST_RECENT_SUBJECTS:261 case ResultType.MOST_RECENT_SUBJECTS:
269 case ResultType.MOST_POPULAR_SUBJECTS:262 case ResultType.MOST_POPULAR_SUBJECTS:
263 case ResultType.LEAST_POPULAR_SUBJECTS:
270 case ResultType.MOST_RECENT_CURRENT_URI:264 case ResultType.MOST_RECENT_CURRENT_URI:
271 case ResultType.MOST_POPULAR_CURRENT_URI:265 case ResultType.MOST_POPULAR_CURRENT_URI:
266 case ResultType.LEAST_POPULAR_CURRENT_URI:
272 case ResultType.MOST_RECENT_ACTOR:267 case ResultType.MOST_RECENT_ACTOR:
273 case ResultType.MOST_POPULAR_ACTOR:268 case ResultType.MOST_POPULAR_ACTOR:
269 case ResultType.LEAST_POPULAR_ACTOR:
274 case ResultType.MOST_RECENT_ORIGIN:270 case ResultType.MOST_RECENT_ORIGIN:
275 case ResultType.MOST_POPULAR_ORIGIN:271 case ResultType.MOST_POPULAR_ORIGIN:
272 case ResultType.LEAST_POPULAR_ORIGIN:
276 case ResultType.MOST_RECENT_SUBJECT_INTERPRETATION:273 case ResultType.MOST_RECENT_SUBJECT_INTERPRETATION:
277 case ResultType.MOST_POPULAR_SUBJECT_INTERPRETATION:274 case ResultType.MOST_POPULAR_SUBJECT_INTERPRETATION:
275 case ResultType.LEAST_POPULAR_SUBJECT_INTERPRETATION:
278 case ResultType.MOST_RECENT_MIMETYPE:276 case ResultType.MOST_RECENT_MIMETYPE:
279 case ResultType.MOST_POPULAR_MIMETYPE:277 case ResultType.MOST_POPULAR_MIMETYPE:
278 case ResultType.LEAST_POPULAR_MIMETYPE:
280 return false;279 return false;
281280
282 default:281 default:
283282
=== modified file 'src/db-reader.vala'
=== modified file 'test/dbus/engine-test.py'
--- test/dbus/engine-test.py 2012-03-16 17:08:43 +0000
+++ test/dbus/engine-test.py 2012-04-10 16:04:18 +0000
@@ -829,7 +829,7 @@
829 events = self.getEventsAndWait(ids)829 events = self.getEventsAndWait(ids)
830 830
831 self.assertEquals([e.timestamp for e in events],831 self.assertEquals([e.timestamp for e in events],
832 ["123", "153", "163", "143"])832 ["163", "153", "123", "143"])
833 833
834 def testResultTypesMostRecentCurrentUri(self):834 def testResultTypesMostRecentCurrentUri(self):
835 import_events("test/data/five_events.js", self)835 import_events("test/data/five_events.js", self)
@@ -988,8 +988,8 @@
988 events = self.getEventsAndWait(ids)988 events = self.getEventsAndWait(ids)
989 989
990 self.assertEquals([e[0][5] for e in events],990 self.assertEquals([e[0][5] for e in events],
991 ["origin2", "origin3", "origin1"])991 ["origin3", "origin2", "origin1"])
992 self.assertEquals([e.timestamp for e in events], ["100", "103", "102"])992 self.assertEquals([e.timestamp for e in events], ["103", "100", "102"])
993993
994 def testResultTypesMostRecentEventOrigin(self):994 def testResultTypesMostRecentEventOrigin(self):
995 import_events("test/data/twenty_events.js", self)995 import_events("test/data/twenty_events.js", self)

Subscribers

People subscribed via source and target branches