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())
|
for (DownloadFile downloadFile : downloader.getValue().getDownloads())
|
||||||
{
|
{
|
||||||
filesToNotDelete.add(downloadFile.getPartialFile());
|
filesToNotDelete.add(downloadFile.getPartialFile());
|
||||||
filesToNotDelete.add(downloadFile.getCompleteFile());
|
filesToNotDelete.add(downloadFile.getCompleteOrSaveFile());
|
||||||
}
|
}
|
||||||
|
|
||||||
filesToNotDelete.add(FileUtil.getMusicDirectory(context));
|
filesToNotDelete.add(FileUtil.getMusicDirectory(context));
|
||||||
|
|
|
@ -194,7 +194,7 @@ public class StreamProxy implements Runnable
|
||||||
while (isRunning && !client.isClosed())
|
while (isRunning && !client.isClosed())
|
||||||
{
|
{
|
||||||
// See if there's more to send
|
// 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;
|
int cbSentThisBatch = 0;
|
||||||
|
|
||||||
if (file.exists())
|
if (file.exists())
|
||||||
|
|
|
@ -100,19 +100,16 @@ class DownloadFile(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getCompleteFile(): File {
|
val completeOrSaveFile: File
|
||||||
if (saveFile.exists()) {
|
get() = if (saveFile.exists()) {
|
||||||
return saveFile
|
saveFile
|
||||||
}
|
} else {
|
||||||
|
|
||||||
return if (completeFile.exists()) {
|
|
||||||
completeFile
|
completeFile
|
||||||
} else saveFile
|
}
|
||||||
}
|
|
||||||
|
|
||||||
val completeOrPartialFile: File
|
val completeOrPartialFile: File
|
||||||
get() = if (isCompleteFileAvailable) {
|
get() = if (isCompleteFileAvailable) {
|
||||||
getCompleteFile()
|
completeOrSaveFile
|
||||||
} else {
|
} else {
|
||||||
partialFile
|
partialFile
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue