Sunday, 17 June 2012

Amarok StatSyncing GSoC: week 4

Hi, in case you forgot, I'm working on my GSoC project about statistics synchronization in Amarok. This week, I've made the behaviour (as opposed to the looks) of the synchronization dialog perfect. Do you think I'm being too bold? Check the rest of the post. :-)
I add a couple of buttons each week, I promise I won't continue endlessly. :-)
What I've done this week:
  • Eliminated some false-positives in detection of rating conflicts (uses some heuristics, but will do)
  • Made "Updated Tracks" and "Tracks With Conflicts" combo-box options enabled only if there are actually some such tracks.
  • Made synchronization aware of iPod's recent play count feature - now the synchronized value is correct even if you play the same song in Amarok and on iPod simultaneously.
  • Added status bar so that you know the counts.
  • Qt's tree view combined with filtering can unfortunately forget which nodes are expanded. I've worked it around with some witty code. :-) On first show, tracks with conflicts have their nodes expanded.
  • Added the "Take Ratings From" button.
Problems I've faced:
  • While I'm generally satisfied with the dialog's behaviour, its appearance isn't particularly pleasing. I will for sure fix minor things like displaying rating with stars, but I'm not a usability expert. Fortunately, there seems to be an easy way to get it reviewed now.
  • To support iPods' recent play count, I've added a method to Meta::Track, which now seems rather unfortunate. I need to consult it with other Amarok developers, but probably I'll factor it into a Capability.
What's next:
  • Next week I'll make the synchronization dialog two-step: in step 1 you choose what fields to synchronize and what collections should participate.  What you see above will become the step 2.
  • I'm still a little ahead of my schedule and that's good. This means that I'll have a chance to look into Last.fm realms sooner. There is some activity on Last.fm code in Amarok from Harald Sitter recently (great!) and it turns out that rather big re-factoring will be needed.
You can test my work by pulling and building gsoc branch of my Amarok git repository clone, it already works! I also publish weekly diffs with more technical details on KDE's review board which may be a more convenient way to review my code and to comment on it: week 1 week 2 week 3 week 4

Monday, 11 June 2012

Amarok StatSyncing GSoC: week 3

Hi, in case you forgot, I'm working on my GSoC project about statictics synchronization in Amarok. Previous report was rather early, this one is a bit late. The main success this week is that the synchronization actually works (best tested with iPods), hooray!
Progress on the Synchronize Statistics dialogue. You can see conflict resolution, updated fields would be in bold, but the are none.
What I've done this week:
  • Implemented ability to compute synchronized value for each field, this is shown in UI. Fields that are going to be updated are in bold.
  • Improve the UI to be able to sort, filter-as-you type and filter based on synchronization status (updated, not touched, having conflict).
  • Made the synchronization smart so that it for example doesn't want to update labels of an iPod track, which doesn't support labels at all.
  • Changed core Amarok classes so that first, last played time and play count can be written back to tracks.
  • Implemented actual synchronization worker on top of all this. The worker runs in a thread and is abort-able.
Problems I've faced:
  • There is currently no way to determine what statistics fields are supported by given Amarok collection. I had to use some heuristics as a temporary solution.
  • Setting some track fields is inconsistent in core Amarok classes. For example setRating() and setScore() are in Meta::Track while I really think they should be in a specialized class called EditCapability.
  • No other collection than the main one supports track labels currently (AFAIK), so I cannot really test this feature.
What's next:
  • I've already done much of the agenda for the next week, so:
  • I'll work on polishing the synchronization UI and behaviour a bit more to remove some corner-cases that currently exist.
  • I'll improve handling of rating conflicts: I plan the "Take ratings from..." button to mass-resolve unresolved rating conflicts.
You can test my work by pulling and building gsoc branch of my Amarok git repository clone, it already works! I also publish weekly diffs with more technical details on KDE's review board which may be a more convenient way to review my code and to comment on it: week 1 week 2 week 3