add current year to filtering context

This commit is contained in:
Athou
2018-02-25 13:37:41 +01:00
parent a4cd3f26e8
commit a7665a9994

View File

@@ -1,5 +1,6 @@
package com.commafeed.backend.service;
import java.time.Year;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
@@ -91,6 +92,8 @@ public class FeedEntryFilteringService {
context.set("url", entry.getUrl() == null ? "" : entry.getUrl().toLowerCase());
context.set("categories", entry.getContent().getCategories() == null ? "" : entry.getContent().getCategories().toLowerCase());
context.set("year", Year.now().getValue());
Callable<Object> callable = script.callable(context);
Future<Object> future = executor.submit(callable);
Object result = null;