Page 1 of 1

genre(s) in the movie.nfo

Posted: 15 May 2014, 17:00
by kim
In the movie.nfo file, how do i get it, to only make a new line (<genre>...) when there is something in it ?

e.g.
<genre>Drama</genre>
<genre>Thriller</genre>
<genre></genre>
<genre></genre>
<genre></genre>

this is from my htpc.groovy file
genre(i.genres?.size() > 0 ? i.genres[0] : null)
genre(i.genres?.size() > 0 ? i.genres[1] : null)
genre(i.genres?.size() > 0 ? i.genres[2] : null)
genre(i.genres?.size() > 0 ? i.genres[3] : null)
genre(i.genres?.size() > 0 ? i.genres[4] : null)

Re: genre(s) in the movie.nfo

Posted: 15 May 2014, 17:18
by rednoah
Example? For which movie/series does this happen?

Re: genre(s) in the movie.nfo

Posted: 15 May 2014, 17:42
by kim
damn you er quick to answer :D

i got this to work, so NM ;)

int noOfGenres=i.genres.size()
for(int tmpCount=0; tmpCount<noOfGenres; tmpCount++){
genre(i.genres[tmpCount])
}

keep up the good work ;)