PATCH: Impoving import of Amarok 1.4 statistics
Michael Reiher
redm at gmx.de
Fri Jul 17 13:07:54 UTC 2009
Hi
Not sure if this is the proper place to send patches, but I couldn't find
anything more suitable... if there is a better place please tell me.
On a recent beta release notes I complained about broken import of Amarok 1.4
statistics. Markey answered they would welcome patches from outside. It took a
bit longer, but here we go now! :)
When I tried to import the statistics of my old Amarok 1.4 installation
nothing seemed to work, it gave completely weird results and this thing seemed
entirely broken. I started looking at the code and by now I know that this was
an unfortunate mixture of wrong assumptions, missing feedback and possibly
bugs. (For instances I assumed it to operate on tags rather then pure file
URLs.) But even after finding out how it was supposed to work that didn't
solve my problems. So I made some improvements, which I attached to this mail.
To shortly describe the scenario that I faced: I upgraded my distribution and
in that process decided to install from scratch thereby also reorganizing the
disc partition and contents. So I also moved my music collection from a
general data partition (/data/music) into my home dir (~/Music). I also did
some cleanup and moved some things around within the collection. This meant
the files had more or less different URLs now. All in all a not too unlikely
scenario I'd say.
Problem 1: Missing feedback. On first run of the import nothing seemed to
happen. Here I think it would be good to show to the user for which files
statistics have been discarded. That would have also given me the clue that
this is about URLs and not tags.
Problem 2: Import statistics even if files have moved. Here I added an option
to try to determine the appropriate entries in the new collection by
evaluating the tags of the original files.
A remaining problem I came across during my experiments is, whether it's
useful to import statistics for files that exist, but are not in the
collection. I stumbled over this when I set a symlink from the old prefix
(/data/music) to the new one (~/Music) in an attempt to get the import
working. So a part of the files were accessible again with their old paths.
The new collection however contained only the new paths... All I got however
were a load of double entries in the collection... So it a) can be confusing
and b) I don't actually see a use for this. So I would suggest only to import
statistics for files which are in the collection. Does anything speak against
that?
As there was quite some stabbing in the dark involved (although I think I
mostly understood how the query stuff works by now;) I'm of course open for
comments and suggestions regarding the patch. And not only technical ones, of
course. So please ask and comment! :)
Greets Michael
PS: The second little patch "amarok_escape.patch" fixes a missing escape. I
think it's useful in any case, so I separated it. I got SQL errors when
filtering for titles etc. containing a ' and matching both begin and end.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: amarok_import.patch
Type: text/x-patch
Size: 20081 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/amarok/attachments/20090717/f97cee25/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: amarok_escape.patch
Type: text/x-patch
Size: 982 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/amarok/attachments/20090717/f97cee25/attachment-0001.patch>
More information about the Amarok
mailing list