Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #6 (assigned enhancement)

Opened 4 years ago

Last modified 4 years ago

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:1 Changed 4 years ago by stuarth

  • Status changed from new to assigned

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:

Eric Sandeen wrote:

Hi Stuart - was very glad to see your plugin!

I'm running the 7.1 server now, so had to tweak the plugin maxVersion... but seems fine so far.

One minor thing, if I:

# mv dir/ /mnt/slimserver/media/

it picks up the new dir just fine, but then

# mv /mnt/slimserver/media/dir /mnt/slimserver/media/A/dir

it doesn't seem to grok that the (now-moved) /mnt/slimserver/media/dir path should be removed from the database...?

anyway, it's all pretty cool so far, I'll read up on it a bit and see if it's possible to handle the moved dirs as above.

ah, I see you have a ticket already :)

Do you know whether, if you "mv ./parent/child ." you can tell the slimserver to rescan ./parent/child (the now-non-existing dir) and it'll find that it's gone, and delete it from the db? or does it have to rescan ./parent to find that out?

-Eric

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 :)

comment:3 Changed 4 years ago by stuarth

  • Milestone changed from Release v1.1 to Release v1.0
Note: See TracTickets for help on using tickets.