Rename a function semantically
This commit is contained in:
parent
a97cb30d1c
commit
d9d82b77d4
|
@ -229,7 +229,7 @@ public class CacheCleaner
|
|||
for (DownloadFile downloadFile : downloader.getValue().getDownloads())
|
||||
{
|
||||
filesToNotDelete.add(downloadFile.getPartialFile());
|
||||
filesToNotDelete.add(downloadFile.getCompleteFile());
|
||||
filesToNotDelete.add(downloadFile.getCompleteOrSaveFile());
|
||||
}
|
||||
|
||||
filesToNotDelete.add(FileUtil.getMusicDirectory(context));
|
||||
|
|
|
@ -194,7 +194,7 @@ public class StreamProxy implements Runnable
|
|||
while (isRunning && !client.isClosed())
|
||||
{
|
||||
// See if there's more to send
|
||||
File file = downloadFile.isCompleteFileAvailable() ? downloadFile.getCompleteFile() : downloadFile.getPartialFile();
|
||||
File file = downloadFile.isCompleteFileAvailable() ? downloadFile.getCompleteOrSaveFile() : downloadFile.getPartialFile();
|
||||
int cbSentThisBatch = 0;
|
||||
|
||||
if (file.exists())
|
||||
|
|
|
@ -100,19 +100,16 @@ class DownloadFile(
|
|||
}
|
||||
}
|
||||
|
||||
fun getCompleteFile(): File {
|
||||
if (saveFile.exists()) {
|
||||
return saveFile
|
||||
}
|
||||
|
||||
return if (completeFile.exists()) {
|
||||
val completeOrSaveFile: File
|
||||
get() = if (saveFile.exists()) {
|
||||
saveFile
|
||||
} else {
|
||||
completeFile
|
||||
} else saveFile
|
||||
}
|
||||
}
|
||||
|
||||
val completeOrPartialFile: File
|
||||
get() = if (isCompleteFileAvailable) {
|
||||
getCompleteFile()
|
||||
completeOrSaveFile
|
||||
} else {
|
||||
partialFile
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue