mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 10:19:33 +02:00
better in-book link processing
This commit is contained in:
parent
27e76123d9
commit
351548fdcd
5 changed files with 43 additions and 23 deletions
|
@ -136,4 +136,20 @@ public abstract class Util implements UserRegistrationConstants {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
public static Uri rewriteUri(Uri uri) {
|
||||
if (uri == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ("http".equals(uri.getScheme()) &&
|
||||
"www.litres.ru".equals(uri.getHost()) &&
|
||||
"/pages/biblio_book/".equals(uri.getPath())) {
|
||||
final String bookId = uri.getQueryParameter("art");
|
||||
if (bookId != null && !"".equals(bookId)) {
|
||||
return Uri.parse("litres-book://data.fbreader.org/catalogs/litres2/full.php5?id=" + bookId);
|
||||
}
|
||||
}
|
||||
return uri;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue