Mediaelch: [export] episode thumbnails are not generated in tvshow

Created on 19 Apr 2020  路  21Comments  路  Source: Komet/MediaElch

Describe the bug
everything in the dummy-theme works as expected, but when the episode thumbnail is declared it always uses the default image.

To Reproduce
Steps to reproduce the behavior:

  1. have a theme, where something like this is declared in tvshow.html:
{{ BEGIN_BLOCK_SEASON }}
  Season: {{ SEASON }}
  <ul>
  {{ BEGIN_BLOCK_EPISODE }}
    <li>
      <a href="{{ EPISODE.LINK }}">
        S{{ EPISODE.SEASON }}E{{ EPISODE.EPISODE }} {{ EPISODE.TITLE }}
        <img src="{{ IMAGE.THUMBNAIL[300,200] }}" />
      </a>
    </li>
  {{ END_BLOCK_EPISODE }}
  </ul>
{{ END_BLOCK_SEASON }}
  1. export the tv-shows

Expected behavior
In the documentation nothing is said, that this is not valid. So I expected this to work.

It works in the episode.html.

MediaElch Version:

  • [x] 2.6.7-dev (nightly)

Operating System:

  • [x] Linux (distribution: Arch Linux)
unexpected behavior

All 21 comments

Hi,

the documentation is indeed misleading. The images always refer to the top-level item of the HTML page. For tvshow.html it refers to the TV show. For episode.html is refers to the episode.

I could change our code so that IMAGE.* refers to the inner-most block, e.g. BEGIN_BLOCK_EPISODE. But then you could not point to the show's images inside the EPISODE block. If you're fine with this then I'll adopt the export engine. :smiley:

I don't want to invest too much time into the export engine. It's only very basic and I would prefer something like https://mustache.github.io/ .

for me it makes more sense to address the inner-most block
It does not make sense to have the same image multiple-times (amount of episodes) on one page.

currently the same happens also in movies.html/concerts.html it is not the most outer (which does not exist) image, but always the inner-most block.

if you support the inner-most block, then themes could also have a single site containing all the content

Ok, then I'll change it so that the inner most block is used for images.

TODO:

  • [x] adapt code
  • [ ] adapt dummy theme
  • [ ] adapt documentation

I think I'll have this fixed during the next week.

Ok. Only IMAGES.THUMBNAIL is available for episodes. #966 fixes your issue. No need to adapt the documentation or dummy theme. :)

i expected no changes in the dummy and elsewhere. Thanks :+1:

one thing broke in tvshows.html:

{{ BEGIN_BLOCK_TVSHOW }}
    <a href="{{ TVSHOW.LINK }}">
        <img src="{{ IMAGE.POSTER[200,300] }}"/>
...

{{ IMAGE.POSTER[200,300] }} is not replaced at all

Oh. I thought I had tested that o.O

Very strange. This change should only affect tvshow.html. Will look into it. Thanks for reporting.

I'm dumb. Sorry. #967 should fix your issue. But this time, I'll test it thoroughly before merging. :)

I tested #967 and still got the same problem, that the placeholder is not replaced. The images do not even get generated.

concerts and movies work still fine :+1:

Sorry, I have a few unpublished changes that aren't part of the PR, yet. Didn't get to test it on the weekend.

Ah okay.
If you want I can test it.

Ok, so I just tested #967 with the following tvshow.html (not tvshows.html)

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>TV Show</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="author" content="MediaElch">
  </head>
  <body>
    Title: {{ TVSHOW.TITLE }}<br />
    Rating: {{ TVSHOW.RATING }}<br />
    Certification: {{ TVSHOW.CERTIFICATION }}<br />
    First aired: {{ TVSHOW.FIRST_AIRED }}<br />
    Studio: {{ TVSHOW.STUDIO }}<br />
    Plot: {{ TVSHOW.PLOT }}<br />
    Tags: {{ TVSHOW.TAGS }}<br />
    Genres: {{ TVSHOW.GENRES }}<br />

    {{ BEGIN_BLOCK_TAGS }}
        Tag: {{ TAG.NAME }}<br />
    {{ END_BLOCK_TAGS }}

    {{ BEGIN_BLOCK_GENRES }}
        Genre: {{ GENRE.NAME }}<br />
    {{ END_BLOCK_GENRES }}

    <img src="{{ IMAGE.POSTER[200, 400] }}" />
    <img src="{{ IMAGE.FANART[200, 400] }}" />
    <img src="{{ IMAGE.BANNER[200, 400] }}" />
    <img src="{{ IMAGE.LOGO[200, 400] }}" />
    <img src="{{ IMAGE.CLEARART[200, 400] }}" />
    <img src="{{ IMAGE.CHARACTERART[200, 200] }}" />

    <hr>

    {{ BEGIN_BLOCK_SEASON }}
        <strong>Season: {{ SEASON }}</strong>

        <img src="{{ IMAGE.POSTER[200, 400] }}" />
        <img src="{{ IMAGE.FANART[200, 400] }}" />
        <img src="{{ IMAGE.BANNER[200, 400] }}" />
        <img src="{{ IMAGE.LOGO[200, 400] }}" />
        <img src="{{ IMAGE.CLEARART[200, 400] }}" />
        <img src="{{ IMAGE.CHARACTERART[200, 200] }}" />

        <!-- should not be replaced -->
        <img src="{{ IMAGE.THUMBNAIL[100, 100] }}" />

        <ul>
        {{ BEGIN_BLOCK_EPISODE }}
            <li>
                <a href="{{ EPISODE.LINK }}">
                    S{{ EPISODE.SEASON }}E{{ EPISODE.EPISODE }} {{ EPISODE.TITLE }}
                </a>
                <img src="{{ IMAGE.THUMBNAIL[100, 100] }}" />
                <img src="{{ IMAGE.THUMBNAIL[300,300] }}" />

                <img src="{{ IMAGE.POSTER[200, 400] }}" />
                <img src="{{ IMAGE.FANART[200, 400] }}" />
                <img src="{{ IMAGE.BANNER[200, 400] }}" />
                <img src="{{ IMAGE.LOGO[200, 400] }}" />
                <img src="{{ IMAGE.CLEARART[200, 400] }}" />
                <img src="{{ IMAGE.CHARACTERART[200, 200] }}" />
            </li>
        {{ END_BLOCK_EPISODE }}
        </ul>
        <hr>
    {{ END_BLOCK_SEASON }}
  </body>
</html>

As you can see, I'm using all kinds of images in the episode block as well as season block and show "block" (well, no block at all is more correct).

This is how the resulting tvshow.html looks like:

Screenshot_20200427_130525

That's what I would expect. Also it seems that I already pushed the latest commit to #967. I thought that I did not, though...

Did you check out my branch export-simple-engine of #967 and compiled MediaElch? The PR should fix this issue.

still broken for tvshows.html. tvshow.html works perfectly. Images still not get generated

still broken for tvshows.html

Ok, I didn't look at that file. I can do that in another PR (would be a "feature request" so to say because MediaElch never supported it as far as I can tell.

Images still not get generated

What images exactly? :-)

looking at the dummy theme it supported it.

that's what I meant above:

currently the same happens also in movies.html/concerts.html it is not the most outer (which does not exist) image, but always the inner-most block.

and in movies.html & concerts.html it still works

Ok, sorry for the inconvenience. I'll look into it.

Ok. Images were not replaced in tvshows.html if no SEASON block exists... Stupid me. Will come with some other changes in another PR today.

This time, all images in tvshows.html are replaced. Furthermore, image tags like IMAGES.DOES_NOT_EXIST are no longer replaced.

Screenshot_20200502_131729

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bugwelle picture bugwelle  路  5Comments

psonnosp picture psonnosp  路  5Comments

badkarmaboy picture badkarmaboy  路  6Comments

Donatzsky picture Donatzsky  路  6Comments

dfarin picture dfarin  路  5Comments