Quantcast
Channel: configuration - Forum - FlexGet
Viewing all articles
Browse latest Browse all 716

Jinja Template - Works with No Entries, errors with Entries

$
0
0

@4oo4 wrote:

I'm a newb to jinja, can someone point out what's wrong with my template syntax? It works correctly when there aren't any entries but complains that it's not JSON serializable when there are entries. I'll post the log file after this latest run.

{% if task.accepted -%}
{% if task == 'sort-movies' or task == 'sort-tv' or task == 'sort-music' %}
{%-   for group in task.accepted|groupby('task') %}
FlexGet has just sorted {{group.list|length}} new entries for task {{group.grouper}}:
  {%- for entry in group.list %}
- {{entry.title}} ({{entry.url}}){% if entry.output|d(false) %} => {{entry.output}}{% endif %}
  {% endfor %}
{% endfor %}
{% endif %}
{% else %} Task did not produce any entries.
{% endif -%}
{% if task.accepted -%}
{% if task == 'movie-dl' or task == 'tv-dl' or task == 'music-dl' %}
{%- for group in task.accepted|groupby('task') %}
FlexGet has just downloaded {{group.list|length}} new entries for task {{group.grouper}}:
  {%- for entry in group.list %}
- {{entry.title}} ({{entry.url}}){% if entry.output|d(false) %} => {{entry.output}}{% endif %}
  {% endfor %}
{% endfor %}
{% else %} Task did not produce any entries.
{% endif %}
{% endif %}

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 716

Trending Articles