1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-05 19:42:17 +02:00

related catalog links

This commit is contained in:
Nikolay Pultsin 2012-02-18 02:06:16 +00:00
parent 05133e0063
commit a7bd1ddb95
5 changed files with 7 additions and 6 deletions

View file

@ -1,6 +1,7 @@
===== 1.3.8 (Feb ??, 2012) =====
* striked through/underlined text support
* asynchronous bonjour scanning: user can select any found network even if scanning is still in progress
* better support for "related" catalogs in book descriptions
===== 1.3.7 (Feb 9, 2012) =====
* Font smoothing settings (Settings -> Text -> Font properties)

View file

@ -125,7 +125,7 @@ public class OPDSBookItem extends NetworkBookItem implements OPDSConstants {
if (MimeType.IMAGE_PNG.equals(type) || MimeType.IMAGE_JPEG.equals(type)) {
urls.addInfo(new UrlInfo(UrlInfo.Type.Image, href));
}
} else if (MimeType.APP_ATOM.Name.equals(type.Name) &&
} else if (MimeType.APP_ATOM.weakEquals(type) &&
"entry".equals(type.getParameter("type"))) {
urls.addInfo(new UrlInfo(UrlInfo.Type.SingleEntry, href));
} else if (UrlInfo.Type.BookBuy == referenceType) {
@ -273,7 +273,7 @@ public class OPDSBookItem extends NetworkBookItem implements OPDSConstants {
@Override
public OPDSCatalogItem createRelatedCatalogItem(RelatedUrlInfo info) {
if (MimeType.APP_ATOM.equals(info.Mime)) {
if (MimeType.APP_ATOM.weakEquals(info.Mime)) {
return new OPDSCatalogItem((OPDSNetworkLink)Link, info);
}
return null;

View file

@ -55,7 +55,7 @@ class OPDSCatalogInfoHandler extends AbstractOPDSFeedHandler {
if ("search".equals(rel)) {
if (MimeType.APP_OPENSEARCHDESCRIPTION.equals(type)) {
myOpensearchDescriptionURLs.add(ZLNetworkUtil.url(myBaseURL, link.getHref()));
} else if (MimeType.APP_ATOM.equals(type)) {
} else if (MimeType.APP_ATOM.weakEquals(type)) {
final String template = ZLNetworkUtil.url(myBaseURL, link.getHref());
final OpenSearchDescription descr = OpenSearchDescription.createDefault(template);
if (descr.isValid()) {

View file

@ -95,11 +95,11 @@ class OPDSLinkXMLReader extends OPDSXMLReader implements OPDSConstants {
infos.addInfo(new UrlInfoWithDate(UrlInfo.Type.Image, href));
}
} else if (rel == null) {
if (MimeType.APP_ATOM.equals(type)) {
if (MimeType.APP_ATOM.weakEquals(type)) {
infos.addInfo(new UrlInfoWithDate(UrlInfo.Type.Catalog, href));
}
} else if (rel == "search") {
if (MimeType.APP_ATOM.equals(type)) {
if (MimeType.APP_ATOM.weakEquals(type)) {
final OpenSearchDescription descr = OpenSearchDescription.createDefault(href);
if (descr.isValid()) {
// TODO: May be do not use '%s'??? Use Description instead??? (this needs to rewrite SEARCH engine logic a little)

View file

@ -105,7 +105,7 @@ class OpenSearchXMLReader extends ZLXMLReaderAdapter {
if (tagPrefix == myOpenSearchNamespaceId && tag == TAG_URL) {
final MimeType type = MimeType.get(attributes.getValue("type"));
final String rel = attributes.getValue("rel");
if (MimeType.APP_ATOM.equals(type)
if (MimeType.APP_ATOM.weakEquals(type)
&& (rel == null || rel == "results")) {
final String template = ZLNetworkUtil.url(myBaseURL, attributes.getValue("template"));
final int indexOffset = parseInt(attributes.getValue("indexOffset"));