Ticket #6 (assigned enhancement)
Support file deletions
| Reported by: | stuarth | Owned by: | stuarth |
|---|---|---|---|
| Priority: | major | Milestone: | Release v1.0 |
| Component: | Plugin | Version: | |
| Keywords: | Cc: |
Description
We currently don't handle deletion events. This has the side-effect that file moves cause a duplicate as the old entry will remain.
Change History
comment:2 Changed 4 years ago by stuarth
Some more helpful information from Eric:
I added some debugging, and changed the logic just a bit; moving "child" back and forth then yielded:
Directory detected as moved from: /mnt/media/Music/Slimserver/mp3s-eMusic/parent/child Directory detected as moved in: /mnt/media/Music/Slimserver/mp3s-eMusic/child Triggering RESCAN of folder: /mnt/media/Music/Slimserver/mp3s-eMusic/child Triggering RESCAN of folder: /mnt/media/Music/Slimserver/mp3s-eMusic/parent/child
Directory detected as moved from: /mnt/media/Music/Slimserver/mp3s-eMusic/child Directory detected as moved in: /mnt/media/Music/Slimserver/mp3s-eMusic/parent/child Triggering RESCAN of folder: /mnt/media/Music/Slimserver/mp3s-eMusic/child Triggering RESCAN of folder: /mnt/media/Music/Slimserver/mp3s-eMusic/parent/child
but after putting real content into those dirs, telling SC to rescan the now-missing directory didn't seem to remove it from the db. Feel free to double-check though :)

I had a relevant conversation with Eric on this topic:
I think that's what the problem is - I was half-way through writing a patch to how SC detected and removed deleted (or moved) tracks from the database when I discovered code in there already. It looked like it should work, but I've not seen it perform very well when I've been trying to provoke it.
I've got some time off work next week - I've been lazy about getting some more work done on this plugin so I'll take a look at it then.
As for "mv ./parent/child .", that should actually cause two events - one for the modification of "./parent" to remove the subdir and one for the modification of "." to add it. I don't think the removal event will identify what was removed, though, so that will make it tricky if you need to ask SC to rescan "./parent/child" to notice it. It's an interesting idea, though, and may explain why it isn't working. I'll take a look at that (and copy these notes into the ticket so I don't forget!).
Stuart
Eric Sandeen wrote: