<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi developers,<br>
    <br>
    Below is my GSoC proposal in its final form, as-is on Google
    Melange. Many thanks for your help with various things related to
    composing it, especially to Matĕj for his tireless and thorough
    reviews! :) If you want to read the discussion on this proposal,
    here's the link:
    <a class="moz-txt-link-freetext" href="http://mail.kde.org/pipermail/amarok-devel/2013-April/011946.html">http://mail.kde.org/pipermail/amarok-devel/2013-April/011946.html</a>
    (also listed as reference 7 in the application).<br>
    <br>
    <hr size="2" width="100%">
    <div style="padding-top: 1em;">
      <p><strong>Name:</strong> Konrad Zemek<br>
        <strong>Email Address:</strong> <a class="moz-txt-link-abbreviated" href="mailto:konrad.zemek@gmail.com">konrad.zemek@gmail.com</a><br>
        <strong>Freenode IRC Nick:</strong> kzemek<br>
        <strong>IM Service and Username:</strong> Skype, handle:
        konrad-kun<br>
        <strong>Location:</strong> Kraków, Poland. GMT+2 during the
        Summer.</p>
    </div>
    <div style="padding-top: 1em;">
      <h3>Proposal Title</h3>
      <p>Reimplement Amarok 1.4 (FastForward) & iTunes importers on
        top of Statistics Synchronization framework, and add Amarok 2.x
        and Rhythmbox as synchronization targets.</p>
    </div>
    <div style="padding-top: 1em;">
      <h3>Motivation for Proposal / Goal</h3>
      <p>Currently, Amarok has the ability to import personal track
        metadata, like playcounts, ratings and last played time, from
        Amarok 1.4 and iTunes databases. Although this code still
        fulfills its purpose, the StatSyncing framework has since been
        added to the codebase and serves as a perfect base for a rewrite
        of importers. Perhaps the most significant advantage that would
        be obtained by implementing importers on top of StatSyncing is
        the ability to resynchronize information and to work with
        collections other than local. Still, synchronization with Amarok
        1.4 and iTunes covers only a small portion of users that may be
        willing to use Amarok 2.x, but are tied to their current music
        player because of the consequence of losing their personal
        metadata. To alleviate this, I intend to add Rhythmbox as a new
        target for synchronization. It stores following personal track
        metadata compatible with Amarok:</p>
      <ul style="margin-bottom: 10px;">
        <li>user rating</li>
        <li>playcount</li>
        <li>last played time</li>
      </ul>
      <p>Rhythmbox is the default GNOME's music player, and since Ubuntu
        12.04, the music player shipped by default in Ubuntu. I feel
        that this is an important target for metadata synchronization,
        easing not only the transition between music players, but
        between whole desktop environments - GNOME and KDE. To complete
        the set, synchronization with Amarok 2.x will be added, so that
        user can synchronize his personal track metadata between
        separate Amarok databases.</p>
    </div>
    <div style="padding-top: 1em;">
      <h3>Implementation Details</h3>
      <p>This project breaks up in a few parts with well-defined
        deliverables (details about the timeline are in the Tentative
        Timeline section).</p>
      <p>On the high level, the StatSyncing framework consists of the
        following elements:</p>
      <ul>
        <li>Controller, which registers providers and starts
          synchronization</li>
        <li>Config, used to store preferences for statistics
          synchronization and can be set through UI</li>
        <li>Provider, which works with the backend and provides
          StatSyncing::Tracks</li>
        <li>Track, which is an abstraction of a track and contains
          relevant metadata used for trackmatching, as well as methods
          to modify it</li>
        <li>Process, which is responsible for matching the tracks
          between collections and synchronizing them</li>
        <li>ScrobblingService, which is used for scrobbling capabilities
          (transferring information about played tracks; see <a
            href="#ref1">[1]</a>)</li>
      </ul>
      <p>The project can be broken into three parts; reimplementation of
        existing importers (read-only), introduction of new importers
        (read-only) and finally an optional goal of making the
        synchronization work in read-write mode (so that foreign
        statistics can be updated as well as local ones). This last goal
        is optional (soft goal).</p>
      <h4>Importer tests</h4>
      <p>There are no tests for importing in the current trunk. Since a
        big part of this project consists of refactoring, I will have to
        prepare a quality suite of tests to make sure that I introduce
        no regressions.</p>
      <ul style="margin-bottom: 10px;">
        <li>Implement whole test suite using QTest and gmock best
          practices</li>
        <li>Test cases would involve using a dummy input, invoking
          importer and verifying collection.</li>
        <li>The actual logic behind importing tracks will be changed, so
          these tests must treat importer as a black box (black box
          integration tests)</li>
      </ul>
      <h4>Reimplementing importers</h4>
      <ul style="margin-bottom: 10px;">
        <li>Reimplement importers to use StatSyncing</li>
        <li>Data-reading modules, would be cleaned up and factored out
          into their own classes that will be used by a subclass of
          StatSyncing::Provider</li>
        <li>Current services using StatSyncing framework will be used as
          a reference (primarily last.fm service)</li>
        <li>At each step where the code is functional (at least between
          reimplementing FastForwardImporter and ITunesImporter),
          supplement the tests so that new capabilities are accounted or
          (e.g. make sure that foreign playcounts are not simply stacked
          on locally saved playcounts with each synchronization)</li>
        <li>Additionally, unit tests can now be written to confirm
          correct implementation</li>
        <li>The importer code may prove to be repeatable (in the extreme
          case the only thing differing these importers will be their
          respective parsers); this code will be deduplicated. If it
          fits its responsibilities, a parent class of importers should
          ontain the duplicated logic, otherwise I will introduce new
          helper classes.</li>
      </ul>
      <h4>GUI</h4>
      <p>Because of new capabilities, importers will be moved from Local
        Collection -> Import tab to the Metadata tab (where Statistic
        Synchronization settings are located). Because these targets may
        be added at will and multiple times (e.g. a user may like to
        synchronize with several Amarok installations on different
        machines, with database files available through NFS shares) an
        "Add" button will be added to enable adding new synchronization
        targets. Also, because database files can change URLs, a
        "Configure" button will be added to modify existing settings. I
        prepared early mockups of the modified config UI <a
          href="#config_metadata_tab">[8]</a>, of "Add Synchronization
        Target" dialog <a href="#add_synchronization_target_dialog">[9]</a>
        and an example "Add Rhythmbox Synchronization Target" dialog <a
          href="#add_rhythmbox_synchronization_target_dialog">[10]</a>.</p>
      <h4>Implementing Rhythmbox and Amarok 2.x importers</h4>
      <p>Rhythmbox stores its personal metadata in an XML file, which
        should be easy to read through QXml SAX parser. When in doubt
        about the format, I will consult Rhythmbox source code.</p>
      <ul style="margin-bottom: 10px;">
        <li>Rhythmbox parser shall be robust, that is it shouldn't
          depend on the order of information (this is obvious, but
          important)</li>
        <li>At this point both Amarok 1.4 and iTunes importers are
          rewritten, so their implementations will be used as a
          reference for Amarok 2.x and Rhythmbox importers.</li>
        <li>Amarok 2.x importer should support importing data from both
          a full mysql server and mysql-embedded file. To make reading
          from both sources simpler, existing MySqlStorage and
          MySqlEmbeddedStorage classes will be used. The importer's code
          should be as decoupled from the database schema as possible,
          allowing it to support a range of previous and future versions
          of Amarok.</li>
        <li>The subgoal is to make sure that adding additional import
          targets is straightforward and easy, and if possible doesn't
          introduce code duplication (this may involve modifying
          StatSyncing framework).</li>
        <li>As with reimplementing importers, every piece of working
          code should be tested to ensure that it is performing
          correctly, and so that regressions don't occur in the future.</li>
      </ul>
    </div>
    <div style="padding-top: 1em;">
      <h3>Tentative Timeline</h3>
      <h4 style="font-size: small;">MIDTERM EVALUATION (deadline: August
        02)</h4>
      <p>The hard goal for midterm evaluation is to have both
        FastForward and iTunes importers reimplemented, and if possible
        (soft goal) unit-tested.</p>
      <h4 style="font-size: small;">FINAL EVALUATION (suggested:
        September 16, deadline: September 23)</h4>
      <p>The hard goal for final evaluation is to have all importers
        implemented and working. The slightly softer goal is to have
        them unit-tested. The soft goal is to implement two-way
        synchronization.</p>
      <ol style="font-size: small; margin-bottom: 10px;">
        <li><em>June 17 - 23:</em>
          <p>Drafting up test cases for FastForward and iTunes
            importers.</p>
        </li>
        <li><em>June 24 - 30:</em>
          <p>Implementing the initial test suite for importers (exam
            week).</p>
        </li>
        <li><em>July 01 - 07:</em>
          <p>Reimplementing FastForward importer, cleaning up
            data-reading module. At the end of the week I expect to have
            working implementation of FastForwardProvider.</p>
        </li>
        <li><em>July 08 - 14:</em>
          <p>Reimplementing FastForward importer. At the end of the week
            I expect to have a functional importer, possibly with some
            quirks to iron out. Implementing unit tests to assert
            correctness.</p>
        </li>
        <li><em>July 15 - 21:</em>
          <p>Reimplementing iTunes importer, cleaning up data-reading
            module. As with FastForward, at the end of the week the
            ITunesProvider should be working.</p>
        </li>
        <li><em>July 22 - 28:</em>
          <p>Reimplementing iTunes importer. As with FastForward
            importer, after this period the importer should be
            functional. Preparing GUI, implementing unit tests.</p>
        </li>
        <li><em>July 29 - August 04:</em> <strong>MIDTERM EVALUATION</strong>
          <p>Ironing out last issues with reimplemented importers,
            submitting current work for midterm evaluation.</p>
        </li>
        <li><em>August 05 - 11:</em>
          <p>In-depth research of Rhythmbox metadata format,
            implementing Rhythmbox importer. I do not expect the
            RhythmboxProvider to be fully functional at the end of the
            week.</p>
        </li>
        <li><em>August 12 - 18:</em>
          <p>Implementing Rhythmbox importer. RhythmboxProvider should
            be working at the start of the week, whole synchronization
            should work at the end of the week. Implementing unit tests.</p>
        </li>
        <li><em>August 19 - 25:</em>
          <p>Implementing Amarok 2.x importer. Like FastForward and
            ITunes, at the end of the week the AmarokProvider should be
            functional.</p>
        </li>
        <li><em>August 26 - September 01:</em>
          <p>Implementing Amarok 2.x importer. Ironing out any problems
            with AmarokProvider. At the end of the week one-way import
            should be working, along with the GUI. Implementing unit
            tests.</p>
        </li>
        <li><em>September 02 - 08:</em>
          <p>Investigating and implementing two-way synchronization. I
            expect at least one working implementation of two-way
            synchronization at the end of the week.</p>
        </li>
        <li><em>September 09 - 15:</em>
          <p>Implementing two-way synchronization for remaining
            importers, writing remaining tests.</p>
        </li>
        <li><em>September 16 - 22:</em> <strong>FINAL EVALUATION</strong>
          <p>Ironing out bugs, writing remaining tests. Cushion period
            in case of delays. Submitting work for final evaluation.</p>
        </li>
        <li><em>September 23 - 29:</em>
          <p>Ironing out possible quirks, polishing soft goals in case
            they were not fully finished for the final evaluation.</p>
        </li>
      </ol>
    </div>
    <div style="padding-top: 1em;">
      <h3>Obligations from late May to early August</h3>
      <p>I have school until the very early July, with exams starting
        the last week of June. I will be putting my work on hold for the
        whole period of Google Summer of Code, but up until mid-June I
        may still be required to commit at least a few hours a week to
        my current job. So from mid-June to late September I have no
        commitments except for school, and from early July to late
        September no commitments at all.</p>
    </div>
    <div style="padding-top: 1em;">
      <h3>About me</h3>
      <p>I'm a student at AGH University of Science and Technology,
        Kraków, Poland. I study Computer Science, and I'm currently in
        my second year. At the moment I'm employed as a part time C++
        programmer at X-Formation <a href="#ref2">[2]</a>, Poland,
        where my work ranges from conducting interviews with potential
        employees, through refactoring and bugfixing to implementing new
        features for our product.</p>
      <p>I'm a big fan of open source, and KDE in general. I've been
        using Amarok a lot and have not only read the source, but
        contributed to it <a href="#ref3">[3]</a> <a href="#ref4">[4]</a>.
        I'm currently working on more changes to Amarok's codebase. I am
        also familiar with Qt framework and have used it to prototype
        several small applications. I'm an early adopter, and my
        fiddling with Qt 5 beta has led me to uncover an important bug <a
          href="#ref5">[5]</a>. I also have source-level experience with
        Boost libraries.</p>
      <p>I'm very skilled in C++. Other than that I program mainly in
        Scala, and Java when required (and my university requires that a
        lot). I'm experienced with test driven development, continuous
        integration, code reviews and other agile techniques. I have
        work experience with both SVN and git, with the latter being my
        VCS of choice for personal projects. I also hold a title of
        finalist of Polish Olympiad in Informatics, a prestigious annual
        programming competition for Polish high school students <a
          href="#ref6">[6]</a> (about the Olympiad; Google translate).</p>
      <p>If my application is accepted, I am going to commit my full
        time to complete the project, including putting my job on hold
        for the duration of GSoC. I expect to be working 40 hours a
        week.I am comfortable with working independently under a
        supervisor living on the other side of the globe. Although I
        have not have worked in this style before, I foresee no problems
        with this and can even change my working hours if needed. I
        think that code reviews and email contact are the best way of
        tracking progress in this case. I am fluent in English, so
        communication shouldn't be a problem. Of course, I would work as
        well with a local mentor with whom I could discuss issues over a
        coffee.</p>
      <p>During the bonding period I expect to complete some more tasks
        for Amarok, possibly continuing what I started with <a
          href="#ref3">[3]</a> (in review comments I mentioned
        streamlining track sorting and making it consistent across the
        source code). I will also use this time to thoroughly prepare
        for the coding period.</p>
      <p>I'm seeing GSoC as a way to kickstart me into the open source
        development at large. After the end of Google Summer of Code
        program I hope to remain in Amarok community as a frequent
        contributor.</p>
      <p>This proposal has been discussed over on Amarok-devel mailing
        list. <a href="#ref7">[7]</a></p>
    </div>
    <div style="padding-top: 1em;">
      <h3>Junior job link</h3>
      <p style="margin: 0px;"><a href="#ref3">[3]</a> <a href="#ref4">[4]</a></p>
    </div>
    <div style="padding-top: 1em;">
      <h3>References</h3>
      <p><a id="ref1" name="ref1">[1] </a><a
          href="http://www.last.fm/help/faq?category=Scrobbling">http://www.last.fm/help/faq?category=Scrobbling</a><br>
        <a id="ref2" name="ref2">[2] </a><a
          href="http://www.x-formation.com/">http://www.x-formation.com/</a><br>
        <a id="ref3" name="ref3">[3] </a><a
          href="https://git.reviewboard.kde.org/r/110070/">https://git.reviewboard.kde.org/r/110070/</a><br>
        <a id="ref4" name="ref4">[4] </a><a
          href="https://git.reviewboard.kde.org/r/110139/">https://git.reviewboard.kde.org/r/110139/</a><br>
        <a id="ref5" name="ref5">[5] </a><a
          href="https://bugreports.qt-project.org/browse/QTBUG-26832">https://bugreports.qt-project.org/browse/QTBUG-26832</a><br>
        <a id="ref6" name="ref6">[6] </a><a
href="http://translate.google.com/translate?js=n&sl=pl&tl=en&u=http://www.oi.edu.pl/l/35/">
http://translate.google.com/translate?js=n&sl=pl&tl=en&u=http://www.oi.edu.pl/l/35/</a><br>
        <a id="ref7" name="ref7">[7] </a><a
          href="http://mail.kde.org/pipermail/amarok-devel/2013-April/011946.html">http://mail.kde.org/pipermail/amarok-devel/2013-April/011946.html</a></p>
    </div>
    <div style="padding-top: 1em; padding-bottom: 1em;">
      <h3>Images</h3>
      <p><a id="config_metadata_tab" name="config_metadata_tab">[8] </a><a
href="http://student.agh.edu.pl/%7Ezemek/amarok/config_metadata_tab.png">http://student.agh.edu.pl/~zemek/amarok/config_metadata_tab.png</a><br>
        <a id="add_synchronization_target_dialog"
          name="add_synchronization_target_dialog">[9] </a><a
href="http://student.agh.edu.pl/%7Ezemek/amarok/add_synchronization_target_dialog.png">http://student.agh.edu.pl/~zemek/amarok/add_synchronization_target_dialog.png</a><br>
        <a id="add_rhythmbox_synchronization_target_dialog"
          name="add_rhythmbox_synchronization_target_dialog">[10] </a><a
href="http://student.agh.edu.pl/%7Ezemek/amarok/add_rhythmbox_synchronization_target_dialog.png">http://student.agh.edu.pl/~zemek/amarok/add_rhythmbox_synchronization_target_dialog.png</a></p>
    </div>
    <br>
  </body>
</html>