Merge lp:~music-app-dev/music-app/basic-user-metrics into lp:music-app/trusty

Proposed by Daniel Holm
Status: Merged
Approved by: Victor Thompson
Approved revision: 239
Merged at revision: 233
Proposed branch: lp:~music-app-dev/music-app/basic-user-metrics
Merge into: lp:music-app/trusty
Diff against target: 72 lines (+16/-1)
3 files modified
.bzrignore (+2/-0)
debian/control (+1/-0)
music-app.qml (+13/-1)
To merge this branch: bzr merge lp:~music-app-dev/music-app/basic-user-metrics
Reviewer Review Type Date Requested Status
Victor Thompson Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Andrew Hayzen Needs Information
Review via email: mp+192624@code.launchpad.net

Commit message

Added basic user metrics functionality.

Description of the change

Added basic user metrics functionality.
Should later use the recently played database.

To post a comment you must log in.
231. By Daniel Holm

Forgot to add the function to when track is ended.

Revision history for this message
Daniel Holm (danielholm) wrote :

Why is the manifest and stuff always changed? How do I keep that from happening?

Revision history for this message
Daniel Holm (danielholm) wrote :

Also usermetrics has to be added to the manifest

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :

FAILED: Continuous integration, rev:231
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~danielholm/music-app/basic-user-metrics/+merge/192624/+edit-commit-message

http://91.189.93.70:8080/job/music-app-ci/280/
Executed test runs:
    UNSTABLE: http://91.189.93.70:8080/job/generic-mediumtests/1210
    FAILURE: http://91.189.93.70:8080/job/music-app-precise-amd64-ci/280/console
    FAILURE: http://91.189.93.70:8080/job/music-app-quantal-amd64-ci/280/console
    SUCCESS: http://91.189.93.70:8080/job/music-app-raring-amd64-ci/280
    SUCCESS: http://91.189.93.70:8080/job/music-app-saucy-amd64-ci/282
    SUCCESS: http://91.189.93.70:8080/job/music-app-trusty-amd64-ci/1

Click here to trigger a rebuild:
http://91.189.93.70:8080/job/music-app-ci/280/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Victor Thompson (vthompson) wrote :

Please fix to not add .excludes, not modify manifest.json, and not add a music-app.json. Also, how do metrics rollover from day to day? There aren't any changes here that would seem to create anything more than a running total of all tracks ever played.

review: Needs Fixing
Revision history for this message
Victor Thompson (vthompson) wrote :

I think the API takes care of data reset from day to day for us. Daniel, could you confirm?

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Why can you not query the database for anything within the last 24 hours, should be pretty simple to do?

I'll confirm tomorrow, when I get back to my machine, in the logs with Lisette whether songs or tracks was chosen.

review: Needs Information
Revision history for this message
Victor Thompson (vthompson) wrote :

I wrote the recent db table to support just that--querying for items in the last day. However, I think what we have now automatically does this as part of the API.

We might want to think of what data to display. Minutes of music listened to? Number of songs/tracks? Playlists? Albums? Items added to playlists?

Revision history for this message
Victor Thompson (vthompson) wrote :

I also think we need to add a call to updateMetrics() in the same places we call trackClicked() or inside trackClicked()--otherwise the first song played when added to the queue isn't counted.

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

But the number of tracks played 'today' is just stored in a variable. So what happens if you open the app, play some tracks, close the app and then open again and start playing other tracks.

From my understanding of the current code the counter for 'today' would be reset?

Whereas asking the database for how many have been played today would be a much more reliable solution. Except IIRC currently the recent table only stores info about playing tracks in an album or playlist? But this could easily be extended to a more generic solution if that is the case.

I talked to Lisette about what they wanted data they wanted to show, they liked the idea of showing the number of tracks played but I'll ask on Monday if they want/would like any other information.

Revision history for this message
Victor Thompson (vthompson) wrote :

It updates the Metric component of id tracksMetric. If I were to vote, I'd prefer we 1) change it to read "songs played today" and 2) make the number bold like the camera app does [1]:

format: "<b>%1</b> songs played today"

[1] http://bazaar.launchpad.net/~phablet-team/camera-app/trunk/view/head:/camera-app.qml

232. By Daniel Holm

Removed .execludes and music-app.json

233. By Daniel Holm

Restored manifest.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Victor Thompson (vthompson) wrote :

I strongly suggest we both make the metrics read "songs" for both the emptyFormat and format (to match the terminology we use elsewhere), as well as making the numerical value bold. I want these changes made before we merge.

Revision history for this message
Daniel Holm (danielholm) wrote :

I'm having an exam on friday so I'm kinda off. But I'll try to fix this just after I've handed in this report that's due today.

234. By Daniel Holm

Changed to songs played is handled incremently by API; added support for minutes as well.

235. By Daniel Holm

Changed back manifest file.

236. By Daniel Holm

Changed back manifest file.

237. By Daniel Holm

Changed back manifest file.

Revision history for this message
Daniel Holm (danielholm) wrote :

Done. Also added music played in minutes. Take a look - we dont have to keep that one.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Victor Thompson (vthompson) wrote :

I think your recent updates makes both the number of songs and the total minutes of music not work. I don't know if it's because both Metrics have the same name? I say we remove the total minutes of music out for the time being--unless you can figure out the issue. Also, "Haven't listening to any music today" should read "Haven't listened to any music today" (preferably something like "No time spent listening to music").

I think we need to have the number of songs played increment when a song starts playing when added to the queue. But I guess we could wait on that since you're busy.

Revision history for this message
Victor Thompson (vthompson) wrote :

Daniel, you'll also need to add a dependency upon qtdeclarative5-usermetrics0.1 for music-app (not music-app-autopilot) to resolve the AP test failures.

Revision history for this message
Victor Thompson (vthompson) wrote :

Daniel-
If you want, you can assign branch ownership to the team and I'll fix this up tonight.

Revision history for this message
Daniel Holm (danielholm) wrote :

Thanks a lot, mate! I changed the ownership.

238. By Victor Thompson

Fix AP tests

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
239. By Victor Thompson

Increment songs metrics when track is clicked and remove minutes of music for now

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Victor Thompson (vthompson) wrote :

This looks good now

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2013-09-26 06:41:26 +0000
3+++ .bzrignore 2013-10-30 00:52:01 +0000
4@@ -2,3 +2,5 @@
5
6 .build
7 po/Makefile
8+.excludes
9+music-app.json
10
11=== modified file 'debian/control'
12--- debian/control 2013-10-18 07:05:29 +0000
13+++ debian/control 2013-10-30 00:52:01 +0000
14@@ -21,6 +21,7 @@
15 qtdeclarative5-qtmultimedia-plugin,
16 qtdeclarative5-qtquick2-plugin,
17 qtdeclarative5-ubuntu-ui-toolkit-plugin,
18+ qtdeclarative5-usermetrics0.1,
19 qtdeclarative5-window-plugin,
20 qtdeclarative5-xmllistmodel-plugin,
21 qmlscene
22
23=== modified file 'music-app.qml'
24--- music-app.qml 2013-10-22 04:56:27 +0000
25+++ music-app.qml 2013-10-30 00:52:01 +0000
26@@ -28,6 +28,7 @@
27 import QtQuick.LocalStorage 2.0
28 import QtQuick.XmlListModel 2.0
29 import QtGraphicalEffects 1.0
30+import UserMetrics 0.1
31 import "settings.js" as Settings
32 import "meta-database.js" as Library
33 import "scrobble.js" as Scrobble
34@@ -152,12 +153,21 @@
35 }
36 }
37
38+ // UserMetrics to show Music stuff on welcome screen
39+ Metric {
40+ id: songsMetric
41+ name: "music-metrics"
42+ format: "<b>%1</b> songs played today"
43+ emptyFormat: "No songs played today"
44+ domain: "com.ubuntu.music"
45+ }
46+
47 // Design stuff
48 Style { id: styleMusic }
49 width: units.gu(50)
50 height: units.gu(75)
51
52- // RUn on startup
53+ // Run on startup
54 Component.onCompleted: {
55 customdebug("Version "+appVersion) // print the curren version
56 customdebug("Arguments on startup: Debug: "+args.values.debug)
57@@ -347,6 +357,7 @@
58 else {
59 console.debug("Debug: no scrobbling")
60 }
61+ songsMetric.increment() // Increment song count on Welcome screen
62 }
63
64 // Add items from a stored query in libraryModel into the queue
65@@ -449,6 +460,7 @@
66 if (play === true)
67 {
68 player.play()
69+ songsMetric.increment() // Increment song count on Welcome screen
70 }
71
72 console.log("Source: " + player.source.toString())

Subscribers

People subscribed via source and target branches

to status/vote changes: