Skip to content
Commit cf2346be authored by Andrés G. Aragoneses's avatar Andrés G. Aragoneses Committed by Bertrand Lorentz
Browse files

LibraryWatcher: avoid importing incomplete files



LibraryWatcher had a bug that is usually found in any library that uses
FileSystemWatcher API: handling files at the Creation event rather than
at the last Changed one (when the file transfer/creation has really been
finished in the watched folder). In Banshee this could have the effect
of trying to import incomplete files and not reading their tags
correctly obviously. This bug manifested itself much more clearly when
the new feature in bgo#664079 was implemented: warning when the user
tried to import an empty file (as this was implemented raising an
exception from the importing logic), causing the symptoms described in
bgo#666981.

With this fix we introduce a timer to delay the handling of the FSW
event just a small amount of time (10s), and we reset the timer every
time a Changed event happens, in order to handle the Create event
only at the last Changed event. This patch may even fix the broader
bug filed at bgo#655752.

Signed-off-by: default avatarBertrand Lorentz <bertrand.lorentz@gmail.com>
parent b1d59cb7
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment