Bug 133319

Summary: Amarok does not read Statistics table after a database restore
Product: [Applications] amarok Reporter: Bearcat M. Sandor <linux>
Component: generalAssignee: Amarok Bugs <amarok-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: normal CC: che
Priority: NOR    
Version First Reported In: 1.4.2   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Bearcat M. Sandor 2006-08-31 08:03:00 UTC
Version:            (using KDE KDE 3.4.2)
Installed from:    Compiled From Sources
Compiler:          gcc 4.0.3 
OS:                Linux

I backed up my postgresql amarok database via pg_dump.  I installed amarok 1.4.2 and encountered the database problems others are experiencing. I removed 1.4.2 and reinstalled 1.4.1. I dropped the database and created a new one giving all privileges to the user that amarok logs in with.  I imported the saved 1.4.1 database back into the new db.

I browse the data in the Statistics table and see that there are some 3k records.  I close my postgresql session. I fire up amarok and play a track that according to the Statistics table i have played 20 times. Amarok tells me it has never been played before. I stop the track and close amarok. Looking at the table i see that it now has a playcount of 1.

While i see why Amarok would write out the playcount and playdate info on exiting, why is Amarok not reading in the Statistics table of a new database?
Comment 1 Bearcat M. Sandor 2006-08-31 08:17:11 UTC
Also, note i have seen the same behavior with mysql.

I am running postgresql 8.1.4

Thanks all
Comment 2 Christer Ekholm 2006-09-24 01:27:10 UTC
I had the same problem and managed to get all my statistics back by doing

   update statistics set deviceid='-1' where deviceid!='-1';

After restoring the amarok database.  I don't know why this works and I don't know what the deviceid column is used for. But perhaps a developer reading this can explain?
Comment 3 Seb Ruiz 2008-10-29 05:00:50 UTC
Can't find the duplicate, but we know of this problem. CLosing.