mirror of
https://github.com/playmusicexporter/playmusicexporter
synced 2024-05-29 02:50:00 +00:00
isAlreadyThere caused an IllegalArgumentException, when called with the default export path without enabling force overwrite.
This commit is contained in:
parent
dc87dc7c4b
commit
86e0b7c02a
|
@ -667,6 +667,11 @@ public class PlayMusicManager {
|
|||
* return true if the file already exists
|
||||
*/
|
||||
private boolean isAlreadyThere(Uri pUri, String pPath) {
|
||||
if (pUri.toString().startsWith("file://")) {
|
||||
//Old sdcard URI
|
||||
return FileTools.fileExists(pUri.buildUpon().appendPath(pPath).build().toString());
|
||||
} else {
|
||||
//Documents Provider URI
|
||||
DocumentFile lDocumentFile = DocumentFile.fromTreeUri(mContext, pUri);
|
||||
for (String lDisplayName : pPath.split("/")) {
|
||||
if (lDocumentFile.findFile(lDisplayName) != null) {
|
||||
|
@ -678,6 +683,7 @@ public class PlayMusicManager {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Copies the music file to a new path and adds the mp3 meta data
|
||||
|
|
Loading…
Reference in a new issue