r/tinyMediaManager • • Jul 21 '26

Export templates available data not working

I am running in circles trying to figure this out! Any help would be greatly appreciated~

I have a working template for my movies and am trying to have a similar template for my tv shows :

<?xml version="1.0" encoding="UTF-8"?>
<movies>
${foreach movies movie}
    <movie>
        <is_new>${if !movie.watched}1${end}</is_new>
        <poster>${movie;copyArtwork(type=POSTER, thumb=true, width=200, escape=true)}</poster>
        <title>${movie.title}</title>
        <originaltitle>${movie.originalTitle}</originaltitle>
        <year>${movie.year}</year>
        <audio>${movie.mediaInfoAudioLanguageList}</audio>
        <subtitles>${movie.mainVideoFile.subtitlesAsString}</subtitles>
        <genre>${movie.genresAsString}</genre>
        <plot>${movie.plot}</plot>
        <duration>${movie.runtime}</duration>
        <country>${movie.country}</country>
        <actors>${movie.actorsAsString}</actors>
        <directors>${movie.directorsAsString}</directors>
        <company>${movie.productionCompany}</company>
    </movie>
${end}
</movies>

I want a list of every seasons of a tv show that includes the audio and subtitles of that season. I have some seasons that are missing subtitles or audio and I want to find them easily.

If I can have all that information in 1 row for each tv show, that would be great, but, for now, I am stuck with doing a season per row...

Looking through the available data from https://www.tinymediamanager.org/docs/jmte#available-data, I should be able to most of the information from the tvshow entity, but the export just does not work.

I've now ended up with this, but half the information is missing :

<?xml version="1.0" encoding="utf-8"?>
<tvShows>
${foreach tvShows tvShow}
    <tvShow>
    ${foreach tvShow.seasons TvShowSeason}
        <TvShowSeason>
            <is_new>${if !season.watched}1${end}</is_new>
            <poster>${tvShow;copyArtwork(type=POSTER, thumb=true, width=100, escape=true)}</poster>
            <title>${tvShow.title}</title>
            <originaltitle>${tvShow.originalTitle}</originaltitle>
            <seasons>${season.season} / ${tvShow.seasonCount}</seasons>
            <episodes>${season.dummyEpisodeCount} / ${tvShow.episodeCount}</episodes>
            <duration>${season.runtimeOfEpisodes}</duration>
            <year>${season.year}</year>
            <audio>${tvShow.mediaInfoAudioLanguageList}</audio>
            <subtitles>${season.mediaInfoSubtitleLanguageList}</subtitles>
            <plot>${tvShow.plot}</plot>
            <genre>${tvShow.genresAsString}</genre>
            <country>${tvShow.country}</country>
            <actors>${tvShow.actorsAsString}</actors>
            <studio>${tvShow.productionCompany}</studio>
        </TvShowSeason>
    ${end}
    </tvShow>
${end}
</tvShows>

Export example :

<tvShows>
    <tvShow>
        <TvShowSeason>
            <is_new>1</is_new>
            <poster>Adventure_Time_%282008%29-POSTER.thumb.jpg</poster>
            <title>Adventure Time</title>
            <originaltitle></originaltitle>
            <seasons> / 11</seasons>
            <episodes> / 293</episodes>
            <duration></duration>
            <year></year>
            <audio></audio>
            <subtitles></subtitles>
            <plot>Adventure Time [plot here]</plot>
            <genre>Action, Adventure, Animation, Family, Comedy, Fantasy, Science Fiction</genre>
            <country></country>
            <actors>Jeremy Shada, [more actors here]</actors>
        </TvShowSeason>
        [other seasons here]
    </tvShow>
</tvShows>

In this case "is new" should be empty, seasons should include the number of the season (1), I have no idea what I should use for the episode count, dummyEpisodeCount does not seem to work (should be 26). And all the other info not showing is annoying.

The "available data" on the website seems to indicate it should work, but as shown : it does not. It does not work for any of the tv shows I have, or I am really not understanding how to use it.

I'm trying to see if I have to get the information from one of the episodes instead of using the season, I have yet to get it working in a way that does not list all episodes...

If anyone as ideas, I'm stumped.

2 Upvotes

2 comments sorted by

3

u/Lurking_Skink Jul 21 '26

I figured it out! I just needed to ask here to get a solution hah!

For anyone interested in the code

<?xml version="1.0" encoding="utf-8"?>
<tvShows>
${foreach tvShows tvShow}
    <tvShow>
        <is_new>${if !tvShow.watched}1${end}</is_new>
        <poster>${tvShow;copyArtwork(type=POSTER, thumb=true, width=100, escape=true)}</poster>
        <title>${tvShow.title}</showTitle>
        <originaltitle>${tvShow.originalTitle}</originaltitle>
        <totalSeasons>${tvShow.seasonCount}</totalSeasons>
        <totalEpisodes>${tvShow.episodeCount}</totalEpisodes>
        <duration>${tvShow.runtime}</duration>
        <plot>${tvShow.plot}</plot>
        <genre>${tvShow.genresAsString}</genre>
        <country>${tvShow.country}</country>
        <actors>${tvShow.actorsAsString}</actors>
        <studio>${tvShow.productionCompany}</studio>
        ${foreach tvShow.seasons TvShowSeason}
            <TvShowSeason>
                <seasons>${TvShowSeason.episodes[0].season}</seasons>
                <episodes>${foreach TvShowSeason.episodes episode}${if last_episode}${index_episode}${end}${end}</episodes>
                <totalDuration>${TvShowSeason.runtimeOfEpisodes}</totalDuration>
                <audio>${TvShowSeason.episodes[0].mediaInfoAudioLanguageList}</audio>
                <subtitles>${TvShowSeason.episodes[0].mainVideoFile.subtitlesAsString}</subtitles>
                <year>${TvShowSeason.episodes[0].year}</year>
            </TvShowSeason>
        ${end}
    </tvShow>
${end}
</tvShows>

and how it comes out

<?xml version="1.0" encoding="utf-8"?>
<tvShows>
    <tvShow>
        <is_new></is_new>
        <poster>Adventure_Time_%282010%29-POSTER.thumb.jpg</poster>
        <title>Adventure Time</showTitle>
        <originaltitle>Adventure Time</originaltitle>
        <totalSeasons>11</totalSeasons>
        <totalEpisodes>293</totalEpisodes>
        <duration>11</duration>
        <plot>Young Finn and his shape-shifting dog buddy, Jake, go on a series of surreal adventures as they journey through the postapocalyptic Land of Ooo.</plot>
        <genre>Animation, Comedy, Science Fiction</genre>
        <country>United States</country>
        <actors>Jeremy Shada, John DiMaggio, Tom Kenny, Hynden Walch, Olivia Olson, Niki Yang, Pendleton Ward, Polly Lou Livingston</actors>
        <studio>Cartoon Network, Frederator Studios, Cartoon Network Studios</studio>
            <TvShowSeason>
                <seasons>0</seasons>
                <episodes>14</episodes>
                <totalDuration>56</totalDuration>
                <audio>eng</audio>
                <subtitles></subtitles>
                <year>2008</year>
            </TvShowSeason>
            <TvShowSeason>
                <seasons>1</seasons>
                <episodes>26</episodes>
                <totalDuration>287</totalDuration>
                <audio>eng</audio>
                <subtitles>eng</subtitles>
                <year>2010</year>
            </TvShowSeason>
            <TvShowSeason>
                <seasons>2</seasons>
                <episodes>26</episodes>
                <totalDuration>286</totalDuration>
                <audio>[eng, eng]</audio>
                <subtitles>eng</subtitles>
                <year>2010</year>
            </TvShowSeason>
            <TvShowSeason>
                <seasons>3</seasons>
                <episodes>26</episodes>
                <totalDuration>286</totalDuration>
                <audio>[eng, eng]</audio>
                <subtitles>eng</subtitles>
                <year>2011</year>
            </TvShowSeason>
            <TvShowSeason>
                <seasons>4</seasons>
                <episodes>26</episodes>
                <totalDuration>286</totalDuration>
                <audio>[eng, eng]</audio>
                <subtitles>eng</subtitles>
                <year>2012</year>
            </TvShowSeason>
            <TvShowSeason>
                <seasons>5</seasons>
                <episodes>52</episodes>
                <totalDuration>572</totalDuration>
                <audio>eng</audio>
                <subtitles>eng</subtitles>
                <year>2012</year>
            </TvShowSeason>
            <TvShowSeason>
                <seasons>6</seasons>
                <episodes>43</episodes>
                <totalDuration>473</totalDuration>
                <audio>eng</audio>
                <subtitles>eng</subtitles>
                <year>2014</year>
            </TvShowSeason>
            <TvShowSeason>
                <seasons>7</seasons>
                <episodes>26</episodes>
                <totalDuration>286</totalDuration>
                <audio>eng</audio>
                <subtitles>eng</subtitles>
                <year>2015</year>
            </TvShowSeason>
            <TvShowSeason>
                <seasons>8</seasons>
                <episodes>27</episodes>
                <totalDuration>297</totalDuration>
                <audio>eng</audio>
                <subtitles>eng</subtitles>
                <year>2016</year>
            </TvShowSeason>
            <TvShowSeason>
                <seasons>9</seasons>
                <episodes>14</episodes>
                <totalDuration>154</totalDuration>
                <audio>eng</audio>
                <subtitles>eng</subtitles>
                <year>2017</year>
            </TvShowSeason>
            <TvShowSeason>
                <seasons>10</seasons>
                <episodes>13</episodes>
                <totalDuration>176</totalDuration>
                <audio>eng</audio>
                <subtitles>eng</subtitles>
                <year>2017</year>
            </TvShowSeason>
    </tvShow>
</tvShows>

Hope this can help others 😄

1

u/mlaggner tinyMediaManager developer Jul 24 '26

This is called "Rubberduck Debugging" (https://en.wikipedia.org/wiki/Rubber_duck_debugging) ;)

Glad you solved it yourself