Ehviewer_CN_SXJ icon indicating copy to clipboard operation
Ehviewer_CN_SXJ copied to clipboard

下载功能-从“本地恢复”的问题

Open junwense opened this issue 9 months ago • 1 comments

今天没事点了测了下恢复,后续看了下源码,感觉是按25条分批处理提交api(EhEngine.java .fillGalleryListByApi)去查询,但是这里如果有一笔错了就会中断导致停止,而且我看获取文件的时候一次性获取所有的uri是不是可能会oom,因为我测试的时候本地2w多文件夹(主要是对这个项目不太了解,只能勉勉强强看懂,不然可以尝试改下)

报错的日志如下,

5-11 02:53:27.153 25718 25841 W System.err: org.json.JSONException: No value for title 05-11 02:53:27.159 25718 25841 W System.err: at org.json.JSONObject.get(JSONObject.java:398) 05-11 02:53:27.159 25718 25841 W System.err: at org.json.JSONObject.getString(JSONObject.java:559) 05-11 02:53:27.160 25718 25841 W System.err: at com.hippo.ehviewer.client.parser.GalleryApiParser.parse(GalleryApiParser.java:42) 05-11 02:53:27.160 25718 25841 W System.err: at com.hippo.ehviewer.client.EhEngine.doFillGalleryListByApi(EhEngine.java:342) 05-11 02:53:27.160 25718 25841 W System.err: at com.hippo.ehviewer.client.EhEngine.fillGalleryListByApi(EhEngine.java:299) 05-11 02:53:27.160 25718 25841 W System.err: at com.hippo.ehviewer.preference.RestoreDownloadPreference$RestoreTask.doInBackground(RestoreDownloadPreference.java:138) 05-11 02:53:27.160 25718 25841 W System.err: at com.hippo.ehviewer.preference.RestoreDownloadPreference$RestoreTask.doInBackground(RestoreDownloadPreference.java:66) 05-11 02:53:27.160 25718 25841 W System.err: at android.os.AsyncTask$3.call(AsyncTask.java:394) 05-11 02:53:27.160 25718 25841 W System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:264) 05-11 02:53:27.160 25718 25841 W System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 05-11 02:53:27.160 25718 25841 W System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) 05-11 02:53:27.160 25718 25841 W System.err: at java.lang.Thread.run(Thread.java:1012) 05-11 02:53:27.160 25718 25841 W System.err: at com.hippo.yorozuya.thread.PriorityThread.run(PriorityThread.java:38) 05-11 02:53:27.160 25718 25841 W System.err: org.json.JSONException: No value for title 05-11 02:53:27.160 25718 25841 W System.err: at org.json.JSONObject.get(JSONObject.java:398) 05-11 02:53:27.160 25718 25841 W System.err: at org.json.JSONObject.getString(JSONObject.java:559) 05-11 02:53:27.160 25718 25841 W System.err: at com.hippo.ehviewer.client.parser.GalleryApiParser.parse(GalleryApiParser.java:42) 05-11 02:53:27.160 25718 25841 W System.err: at com.hippo.ehviewer.client.EhEngine.doFillGalleryListByApi(EhEngine.java:342) 05-11 02:53:27.160 25718 25841 W System.err: at com.hippo.ehviewer.client.EhEngine.fillGalleryListByApi(EhEngine.java:299) 05-11 02:53:27.160 25718 25841 W System.err: at com.hippo.ehviewer.preference.RestoreDownloadPreference$RestoreTask.doInBackground(RestoreDownloadPreference.java:138) 05-11 02:53:27.160 25718 25841 W System.err: at com.hippo.ehviewer.preference.RestoreDownloadPreference$RestoreTask.doInBackground(RestoreDownloadPreference.java:66) 05-11 02:53:27.160 25718 25841 W System.err: at android.os.AsyncTask$3.call(AsyncTask.java:394) 05-11 02:53:27.161 25718 25841 W System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:264) 05-11 02:53:27.161 25718 25841 W System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 05-11 02:53:27.161 25718 25841 W System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) 05-11 02:53:27.161 25718 25841 W System.err: at java.lang.Thread.run(Thread.java:1012) 05-11 02:53:27.161 25718 25841 W System.err: at com.hippo.yorozuya.thread.PriorityThread.run(PriorityThread.java:38

junwense avatar May 11 '24 01:05 junwense

而且我检查了此方法最后调用的RestoreDownloadPreference.class.RestoreDownloadPreference,这个方法里面好像关于ehdb数据库的insert方法都被注释掉了,是展示不支持此类功能了么

junwense avatar May 11 '24 02:05 junwense

你可以试着提交一个pull request

xiaojieonly avatar May 13 '24 02:05 xiaojieonly