Fix disowned parsing

This commit is contained in:
小白-白 authored and tarsin committed 2022-12-05 18:05:16 +08:00
1 parent dae7dacf3d
commit 36f00ab568
3 files changed
+13 -3

No files matched your search

@@ -178,7 +178,7 @@ public class GalleryDetailParser {
// Uploader
Element gdn = gm.getElementById("gdn");
if (null != gdn) {
gd.disowned = "opacity:0.5".equals(gdn.attr("style"));
gd.disowned = gdn.attr("style").contains("opacity:0.5");
gd.uploader = StringUtils.trim(gdn.text());
} else {
gd.uploader = "";
@@ -254,10 +254,12 @@ public class GalleryListParser {
if (children.size() > uploaderIndex) {
Element div = children.get(uploaderIndex);
if (div != null) {
gi.disowned = "opacity:0.5".equals(div.attr("style"));
gi.disowned = div.attr("style").contains("opacity:0.5");
Element a = div.children().first();
if (a != null) {
gi.uploader = a.text().trim();
} else {
gi.uploader = div.text().trim();
}
}
}
@@ -412,6 +412,11 @@ public class GalleryDetailScene extends CollapsingToolbarScene implements View.O
}
}
// Judging by the uploader to exclude the cooldown period
private boolean getDisowned() {
return getUploader().equals("(Disowned)");
}
// -1 for error
private int getCategory() {
if (mGalleryDetail != null) {
@@ -1121,7 +1126,7 @@ public class GalleryDetailScene extends CollapsingToolbarScene implements View.O
}
} else if (mUploader == v) {
String uploader = getUploader();
if (TextUtils.isEmpty(uploader)) {
if (TextUtils.isEmpty(uploader) || getDisowned()) {
return;
}
ListUrlBuilder lub = new ListUrlBuilder();
@@ -1426,6 +1431,9 @@ public class GalleryDetailScene extends CollapsingToolbarScene implements View.O
}
if (mUploader == v) {
if (TextUtils.isEmpty(getUploader()) || getDisowned()) {
return false;
}
showFilterUploaderDialog();
} else if (mDownload == v) {
GalleryInfo galleryInfo = getGalleryInfo();