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);
|
File dir = getAlbumDirectory(context, song);
|
||||||
|
|
||||||
// If the song already exists, it isn't necessary to give it a name
|
// Do not generate new name for offline files. Offline files will have their Path as their Id.
|
||||||
if (!TextUtils.isEmpty(song.getPath()))
|
if (!TextUtils.isEmpty(song.getId()))
|
||||||
{
|
{
|
||||||
File songFile = new File(String.format("%s/%s", getMusicDirectory(context).getPath(), fileSystemSafeDir(song.getPath())));
|
if (song.getId().startsWith(dir.getAbsolutePath())) return new File(song.getId());
|
||||||
if (songFile.exists() && songFile.isFile()) return songFile;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate a file name for the song
|
// Generate a file name for the song
|
||||||
|
|
Loading…
Reference in New Issue