Summary: | [PATCH] Collection import from amarok 1.4 does not import score | ||
---|---|---|---|
Product: | [Applications] amarok | Reporter: | Jens <jens.uhlenbrock> |
Component: | Collections/Local | Assignee: | Amarok Developers <amarok-bugs-dist> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | bassslave, kde.bugzilla.2012, kuba.serafinowski, l.jirkovsky, martenseemann, mziab, psychonaut, romain.thevenon, ruiz, soulflyb, stuffcorpse, xavier.corredor.llano |
Priority: | NOR | ||
Version: | 2.2.1 | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Unspecified | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | php-script: import score from 1.4sqlite to 2mysql |
Description
Jens
2008-11-06 16:41:38 UTC
English word for "points" is score. Fixed it in the subject. Strange, worked fine for me. Any chance you can email me your collection.db? SVN commit 882682 by seb: We shouldn't discard statistics rows where the deviceid is -1, where no associated mount point is returned. This is the case for collections which have Amarok 1.4 'dynamic collections' turned off. BUG: 174444 BUG: 174329 M +2 -2 FastForwardWorker.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=882682 Mandriva 2009.0, KDE 4.1.3 Score isn't imported from amarok 1.4 sqlite db. (In reply to comment #4) > Mandriva 2009.0, KDE 4.1.3 > > Score isn't imported from amarok 1.4 sqlite db. > version of amarok : 2.0 final Same problem here with Amarok 2.0 final on Gentoo. Reopening as per request from user "roffffel" on our forum. He claims the bug is not yet fixed. Anyone able to confirm? Also see here: http://amarok.kde.org/forum/index.php/topic,16153.0.html *** Bug 184933 has been marked as a duplicate of this bug. *** Confirming bug still exists with Amarok 2.0.1 on openSUSE 11.1 (installed from RPM kde4-amarok-2.0.1.1-20.54). I can attach my collection.db from 1.4 if it would help. Is this bug still present in 2.1 beta1 or SVN? It's unconfirmed since it's report... this bug still present (and confirmed) in amarok 2.1 svn 959286 with ArchLinux Are you all importing from a local sqlite database, or are you using a mysql/psql connection? I used an SQLite database. I used too SQLite database I've this problem with MySQL database. I'm using Amarok 2.0.96 (beta 1?) on Arch Linux. Issue still exists in Amarok 2.1 on Linux when trying to import from SQLite. Same issue here on Amarok 2.1 (Kubuntu) when trying to import from SQLite database. Actually, not only a score problem : I haven't any ratings imported from Amarok 1.4. Any idea ? Any news on this? Is there any known workaround? Created attachment 36181 [details]
php-script: import score from 1.4sqlite to 2mysql
fyi: for myself I sovled this problem using a quick and dirty php-script It comes with absolutely no warranty! could someone test it in current GIT master? i have no db to test with, so.. either way it wouldn't be confirmed and require closing yea!! this problem solved, I tested amarok-git 20090816 in ArchLinux importing db (sqlite) from amarok 1.4.10 and import score excelent!! gladly closing then :) Problem solved on amarok-git 20090816 in Kubuntu (importing SQLite DB from Amarok 1.4.10) : all scores and ratings successfully imported :) You could close It still doesn't work here with MySQL and Amarok 2.2 beta1. Everything is imported except of scores. I can upload dump of my MySQL database somewhere if you want to. Anyway, it seems that some scores are imported but unfortunately it's only 29 tracks from more than 4 thousands. Here is dump of my MySQL database: http://blender6xx.ic.cz/pub/amarok.mysql Strange enough that even the php workaround doesn't actually import anything even though that it claims that everything have been imported. It seems that problem is caused by non integral numbers. Indeed. I've encountered the same problem during my migration to Amarok 2.2.0 and it seems all scores which didn't get imported were floats. Thankfully, resolving this was a cinch: diff -Nur amarok-2.2.0.orig/src/databaseimporter/amarok14/FastForwardWorker.cpp amarok-2.2.0/src/databaseimporter/amarok14/FastForwardWorker.cpp --- amarok-2.2.0.orig/src/databaseimporter/amarok14/FastForwardWorker.cpp 2009-09-28 19:34:03.000000000 +0200 +++ amarok-2.2.0/src/databaseimporter/amarok14/FastForwardWorker.cpp 2009-10-15 01:29:39.395024662 +0200 @@ -163,7 +163,7 @@ uint firstPlayed = query.value( index++ ).toUInt(); uint lastPlayed = query.value( index++ ).toUInt(); - uint score = query.value( index++ ).toInt(); + uint score = query.value( index++ ).toDouble(); int rating = query.value( index++ ).toInt(); int playCount = query.value( index++ ).toInt(); QString lyrics = query.value( index++ ).toString(); After applying this, I can confirm scores are imported as intended. Seb, could you please look at the one-liner patch in comment #34? Does it make sense? AFAIK this is solved in Amarok 2.2.1 Could someone reopen this? This bug is not fixed in 2.2.1. Patch from comment #34 fixes the problem. Indeed. I'd like to point out the problem is likely limited to importing from sqlite used by 1.x. A quick look at the old database dump shows that I have a lot of fractional scores. For whatever reason, those are being decoded as zero, not truncated to an int. Changing that one instance of toInt into toDouble fixes the problem. Michal, could you please make a merge request on Gitorious so the developers can check that patch? You can find the necessary instructions here: http://techbase.kde.org/Getting_Started/Sources/Amarok_Git_Tutorial Thank you. It's also problem with MySQL database from Amarok 1.x (see my database dump from comment #34). I don't know why but almost all (let's say 95%) scores are floats. Maybe it's a relict from older versions of amarok because this collection exists since Amarok 1.1 or so. It stills doesn't function in the amarok nightly build (project neon). (In reply to comment #38) > Indeed. I'd like to point out the problem is likely limited to importing from > sqlite used by 1.x. A quick look at the old database dump shows that I have a > lot of fractional scores. For whatever reason, those are being decoded as zero, > not truncated to an int. Changing that one instance of toInt into toDouble > fixes the problem. Did you submit a merge request for this change as asked in comment #39? Just did. Sorry for the delay, it's been a little hectic. I've just pushed Michael's commit to Git mainline. Please test (and thanks Michael!): commit 28b6182eeccf953fdb82473ae3146741ff2101e6 Author: mziab <mziab@dual.(none)> Date: Mon Dec 7 22:26:51 2009 +0100 Fix the problem of fractional scores being imported as zero by using toDouble instead of toInt on the field in question. |