{%- extends "base.html" -%} {%- from 'utils.html' import make_tabs -%} {%- macro default(event,source) -%}
Unknown ({{source}})
{{event|tojson(indent=4)}}
{%- endmacro -%} {%- macro downloadFolderImported(event,source) -%} [{{event.seriesId}}/{{event.episodeId}}] Imported {{event.data.droppedPath}} from {{event.data.downloadClientName}} to {{event.data.importedPath}} {%- endmacro -%} {%- macro grabbed(event,source) -%} [{{event.seriesId}}/{{event.episodeId}}] Grabbed {{event.sourceTitle}} {%- endmacro -%} {%- macro episodeFileDeleted(event,source) -%} [{{event.seriesId}}/{{event.episodeId}}] Deleted {{event.sourceTitle}} because {{event.data.reason}} {%- endmacro -%} {%- macro episodeFileRenamed(event,source) -%} [{{event.seriesId}}/{{event.episodeId}}] Renamed {{event.data.sourcePath}} to {{event.data.path}} {%- endmacro -%} {%- macro movieFileDeleted(event,source) -%} Renamed {{event.data.sourcePath}} to {{event.data.path}} {%- endmacro -%} {%- macro movieFileRenamed(event,source) -%}
renamed
{{event|tojson(indent=4)}}
{%- endmacro -%} {%- macro downloadFailed(event,source) -%}
downloadFailed
{{event|tojson(indent=4)}}
{%- endmacro -%} {%- set handlers = { 'downloadFolderImported': downloadFolderImported, 'grabbed': grabbed, 'episodeFileDeleted': episodeFileDeleted, 'episodeFileRenamed': episodeFileRenamed, 'movieFileDeleted': movieFileDeleted, 'movieFileRenamed': movieFileRenamed, 'downloadFailed': downloadFailed, None: default } -%} {%- macro history_page(history,source) -%}
        {%- for entry in history.records -%}
            {{handlers.get(entry.eventType,handlers[None])(entry,source)}}{{'\n'}}
        {%- endfor -%}
    
{%- endmacro -%} {%- block app_content -%}

History

{{make_tabs([('Sonarr',history_page(sonarr,'sonarr')),('Radarr',history_page(radarr,'radarr'))])}}
{%- endblock -%}