mirror of
https://github.com/gedoor/legado.git
synced 2024-07-06 23:47:49 +08:00
优化
This commit is contained in:
parent
900bc3876c
commit
9009e32c87
@ -26,6 +26,7 @@ public class Resources implements Serializable {
|
|||||||
private static final long serialVersionUID = 2450876953383871451L;
|
private static final long serialVersionUID = 2450876953383871451L;
|
||||||
private static final String IMAGE_PREFIX = "image_";
|
private static final String IMAGE_PREFIX = "image_";
|
||||||
private static final String ITEM_PREFIX = "item_";
|
private static final String ITEM_PREFIX = "item_";
|
||||||
|
private static final Pattern dataUriRegex = Pattern.compile("data:([\\w/\\-\\.]+);base64,(.*)");
|
||||||
private int lastId = 1;
|
private int lastId = 1;
|
||||||
|
|
||||||
private Map<String, Resource> resources = new HashMap<>();
|
private Map<String, Resource> resources = new HashMap<>();
|
||||||
@ -320,7 +321,6 @@ public class Resources implements Serializable {
|
|||||||
}
|
}
|
||||||
href = StringUtil.substringBefore(href, Constants.FRAGMENT_SEPARATOR_CHAR);
|
href = StringUtil.substringBefore(href, Constants.FRAGMENT_SEPARATOR_CHAR);
|
||||||
|
|
||||||
Pattern dataUriRegex = Pattern.compile("data:([\\w/\\-\\.]+);base64,(.*)");
|
|
||||||
Matcher dataUriMatcher = dataUriRegex.matcher(href);
|
Matcher dataUriMatcher = dataUriRegex.matcher(href);
|
||||||
if (dataUriMatcher.find()) {
|
if (dataUriMatcher.find()) {
|
||||||
String dataUriMediaTypeString = dataUriMatcher.group(1);
|
String dataUriMediaTypeString = dataUriMatcher.group(1);
|
||||||
|
@ -89,8 +89,7 @@ public class PackageDocumentReader extends PackageDocumentBase {
|
|||||||
for (int i = 0; i < originItemElements.getLength(); i++) {
|
for (int i = 0; i < originItemElements.getLength(); i++) {
|
||||||
Element itemElement = (Element) originItemElements.item(i);
|
Element itemElement = (Element) originItemElements.item(i);
|
||||||
fixedElements.add(itemElement);
|
fixedElements.add(itemElement);
|
||||||
String href = DOMUtil
|
String href = DOMUtil.getAttribute(itemElement, NAMESPACE_OPF, OPFAttributes.href);
|
||||||
.getAttribute(itemElement, NAMESPACE_OPF, OPFAttributes.href);
|
|
||||||
try {
|
try {
|
||||||
href = URLDecoder.decode(href, Constants.CHARACTER_ENCODING);
|
href = URLDecoder.decode(href, Constants.CHARACTER_ENCODING);
|
||||||
} catch (UnsupportedEncodingException e) {
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user