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

Import Collection Woes

Tags: None
(comma "," separated)
wpk
Registered Member
Posts
5
Karma
0

Re: Import Collection Woes

Thu Nov 13, 2008 12:47 am
just finished compiling and testing a fresh svn version and I still have the same message. Are there logs that can be turned on to see what happens? Where should I start looking in the code? DatabaseImporter::startImporting ?
wpk
Registered Member
Posts
5
Karma
0

Re: Import Collection Woes

Thu Nov 13, 2008 1:59 am
After adding some debugging logs to FastForwardWorker::run(), I get the following error:

Error: Query error: Unknown column 'percentage' in 'field list' QMYSQL: Unable to execute query
Failed: Unable to import statistics

The weird thing is that if I execute the sql query directly in the query browser, it works just fine (no complaints about percentage which actually exists).

PS:
hereafter the code I've add just after the db.exec:

    if(!query.isValid())
    {
       QString errorMsg = i18n( "Query error: %1", db.lastError().text() );
       debug() << errorMsg;
       emit importError( errorMsg );
       m_failed = true;
       return;
    }
wpk
Registered Member
Posts
5
Karma
0

Re: Import Collection Woes

Sat Nov 15, 2008 8:45 am
I think I need some help  :redface:

When I try to query the old amarok db with the following standalone prog, it works perfectly.

Code: Select all
#include <QSqlDatabase>
#include <QSqlError>
#include <QSqlQuery>
#include <QSqlResult>
#include <iostream>

int main(int, char**)
{
   QSqlDatabase db = QSqlDatabase::addDatabase( "QMYSQL" );
   db.setDatabaseName( "amarok" );

   db.setHostName( "localhost" );
   db.setUserName( "root" );
   db.setPassword( "pass" );

   std::cerr << "TEST " << db.databaseName().toAscii().constData()
   << " " << db.userName().toAscii().constData()
   << " " << db.hostName().toAscii().constData()
   << " " << db.password().toAscii().constData()
   << " " << db.driverName().toAscii().constData() <<
   std::endl;

    if( !db.open() )
    {
        std::cerr << "cannot opendatabase" << db.lastError().text().toAscii().constData() << std::endl;
        return 1;
    }

    if(db.isOpen())
    {
       std::cerr << "DB opened" << std::endl;
    }


    QString sql;
    sql += "SELECT D.`lastmountpoint`,S.`url`,S.`createdate`,S.`accessdate`,S.`percentage`,S.`rating`,S.`playcounter`,L.`lyrics` ";
    sql += "FROM statistics S ";
    sql += "LEFT OUTER JOIN devices D ";
    sql += "  ON S.`deviceid` = D.`id` ";
    sql += "LEFT OUTER JOIN lyrics L ";
    sql += "  ON L.`deviceid` = S.`deviceid` ";
    sql += "  AND L.`url` = S.`url` ";
    sql += "ORDER BY D.`lastmountpoint`, S.`url`";

    std::cerr << "CPO: Query: " << sql.toAscii().constData() << std::endl;

    QSqlQuery query = db.exec( sql );

    if(!query.isActive())
    {
       std::cerr << "Query not active" <<std::endl;
       std::cerr << "Query error: [" << db.lastError().text().toAscii().constData() << "]" << std::endl;
    }

   while (query.next())
   {
         QString name = query.value(0).toString();
         std::cerr << "name " << name.toAscii().constData() << std::endl;
     }

    return 0;
}


g++ -o dbtst dbtst.cpp -I/usr/lib/qt4/include -I/usr/lib/qt4/include/QtSql -lQtCore -lQtSql

When I try to execute the same code in FastForwardWorker::run(), the query always fails Query error: Unknown column 'percentage' in 'field list' QMYSQL: Unable to execute query.
When I remove S.percentage from the fields list, mysql still complains about the column 'playcounter' but once those 2 fields are removed, the query works fine  :confused:.
It doesn't make much sense to me. Is amarok doing something special with mysql (need a special locale?)? Maybe a threading issue?
tvsaru
Registered Member
Posts
1
Karma
0

Re: Import Collection Woes

Sun Nov 16, 2008 4:04 pm
Thanks WPK, for looking into this
User avatar
sebr
Moderator
Posts
301
Karma
0

Re: Import Collection Woes

Mon Nov 24, 2008 12:13 pm
wpk wrote:
Code: Select all
    QString sql;
    sql += "SELECT D.`lastmountpoint`,S.`url`,S.`createdate`,S.`accessdate`,S.`percentage`,S.`rating`,S.`playcounter`,L.`lyrics` ";
    sql += "FROM statistics S ";
    sql += "LEFT OUTER JOIN devices D ";
    sql += "  ON S.`deviceid` = D.`id` ";
    sql += "LEFT OUTER JOIN lyrics L ";
    sql += "  ON L.`deviceid` = S.`deviceid` ";
    sql += "  AND L.`url` = S.`url` ";
    sql += "ORDER BY D.`lastmountpoint`, S.`url`";



Strange that this works from within a standalone program. FWIW, I didn't have any problems running the importer. The database was, however, on another machine. Did you try edit the Amarok sources to quote the column names and to explicitly use a table reference? These are the only changes that I see that might possibly makes a difference.

wpk wrote:When I try to execute the same code in FastForwardWorker::run(), the query always fails Query error: Unknown column 'percentage' in 'field list' QMYSQL: Unable to execute query.
When I remove S.percentage from the fields list, mysql still complains about the column 'playcounter' but once those 2 fields are removed, the query works fine  :confused:.
It doesn't make much sense to me. Is amarok doing something special with mysql (need a special locale?)? Maybe a threading issue?


Very very weird. Amarok isn't doing anything special with the mysql database so it should work fine. Definitely not a threading issue either, since only one thread is accesing the mysql database.
Boni
Registered Member
Posts
49
Karma
0

Re: Import Collection Woes

Mon Nov 24, 2008 12:46 pm
It's me again...
Using the Nightly from yesterday, mirgrating a collection stops working at
"Hans Georg Pflüger - Richard Strauss / Also Sprach Zarathustra, Op. 30", a song in an .aac-file format and the same song in .m4a format. Not sure which one the importer doesn't like.
Afer one minute it says "Success: Imported 22 tracks"

Hope, this helps a bit

EDIT: All the not importable tracks contain special characters in their name. The importer might handle it well, but the collection itself is somewhat screwed. Over the last year there were two entries from one song with a special character, e.g.:
./mnt/win/_INDUSTRIAL/Feindflug/Feindflug v4/Feindflug - 07 - Grössenwahn.mp3
./root/windows/_INDUSTRIAL/Feindflug/Feindflug v4/Feindflug - 07 - Grössenwahn.mp3

I can't tell why, should be a bug in one of the versions of amarok. Because of those duplicates the importing stopped.

EDIT2: I am so stupid... I set in Amarok 2 to only scan /mnt/win/. This resulted in the fact that only the "duplicate" entries were imported. All the others on /root/windows were left out
==> My fault :(

Last edited by Boni on Mon Nov 24, 2008 3:02 pm, edited 1 time in total.
andrej
Registered Member
Posts
7
Karma
0

Re: Import Collection Woes

Tue Nov 25, 2008 1:50 am
Just installed Amarok 1.98, running on KDE 4.1.3.
I tried to import my collection from 1.4, but the program crashed when it came to a band called "π2" (maybe because of the character?). When I tried it a second time, the import tool just gave me a bunch of lines with "- importiert", nothing else.
The collection.db file still seems to be intact, though. Any ideas?
elerran
Registered Member
Posts
1
Karma
0

Re: Import Collection Woes

Tue Nov 25, 2008 10:08 pm
Amarok 1.98 on kubuntu/kde 4.1.2 (had to ignore a kdelibs version dependency to install this one)

Hi,
I'''ve been facing the same problem (0 songs imported). The db is on an mysql db. The path to all my songs includes some special (greek) characters, so I tend to agree that it must be these characters that mess up the process.

Scanning from scratch works ok.

Keep on the good work guys.
Thanks
modcube
Registered Member
Posts
4
Karma
0

Re: Import Collection Woes

Wed Nov 26, 2008 3:09 am
I have the same problem that wpk: when I try to query the old amarok db with a standalone prog, it works perfectly but...
when I try to execute the same code in FastForwardWorker::run() the query always fails:

Error: Unknown column 'percentage' in 'field list' QMYSQL: Unable to execute query

when I remove percentage and playcounter from the fields list:

Error: Unknown column 'S.deviceid' in 'on clause' QMYSQL: Unable to execute query

In the import window I get:

Importing downloaded album art
Success: Imported 0 tracks

It's very strange...
Boni
Registered Member
Posts
49
Karma
0

Re: Import Collection Woes

Wed Nov 26, 2008 5:44 am
My tip on the special characters was wrong actually so some things to say:
The path of the music must be the same in Amarok 1.4 and 2. So if the path has changed, importing does not work. Thats also the problem why importing from Windows doesn't work...
Boni
Registered Member
Posts
49
Karma
0

Re: Import Collection Woes

Fri Nov 28, 2008 10:43 am
The percentage (score) information does not get imported, but everything else does!
The most important thing :(
briccster
Registered Member
Posts
4
Karma
0

Re: Import Collection Woes

Sat Dec 06, 2008 3:20 pm
I've got a similar problem and the qt sql libraries don't seem to be the fix.  I'm using F10 with Amarok 1.98 and attempting to import my previous data from my PostGreSQL database.  The database is online and accessible through other clients.  I've validated that I have the qt-postgresql-4.4.3-6.fc10.i386 PKG installed.  Yet, I continue to get the "could not open Amarok 1.4 database: Driver not loaded Driver not loaded postgres" error message upon import.

Any thoughts about where I should look next?
User avatar
markey
KDE Developer
Posts
2286
Karma
3
OS

Re: Import Collection Woes

Sat Dec 06, 2008 4:37 pm
briccster wrote:I've got a similar problem and the qt sql libraries don't seem to be the fix.  I'm using F10 with Amarok 1.98 and attempting to import my previous data from my PostGreSQL database.  The database is online and accessible through other clients.  I've validated that I have the qt-postgresql-4.4.3-6.fc10.i386 PKG installed.  Yet, I continue to get the "could not open Amarok 1.4 database: Driver not loaded Driver not loaded postgres" error message upon import.

Any thoughts about where I should look next?


This one is actually easy to fix: You need to install the QtSQL-Postgres package, which provides the right driver. The importer uses QtSQL for reading, hence it needs that.


--
Mark Kretschmann - Amarok Developer
briccster
Registered Member
Posts
4
Karma
0

Re: Import Collection Woes

Sat Dec 06, 2008 7:52 pm
I can't find a QtSQL-Postgres package in any of the Fedora repositories.  I do have both qt and qt-postgresql installed.  Between these two packages, it seems that the necessary libraries are covered.  Actually, I think I've installed everything related to either Qt or PostGreSQLl that I can find.

[username@host ~]$ rpm -ql qt | grep -i qtsql
/usr/lib/libQtSql.so.4
/usr/lib/libQtSql.so.4.4
/usr/lib/libQtSql.so.4.4.3

[username@host ~]$ rpm -ql qt-postgresql
/usr/lib/qt4/plugins/sqldrivers/libqsqlpsql.so
briccster
Registered Member
Posts
4
Karma
0

Re: Import Collection Woes

Sat Dec 06, 2008 8:11 pm
Very weird.  It wasn't working at all, so I was grasping at solutions.  Since I typically use a Gnome desktop, I decided to log in with a KDE desktop.  After the KDE desktop was loaded, I launched Amarok2 and the import connected to the PostGreSQL database without issue.  The import on the other hand was only partially successful.  It crashed with a message about the backtrace not containing any useful info.  Oh well, a partial import is better than none at all.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], kde-naveen, Sogou [Bot], Yahoo [Bot]