mirror of
https://github.com/ultrasonic/ultrasonic
synced 2025-03-04 03:17:47 +01:00
Removed file existence check to improve performance
This commit is contained in:
parent
b16dde0b07
commit
1f7167e016
@ -60,11 +60,10 @@ public class FileUtil
|
||||
{
|
||||
File dir = getAlbumDirectory(context, song);
|
||||
|
||||
// If the song already exists, it isn't necessary to give it a name
|
||||
if (!TextUtils.isEmpty(song.getPath()))
|
||||
// Do not generate new name for offline files. Offline files will have their Path as their Id.
|
||||
if (!TextUtils.isEmpty(song.getId()))
|
||||
{
|
||||
File songFile = new File(String.format("%s/%s", getMusicDirectory(context).getPath(), fileSystemSafeDir(song.getPath())));
|
||||
if (songFile.exists() && songFile.isFile()) return songFile;
|
||||
if (song.getId().startsWith(dir.getAbsolutePath())) return new File(song.getId());
|
||||
}
|
||||
|
||||
// Generate a file name for the song
|
||||
|
Loading…
x
Reference in New Issue
Block a user