修复第三方书源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); 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) -> { mSourceDialog.setOnSourceChangeListener((bean, pos) -> {
Book bookTem = (Book) mBook.clone(); Book bookTem = (Book) mBook.clone();
bookTem.clearCathe();
bookTem.setChapterUrl(bean.getChapterUrl()); bookTem.setChapterUrl(bean.getChapterUrl());
bookTem.setInfoUrl(bean.getInfoUrl()); bookTem.setInfoUrl(bean.getInfoUrl());
bookTem.setSource(bean.getSource());
if (!StringHelper.isEmpty(bean.getImgUrl())) { if (!StringHelper.isEmpty(bean.getImgUrl())) {
bookTem.setImgUrl(bean.getImgUrl()); bookTem.setImgUrl(bean.getImgUrl());
} }
@ -284,7 +286,6 @@ public class BookDetailedActivity extends BaseActivity {
if (!StringHelper.isEmpty(bean.getStatus())) { if (!StringHelper.isEmpty(bean.getStatus())) {
bookTem.setStatus(bean.getStatus()); bookTem.setStatus(bean.getStatus());
} }
bookTem.setSource(bean.getSource());
if (isCollected) { if (isCollected) {
mBookService.updateBook(mBook, bookTem); mBookService.updateBook(mBook, bookTem);
} }

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

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

Loading…
Cancel
Save