RuudBurger/CouchPotatoServer — pull request #2289 by rbfblk (2013-10-02 02:22:24+00:00)
Title: Fix for completed uTorrent downloads having read permissions stripped on Linux

The fix for #1871 introduced a bug on Linux which strips read permissions from completed uTorrent downloads. If the downloaded file does not have its own directory then this also strips read permissions from all other files in the downloads directory, recursively. This PR includes a fix to add user write perms as intended while preserving existing permission bits on Linux. It should not change behavior on Windows (though I have not tested) since all other bits should be ignored in Windows os.chmod.