* 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);
}
/**
public String manualProcessing(Node node) {
return null;
}
+
+ @Override
+ public String isSubtitle(Node node) {
+ return null;
+ }
}
static private String preselector;
String manual = null;
boolean ignore = elementProcessor.ignoreNode(node)
|| ignoredNodes.contains(node.parentNode());
+ // Manual processing
if (!ignore) {
manual = elementProcessor.manualProcessing(node);
if (manual != null) {
}
}
+ // 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;
long epoch = 0;
try {
- epoch = Long.parseLong(date);
+ epoch = Long.parseLong(date.trim());
} catch (Exception e) {
epoch = 0;
}