pull/137/head
FongMi 3 years ago
parent edce5a67da
commit 74f6f607bf
  1. 2
      app/src/main/java/com/fongmi/android/tv/utils/FileChooser.java
  2. 2
      catvod/src/main/java/com/github/catvod/utils/Path.java

@ -58,7 +58,7 @@ public class FileChooser {
if (DocumentsContract.isDocumentUri(context, uri)) path = getPathFromDocumentUri(context, uri);
else if (ContentResolver.SCHEME_CONTENT.equals(uri.getScheme())) path = getDataColumn(context, uri);
else if (ContentResolver.SCHEME_FILE.equalsIgnoreCase(uri.getScheme())) path = uri.getPath();
return path != null ? path : createFileFromUri(context, uri);
return path != null ? path.replace(Path.rootPath(), "") : createFileFromUri(context, uri);
}
private static String getPathFromDocumentUri(Context context, Uri uri) {

@ -113,7 +113,7 @@ public class Path {
public static File local(String path) {
File file1 = new File(path.replace("file:/", ""));
File file2 = new File(path.replace("file:/", rootPath()));
return file1.exists() ? file1 : file2.exists() ? file2 : new File(path);
return file2.exists() ? file2 : file1.exists() ? file1 : new File(path);
}
public static String asset(String fileName) {

Loading…
Cancel
Save