Fwd: Incremental scanning

Myriam Schweingruber myriam at kde.org
Wed Feb 1 14:45:24 UTC 2012


This belongs to the developers list I think, not to the support list.

Regards, Myriam


---------- Forwarded message ----------
From: Ville Ranki <ville.ranki at iki.fi>
Date: Wed, Feb 1, 2012 at 14:31
Subject: Incremental scanning
To: amarok at kde.org



Hello,

I've been implementing incremental scanning for Amarok.

Reason for this is that with large connection on a slow
network share (sftp over ADSL for example) scanning can
take hours. Also currently all scanned files are lost if
scanning is interrupted. Even if it would takes few minutes
to scan entire collection, it is good usability to be
able to start playing something as soon as Amarok is
started.

I have modified amarokcollectionscanner to output one
XML block for each scanned directory and ScanManager
to parse this data on the fly.

Everything works well up to this point when i give
Directory instances to result processor. In this
example i have 2 directories with files in database.

(scanner scans first directory)

Following errors are outputted for each file:

[WARNING] [SqlScanResultProcessor] Found urls entry without directory. A
phantom track. Removing
"amarok-sqltrackuid://1ca15c03e1fe38d324e128f81afc39a0"
amarok:     [SqlScanResultProcessor] deleteTrack
"amarok-sqltrackuid://1ca15c03e1fe38d324e128f81afc39a0" url id 107
amarok:     [WARNING] [MountPointManager] Device  0  not in database,
this should never happen!

(second directory is scanned)

For each track:
 [SqlScanResultProcessor] deleteTrack
"amarok-sqltrackuid://a15cea27a3d60e37bcee8493e5efcbec" url id 101

In GUI only second directory is visible. Documentation
on SqlScanResultProcessor is a bit vague. I suppose
i am using it wrong.

The following is done for each directory. I understood that
ScanResultProcessor shouldn't be re-used so it's instantieted
for each directory.

ScanResultProcessor *processor = m_collection->getNewScanResultProcessor();
processor->setType( m_scanType );

CollectionScanner::Directory *dir = new CollectionScanner::Directory(
&blockReader );
processor->addDirectory( dir );
processor->commit();
delete processor;

Any ideas what might be wrong?

--
Ville Ranki <ville.ranki at iki.fi>
http://www.iki.fi/~cos

_______________________________________________
Amarok mailing list
Amarok at kde.org
https://mail.kde.org/mailman/listinfo/amarok



-- 
Proud member of the Amarok and KDE Community
Protect your freedom and join the Fellowship of FSFE:
http://www.fsfe.org
Please don't send me proprietary file formats,
use ISO standard ODF instead (ISO/IEC 26300)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ville_ranki.vcf
Type: text/x-vcard
Size: 150 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/amarok-devel/attachments/20120201/75a9e6e2/attachment.vcf>


More information about the Amarok-devel mailing list