Export custom template
#1
Hello,

I'm trying to create a template for exporting an XML of my movies.
It works almost completely!

Here is the list.jmte :

Code:
<?xml version="1.0" encoding="UTF-8"?>
<movies>${foreach movies movie}
    <movie>
        <id>${movie.id}</id>
        <tmdbId>${movie.ids.tmdbId}</tmdbId>
        <imdbId>${movie.ids.imdbId}</imdbId>
        <dateAdded>${movie.dateAdded;date(yyyy-MM-dd)}</dateAdded>
        <title>${movie.title}</title>
        <originalTitle>${movie.originalTitle}</originalTitle>
        <movieSet>${movie.movieSet}</movieSet>
        <year>${movie.year}</year>
        <releaseDate>${movie.releaseDate;date(yyyy-MM-dd)}</releaseDate>
        <plot>${movie.plot}</plot>
        <watched>${movie.watched}</watched>
        <rating>${movie.rating}</rating>
        <runtime>${movie.runtime}</runtime>
        <director>${movie.director}</director>
        <country>${movie.country}</country>
        <genres>${foreach movie.genres genre}
            <genre>${genre}</genre>${end}
        </genres>
        <writers>${foreach movie.writer writer}
            <writer>${writer}</writer>${end}
        </writers>
        <actors>${foreach movie.actors actor}
            <actor>
                <name>${actor.name}</name>
                <character>${actor.character}</character>
                <thumbUrl>${actor.thumbUrl}</thumbUrl>
            </actor>${end}
        </actors>
        <images>
            <posterUrl>${movie.posterUrl}</posterUrl>
            <fanartUrl>${movie.fanartUrl}</fanartUrl>
            <bannerUrl>${movie.bannerUrl}</bannerUrl>
            <thumbUrl>${movie.thumbUrl}</thumbUrl>
        </images>
        <trailer>${foreach movie.trailers trailer}${if trailer.inNfo=true}${trailer.url}${end}${end}</trailer>
        <files>${foreach movie.mediaFiles file} ${if file.type="VIDEO"}
            <file>
                <name>${file.filename}</name>
                <path>${file.path}</path>
                <file>${file.file}</file>
                <size>${file.filesize}</size>
                <vcodec>${file.videoCodec}</vcodec>
                <vresolution>${file.videoWidth} x ${file.videoHeight}</vresolution>
            </file>${end}${end}
        </files>
    </movie>${end}
</movies>

I have two problems:

1) ${movie.id} don't work. Well, not always! Here is the error log:
Code:
ERROR [main] o.t.u.movies.dialogs.MovieExporterDialog:171 - Error exporting movies: Error while parsing 'movie.id' at location (4:15): Property 'id' on object '...' can not be accessed: "java.lang.IllegalArgumentException: wrong number of arguments"!
However, the "id" object in "Movie" exists ! How to have the ID of the movie in TMM ?

2) The last block "<files>" don't work. If I remove all the block, the export works. When I'm debugging ${movie}, it seems correct but ${foreach movie.mediaFiles file} does not work (even movie.mediaFile). Any idea ?

I have TMM v2.6.9 ; on Windows 7.

Thanks for reading Wink


Messages In This Thread
Export custom template - by ShevAbam - 2015-09-03, 15:10
RE: Export custom template - by mlaggner - 2015-09-05, 18:15
RE: Export custom template - by ShevAbam - 2015-09-05, 19:42
RE: Export custom template - by mlaggner - 2015-09-06, 10:51
RE: Export custom template - by ShevAbam - 2015-09-06, 19:04
RE: Export custom template - by myron - 2015-09-07, 09:48
RE: Export custom template - by ShevAbam - 2015-09-08, 18:28
RE: Export custom template - by ShevAbam - 2015-09-11, 13:54
RE: Export custom template - by mlaggner - 2015-09-13, 18:16
RE: Export custom template - by ShevAbam - 2015-09-13, 18:20
RE: Export custom template - by Gaby Pozo - 2020-09-17, 15:20
RE: Export custom template - by arcticminer - 2020-09-17, 18:15
RE: Export custom template - by tars - 2020-09-18, 12:39
RE: Export custom template - by arcticminer - 2020-09-19, 04:15
RE: Export custom template - by tars - 2020-09-23, 16:00
RE: Export custom template - by arcticminer - 2020-10-10, 01:12
RE: Export custom template - by Gaby Pozo - 2020-09-20, 17:13
RE: Export custom template - by Gaby Pozo - 2020-09-17, 20:26
RE: Export custom template - by mlaggner - 2020-09-22, 08:06
Logout Mark Read Team Forum Stats Members Help
Export custom template0