修复json格式书源无法导入的bug

master v2.2.5
fengyuecanzhu 3 years ago
parent 09b349c72a
commit c28786f88a
  1. 2
      app/src/main/java/xyz/fycz/myreader/ui/fragment/DIYSourceFragment.java

@ -327,7 +327,7 @@ public class DIYSourceFragment extends BaseFragment {
Single.create((SingleOnSubscribe<String>) emitter -> {
// String json = FileUtils.readInStream(DocumentUtil.getFileInputSteam(getContext(), data.getData()));
DocumentFile file = DocumentFile.fromSingleUri(getContext(), data.getData());
if (!file.getName().endsWith(".txt") && !file.getType().endsWith(".json")) {
if (!file.getName().endsWith(".txt") && !file.getName().endsWith(".json")) {
emitter.onError(new Throwable("文件格式错误"));
return;
}

Loading…
Cancel
Save