Fixed file name generator

fixes #580
This commit is contained in:
daniel oeh 2014-12-28 14:11:36 +01:00
parent 60dcf4865a
commit c33081b909
1 changed files with 2 additions and 1 deletions

View File

@ -92,8 +92,9 @@ public class DownloadRequester {
private void download(Context context, FeedFile item, FeedFile container, File dest, private void download(Context context, FeedFile item, FeedFile container, File dest,
boolean overwriteIfExists, String username, String password, boolean deleteOnFailure, Bundle arguments) { boolean overwriteIfExists, String username, String password, boolean deleteOnFailure, Bundle arguments) {
final boolean partiallyDownloadedFileExists = item.getFile_url() != null;
if (!isDownloadingFile(item)) { if (!isDownloadingFile(item)) {
if (!isFilenameAvailable(dest.toString()) || (deleteOnFailure && dest.exists())) { if (!isFilenameAvailable(dest.toString()) || (!partiallyDownloadedFileExists && dest.exists())) {
if (BuildConfig.DEBUG) if (BuildConfig.DEBUG)
Log.d(TAG, "Filename already used."); Log.d(TAG, "Filename already used.");
if (isFilenameAvailable(dest.toString()) && overwriteIfExists) { if (isFilenameAvailable(dest.toString()) && overwriteIfExists) {