]> git.tuebingen.mpg.de Git - paraslash.git/commit
aft: Generate a remove event when adding duplicate files.
authorAndre Noll <maan@tuebingen.mpg.de>
Wed, 24 Dec 2014 15:10:43 +0000 (15:10 +0000)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 11 Jan 2015 14:56:27 +0000 (15:56 +0100)
commita092ce3940929f594d1f55d945cf43081706fb4b
tree742a967d525629109b5702d64ed0db1abaa6fa48
parentbc0e339169727c602b3e3939be494fa67b0e5b79
aft: Generate a remove event when adding duplicate files.

Consider the following scenario:

add /foo.mp3
add /bar.mp3 # assume foo and bar differ
cp /foo.mp3 /bar.mp3
add /bar.mp3

In the last add command, the path being added (/bar.mp3) already exists
in the audio file table, and its hash also exists for a different path
(/foo.mp3).

The code in aft.c is smart enough to detect this. It first removes
the existing entry for /bar.mp3 and then considers the addition of
/bar.mp3 as a file rename /foo.mp3 -> /bar.mp3.

Unfortunately, we miss to generate the remove event in this case. This
patch should fix it. It also improves the message a bit.
aft.c