mirror of
https://github.com/gedoor/legado.git
synced 2024-08-30 09:23:26 +08:00
优化
This commit is contained in:
parent
c8b4a9fe30
commit
461664be81
@ -69,8 +69,7 @@ public class EpubReader {
|
|||||||
*/
|
*/
|
||||||
public EpubBook readEpubLazy(@NonNull ZipFile zipFile, @NonNull String encoding)
|
public EpubBook readEpubLazy(@NonNull ZipFile zipFile, @NonNull String encoding)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
return readEpubLazy(zipFile, encoding,
|
return readEpubLazy(zipFile, encoding, Arrays.asList(MediaTypes.mediaTypes));
|
||||||
Arrays.asList(MediaTypes.mediaTypes));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public EpubBook readEpub(@NonNull ZipInputStream in, @NonNull String encoding) throws IOException {
|
public EpubBook readEpub(@NonNull ZipInputStream in, @NonNull String encoding) throws IOException {
|
||||||
@ -107,8 +106,7 @@ public class EpubReader {
|
|||||||
}
|
}
|
||||||
handleMimeType(result, resources);
|
handleMimeType(result, resources);
|
||||||
String packageResourceHref = getPackageResourceHref(resources);
|
String packageResourceHref = getPackageResourceHref(resources);
|
||||||
Resource packageResource = processPackageResource(packageResourceHref,
|
Resource packageResource = processPackageResource(packageResourceHref, result, resources);
|
||||||
result, resources);
|
|
||||||
result.setOpfResource(packageResource);
|
result.setOpfResource(packageResource);
|
||||||
Resource ncxResource = processNcxResource(packageResource, result);
|
Resource ncxResource = processNcxResource(packageResource, result);
|
||||||
result.setNcxResource(ncxResource);
|
result.setNcxResource(ncxResource);
|
||||||
|
@ -46,9 +46,11 @@ public class ResourcesLoader {
|
|||||||
* @return Resources
|
* @return Resources
|
||||||
* @throws IOException IOException
|
* @throws IOException IOException
|
||||||
*/
|
*/
|
||||||
public static Resources loadResources(ZipFile zipFile,
|
public static Resources loadResources(
|
||||||
String defaultHtmlEncoding,
|
ZipFile zipFile,
|
||||||
List<MediaType> lazyLoadedTypes) throws IOException {
|
String defaultHtmlEncoding,
|
||||||
|
List<MediaType> lazyLoadedTypes
|
||||||
|
) throws IOException {
|
||||||
|
|
||||||
LazyResourceProvider resourceProvider =
|
LazyResourceProvider resourceProvider =
|
||||||
new EpubResourceProvider(zipFile.getName());
|
new EpubResourceProvider(zipFile.getName());
|
||||||
|
Loading…
Reference in New Issue
Block a user