PATCH: Impoving import of Amarok 1.4 statistics

Seb Ruiz ruiz at kde.org
Tue Jul 21 05:47:41 UTC 2009


Hi Michael,
Sorry I've taken a while in responding.

Thanks for the patch - I'll look at it when I get a chance (currently
very busy).

The problems you faced are certainly no outlier case, and they way you
have outlined your solution seems both sane and intelligent.

2009/7/17 Michael Reiher <redm at gmx.de>:
> 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.

Definitely not.

>
> 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.

Awesome, definitely useful to show.

>
> 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.

Do you have any estimate as to potential performance degradations
here? Opening files and reading tags is no quick task. However, given
that this should be a one off operation a perf degradation would be
worth it.

>
> 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?

That is exactly the plan and what we were aiming to do.

>
> 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! :)

I'll review both patches asap.

Cheers!

-- 
Seb Ruiz

http://www.sebruiz.net/
http://amarok.kde.org/



More information about the Amarok mailing list