Template Help - How to export every file related to a movie
#1
Hi, 

I am tried to generate a template to list all files of my library, not just the video file, but also the related ones.

For example, considering I have Matrix (1999).mkv into TMM, to be able to export into a Excel (xml or csv) file, the list of files related to this movie:
Matrix (1999) [1080p x265 AC3] [Dual + Subs] [ID 603].mkv
Matrix (1999) [1080p x265 AC3] [Dual + Subs] [ID 603].nfo
Matrix (1999) [1080p x265 AC3] [Dual + Subs] [ID 603]-poster.jpg
Matrix (1999) [1080p x265 AC3] [Dual + Subs] [ID 603]-mediainfo.xml

I would like to have one line per file.  I have been trying with several options, but none of them worked.  Any help would be appreciated.

Thanks.
#2
You could try something like this for csv format:

Code:
Sep=;
${foreach movies movie}${foreach movie.mediaFiles media}${movie.titleSortable} (${movie.year});${media.filename}
${end}${end}
#3
Thanks a lot @tars .  It worked perfect!  I didn't know the bucle to go throught all the mediafiles, but with your code I have been able to export just all I wanted.  Just for anyone who wants something similar, I put here my hole template in case it is useful.

Thanks again!  Regards, 

List.jmte:

<?xml version="1.0" encoding="UTF-8"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urnConfusedchemas-microsoft-com:officeConfusedpreadsheet"
 xmlns:o="urnConfusedchemas-microsoft-com:office:office"
 xmlns:x="urnConfusedchemas-microsoft-com:office:excel"
 xmlnsConfuseds="urnConfusedchemas-microsoft-com:officeConfusedpreadsheet"
 xmlns:html="http://www.w3.org/TR/REC-html40">
 
 <Styles>
  <Style ss:ID="Default" ss:Name="Normal">
   <Alignment ss:Vertical="Bottom"/>
   <Borders/>
   <Font/>
   <Interior/>
   <NumberFormat/>
   <Protection/>
  </Style>
  <Style ss:ID="s22">
   <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
  </Style>
  <Style ss:ID="s23">
   <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
   <NumberFormat ss:Format="Short Date"/>
  </Style>
 </Styles>
 
 <Worksheet ss:Name="movielist">
  <Table x:FullColumns="1" x:FullRows="1" ssBig GrinefaultColumnWidth="60">

   <Column ss:Width="200.00"/>
   <Column ss:Width="33.00" ss:StyleID="s22" />
   <Column ss:Width="300.00"/>

<Row>
     <Cell><Data ss:Type="String">Title</Data></Cell>
     <Cell><Data ss:Type="String">Year</Data></Cell>
     <Cell><Data ss:Type="String">Release Date</Data></Cell>
     <Cell><Data ss:Type="String">ID Imdb</Data></Cell>
     <Cell><Data ss:Type="String">ID TMDB</Data></Cell>
     <Cell><Data ss:Type="String">Path</Data></Cell>
     <Cell><Data ss:Type="String">Filename</Data></Cell>
     <Cell><Data ss:Type="String">Extension</Data></Cell>
     <Cell><Data ss:Type="String">Bytes</Data></Cell>
</Row>


${foreach movies movie}
  ${foreach movie.mediaFiles media}
   <Row>
    <Cell><Data ss:Type="String">${movie.title}</Data></Cell>
    <Cell><Data ss:Type="Number">${movie.year}</Data></Cell>
    <Cell><Data ss:Type="String">${movie.releaseDateAsString}</Data></Cell>
    <Cell><Data ss:Type="String">${movie.imdbId}</Data></Cell>
    <Cell><Data ss:Type="String">${movie.tmdbId}</Data></Cell>
    <Cell><Data ss:Type="String">${movie.path}</Data></Cell>
    <Cell><Data ss:Type="String">${media.filename}</Data></Cell>
    <Cell><Data ss:Type="String">${media.extension}</Data></Cell>
    <Cell><Data ss:Type="String">${media.filesize}</Data></Cell>
   </Row>
${end}${end}

  </Table>
 </Worksheet>
</Workbook>

Logout Mark Read Team Forum Stats Members Help
Template Help - How to export every file related to a movie0