genre(s) in the movie.nfo

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

genre(s) in the movie.nfo

Post 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)
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: genre(s) in the movie.nfo

Post by rednoah »

Example? For which movie/series does this happen?
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: genre(s) in the movie.nfo

Post 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 ;)
Post Reply