sampsyo/beets — pull request #511 by brilnius (2014-01-28 13:24:50+00:00)
Title: Do not write file tags when DB tags are not modified

As recommended I submit again my second proposal as a separate pull request.

In summary: during beet modify processing, don't write file tags unless DB tags are modified.

Advantages:
- Optimization: fewer file write operations
- We don't have anymore the situation where the modification time on the file system is changed whereas the content of the file is not

Additional comments:
The second advantage was the driver for me: I regularly update lots of files (audio but also video and photos) between my PC and my media server, using rsync -u. For ex. launching "beet modify beatles genre=pop" was not only updating the files of the last added album, but all the previous ones, causing a lot of files to be updated during the following rsync.

At the beginning I put a configuration parameter to disable this "optimization" because I thought the Beets philosophy was that the file tags must always be consistent with what is in the DB (so my optimization was not for general use). But to obtain this, we just need to launch "beet write". The configuration parameter is now removed and the optimization is always performed.