X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Fgofetch%2Fsupport%2FBasicSupport.java;h=b15fac7e5e2598d0d67c3bcf493c6dae03a0a8a1;hb=b9afb12e17825f363d3679fcac75095fb1e9dc6d;hp=6d930f6f4320bbeae13a14d098f846fa289fd96b;hpb=b34d1f357b076c1697e381b70cb6ff1bb0278b91;p=gofetch.git diff --git a/src/be/nikiroo/gofetch/support/BasicSupport.java b/src/be/nikiroo/gofetch/support/BasicSupport.java index 6d930f6..b15fac7 100644 --- a/src/be/nikiroo/gofetch/support/BasicSupport.java +++ b/src/be/nikiroo/gofetch/support/BasicSupport.java @@ -45,6 +45,8 @@ public abstract class BasicSupport { REGISTER, /** FR: Linux */ TOO_LINUX, + /** FR: IT */ + ERE_NUMERIQUE, } /** @@ -98,6 +100,17 @@ public abstract class BasicSupport { * the usual automatic processing if not NULL */ public String manualProcessing(Node node); + + /** + * This {@link Node} is a subtitle and should be treated as such + * (highlighted). + * + * @param node + * the node to check + * + * @return NULL if it is not a subtitle, the subtitle to use if it is + */ + public String isSubtitle(Node node); } /** @@ -126,6 +139,11 @@ public abstract class BasicSupport { public String manualProcessing(Node node) { return null; } + + @Override + public String isSubtitle(Node node) { + return null; + } } static private String preselector; @@ -238,6 +256,9 @@ public abstract class BasicSupport { case TOO_LINUX: support = new TooLinux(); break; + case ERE_NUMERIQUE: + support = new EreNumerique(); + break; } if (support != null) { @@ -329,6 +350,7 @@ public abstract class BasicSupport { String manual = null; boolean ignore = elementProcessor.ignoreNode(node) || ignoredNodes.contains(node.parentNode()); + // Manual processing if (!ignore) { manual = elementProcessor.manualProcessing(node); if (manual != null) { @@ -337,6 +359,16 @@ public abstract class BasicSupport { } } + // Subtitle check + if (!ignore) { + String subtitle = elementProcessor.isSubtitle(node); + if (subtitle != null) { + subtitle = subtitle.trim(); + currentLine.append("\n[ " + subtitle + " ]\n"); + ignore = true; + } + } + if (ignore) { ignoredNodes.add(node); return; @@ -430,7 +462,7 @@ public abstract class BasicSupport { long epoch = 0; try { - epoch = Long.parseLong(date); + epoch = Long.parseLong(date.trim()); } catch (Exception e) { epoch = 0; }