修复第三方书源bug

master
fengyuecanzhu 3 years ago
parent dadf1853ba
commit 5e83f6f45d
  1. 6
      app/src/main/java/xyz/fycz/myreader/greendao/entity/Book.java
  2. 3
      app/src/main/java/xyz/fycz/myreader/ui/activity/BookDetailedActivity.java
  3. 1
      app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java
  4. 2
      app/src/main/java/xyz/fycz/myreader/util/help/JsExtensions.java

@ -413,4 +413,10 @@ public class Book implements Serializable {
}
return catheMap.get(key);
}
public void clearCathe(){
if (catheMap != null) {
catheMap.clear();
}
}
}

@ -264,8 +264,10 @@ public class BookDetailedActivity extends BaseActivity {
//换源对话框
mSourceDialog.setOnSourceChangeListener((bean, pos) -> {
Book bookTem = (Book) mBook.clone();
bookTem.clearCathe();
bookTem.setChapterUrl(bean.getChapterUrl());
bookTem.setInfoUrl(bean.getInfoUrl());
bookTem.setSource(bean.getSource());
if (!StringHelper.isEmpty(bean.getImgUrl())) {
bookTem.setImgUrl(bean.getImgUrl());
}
@ -284,7 +286,6 @@ public class BookDetailedActivity extends BaseActivity {
if (!StringHelper.isEmpty(bean.getStatus())) {
bookTem.setStatus(bean.getStatus());
}
bookTem.setSource(bean.getSource());
if (isCollected) {
mBookService.updateBook(mBook, bookTem);
}

@ -479,6 +479,7 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe
mSourceDialog.setOnSourceChangeListener((bean, pos) -> {
Book bookTem = (Book) mBook.clone();
bookTem.clearCathe();
bookTem.setInfoUrl(bean.getInfoUrl());
bookTem.setChapterUrl(bean.getChapterUrl());
bookTem.setSource(bean.getSource());

@ -33,8 +33,6 @@ import xyz.fycz.myreader.util.utils.OkHttpUtils;
import xyz.fycz.myreader.util.utils.StringUtils;
@Keep
@SuppressWarnings({"unused"})
public interface JsExtensions {
String TAG = JsExtensions.class.getSimpleName();

Loading…
Cancel
Save