This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Merge scores from another Amarok

Tags: None
(comma "," separated)
tomchiverton
Registered Member
Posts
15
Karma
0

Merge scores from another Amarok

Tue Jul 20, 2010 9:09 am
I'm trying to merge scores from Amarok at work into my home Amarok. Both are similar KDE versions so I though this would be easy enough.
All I need to do is grab the stats from one instances sqlite database and insert them into the other.

Export from 'work'
# cd /tmp
# sqlite3 collection.db .dump > work-collection.sql
# cat work-collection.sql | grep 'INSERT INTO "statistics"'|perl -pe 's!./home/workuser/mp3!./falken/smb4k/server-mp3!' | perl -pe 's!INSERT INTO!INSERT OR IGNORE INTO!' > work-collection-trim.sql
# grep Babu work-collection-trim.sql
INSERT OR IGNORE INTO "statistics" VALUES('./falken/smb4k/server-mp3/Babushka.mp3',1,1152891638,1222854768,40.8889,8,9,'b82b09481ba522440308ca2701c44557',0);

Import to 'home'
# cd ~/.kde/share/apps/amarok
# sqlite3 collection.db ".read /tmp/work-collection-trim.sql"

However, this doesn't seem to work in that I don't see the scores when I start the 'home' Amarok.
In fact, if I compare a .dump of collection.db before and after scoring a track, I see no difference.

Where does Amarok (v2.3.1) store the scores for tracks ?
If the answer is collection.db, why does this not show up when I 'diff' .dump's before and after scoring ?
User avatar
Mamarok
Manager
Posts
6071
Karma
16
OS

Re: Merge scores from another Amarok

Tue Jul 20, 2010 10:48 am
Why are you going through hoops? Please check the Settings -> Collection, there is an Import Statistics button that allows you to import statistics and ratings from Amarok 1.4.x

Amarok 2.x uses MySQL only, either the embedded default version or allows the use of an external MySQL server.


Running Kubuntu 22.10 with Plasma 5.26.3, Frameworks 5.100.0, Qt 5.15.6, kernel 5.19.0-23 on Ryzen 5 4600H, AMD Renoir, X11
FWIW: it's always useful to state the exact Plasma version (+ distribution) when asking questions, makes it easier to help ...
tomchiverton
Registered Member
Posts
15
Karma
0

Re: Merge scores from another Amarok

Tue Jul 20, 2010 11:33 am
Oh, right, eek. I was looking in the wrong place.
I want the files in /home/falken/.kde/share/apps/amarok/ :-)

Do you know if anyone has done this before ?

Last edited by tomchiverton on Tue Jul 20, 2010 11:40 am, edited 1 time in total.
User avatar
Mamarok
Manager
Posts
6071
Karma
16
OS

Re: Merge scores from another Amarok

Tue Jul 20, 2010 11:40 am
Then both are MySQL, not SQLite anyway, as I wrote above, Amarok 2.x only uses MySQL, default is mysqle (see $HOME/.kde/share/apps/amarok/mysqle/amarok)


Running Kubuntu 22.10 with Plasma 5.26.3, Frameworks 5.100.0, Qt 5.15.6, kernel 5.19.0-23 on Ryzen 5 4600H, AMD Renoir, X11
FWIW: it's always useful to state the exact Plasma version (+ distribution) when asking questions, makes it easier to help ...
tomchiverton
Registered Member
Posts
15
Karma
0

Re: Merge scores from another Amarok

Tue Jul 20, 2010 11:43 am
I'm amazed no one seems to have tried doing this before...
User avatar
Mamarok
Manager
Posts
6071
Karma
16
OS

Re: Merge scores from another Amarok

Tue Jul 20, 2010 12:23 pm
Simply because people don't use different databases on different 2.x versions, and there is absolutely no need to. Making a regular backup of the database is enough.


Running Kubuntu 22.10 with Plasma 5.26.3, Frameworks 5.100.0, Qt 5.15.6, kernel 5.19.0-23 on Ryzen 5 4600H, AMD Renoir, X11
FWIW: it's always useful to state the exact Plasma version (+ distribution) when asking questions, makes it easier to help ...
tomchiverton
Registered Member
Posts
15
Karma
0

Re: Merge scores from another Amarok

Tue Jul 20, 2010 12:45 pm
I would have though having one Amarok at work, and one at home (or one on the media centre and one on the laptop) would be fairly common.

Must just be me...
tomchiverton
Registered Member
Posts
15
Karma
0
In case anyone else does need to do this : http://rachaelandtom.info/merge-amarok-collections
User avatar
Dieter Schroeder
Registered Member
Posts
714
Karma
7
OS

Re: Merge scores from another Amarok

Mon Jul 26, 2010 11:15 pm
Hello Tom,

why don't you dump the db on the source pc, instead of archiving the whole amarok db?
And why won't you connect through the socket, if you create one?
But the idea itself is nice, although a bit rough until now.
I'll take a look at your script.

Regards
m0nk


If men could get pregnant, abortion would be a sacrament.
tomchiverton
Registered Member
Posts
15
Karma
0
You certainly could do the source-to-SQL conversion in situ, rather than bringing the DB across if you wanted too.
I couldn't get Perl's DBI database connector to talk over a socket.

It's very rough :-) But it's something I'll only need to do once in a blue moon.
NicoLarve
Registered Member
Posts
3
Karma
0
OS

Re: Merge scores from another Amarok

Tue Jan 31, 2012 10:54 pm
I still use amarok 1.4.x (under Trinity, a KDE3.5 fork). I'd like to merge counts and votes from 3 or 4 sqlite dbs to a single one, it would also ease a possible upgrade to amarok2.
Have you ever heard of any tool like this around there?

Thank you.
tomchiverton
Registered Member
Posts
15
Karma
0
Yeah, it'd be doable, just use my script more than once :-)
NicoLarve
Registered Member
Posts
3
Karma
0
OS
tomchiverton wrote:Yeah, it'd be doable, just use my script more than once :-) .

But your script is for amarok2, right?

Does the SQL scheme remain the same?
It would be surprizing since a custom option have been made available in amarok2 to import sqlite DB from amarok1.4.x.
tomchiverton
Registered Member
Posts
15
Karma
0
I thought you said you were migrating to Amarok2?
NicoLarve
Registered Member
Posts
3
Karma
0
OS

Re: Merge scores from another Amarok

Fri Feb 03, 2012 11:23 pm
tomchiverton wrote:I thought you said you were migrating to Amarok2?

Not exactly:
NicoLarve wrote:it would also ease a possible upgrade to amarok2.

I still use amarok 1.4.x and I don't plan to upgrade shortly. What I meant was that after merging various 1.4.x DBs, it would be straightforward to jump in amarok2 and use a single MySQL DB.

So, the scheme might have changed a lot, isn't it?


Bookmarks



Who is online

Registered users: Bing [Bot], gfielding, Google [Bot], markhm, sethaaaa, Sogou [Bot], Yahoo [Bot]