return true;
}
- @Override
- public String getSourceName() {
- return "FimFiction.net";
- }
-
/**
* Extract the full JSON data we will later use to build the {@link Story}.
*
meta.setAuthor(getKeyJson(json, 0, "type", "user", "name"));
meta.setDate(getKeyJson(json, 0, "type", "story", "date_published"));
meta.setTags(getTags());
- meta.setSource(getSourceName());
+ meta.setSource(getType().getSourceName());
meta.setUrl(getSource().toString());
- meta.setPublisher(getSourceName());
+ meta.setPublisher(getType().getSourceName());
meta.setUuid(getSource().toString());
meta.setLuid("");
meta.setLang("en");
String coverImageLink = getKeyJson(json, 0, "type", "story",
"cover_image", "full");
if (!coverImageLink.trim().isEmpty()) {
- InputStream in = null;
+ URL coverImageUrl = new URL(coverImageLink.trim());
+
+ // No need to use the oauth, cookies... for the cover
+ // Plus: it crashes on Android because of the referer
try {
- URL coverImageUrl = new URL(coverImageLink.trim());
- in = Instance.getCache().open(coverImageUrl, this, true);
- meta.setCover(new Image(in));
- } finally {
- in.close();
+ InputStream in = Instance.getCache().open(coverImageUrl, null,
+ true);
+ try {
+ meta.setCover(new Image(in));
+ } finally {
+ in.close();
+ }
+ } catch (IOException e) {
+ Instance.getTraceHandler().error(
+ new IOException(
+ "Cannot get the story cover, ignoring...", e));
}
}