release
FongMi 1 year ago
parent db2d3ae335
commit 2642b1d3c7
  1. 2
      app/src/main/java/com/fongmi/android/tv/server/process/Local.java
  2. 6
      catvod/src/main/java/com/github/catvod/utils/Path.java

@ -45,7 +45,7 @@ public class Local implements Process {
private Response getFile(Map<String, String> headers, String path) {
try {
File file = Path.root(path.substring(5));
File file = Path.local(path.substring(5));
if (file.isDirectory()) return getFolder(file);
if (file.isFile()) return getFile(headers, file, NanoHTTPD.getMimeTypeForFile(path));
throw new FileNotFoundException();

@ -121,9 +121,9 @@ 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 file2.exists() ? file2 : file1.exists() ? file1 : new File(path);
path = path.replace("file:/", "");
File file = new File(root(), path);
return file.exists() ? file : new File(path);
}
public static String read(File file) {

Loading…
Cancel
Save