annegerben / oversight

Automatically exported from code.google.com/p/oversight
0 stars 1 forks source link

Error Parsing Genre in nfo #627

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I had a similar problem with files/folders containing ' in the name. eg. 
D'Video.
These few that I had are not in imdb so I created nfo files for them but unless 
I removed the ' it would not pick up the details from the nfo file.

I then renamed them to not use the ' and it works better. Which leads me to my 
next problem. It seems like nfo.awk does not pick up the genre properly. I see 
that is is trying to count the number of instances of genre in the file and 
then join the genre's together separated by a |. This does not seem to work. I 
have a nfo file like the following :

<movie>
<title>Jimmy Magee: A different Class</title>
<originaltitle></originaltitle>
<rating></rating>
<year>2010</year>
<plot>After nearly fifty years at the top of the Irish sports commentary game, 
Jimmy Magee's exuberance and enthusiasm persists. In this programme Jimmy 
revisits the landscape of his youth, his sporting highlights and his working 
life during the year that was 2010.</plot>
<runtime>26</runtime>
<thumb></thumb>
<fanart></fanart>
<id>-1</id>
<genre>Documentary</genre>
<genre>Sport</genre>
</movie>

If I use this then I get the genre set to movie|genre|movie|genre<2
I see the piece of code where it is doing it in nfo.awk:

num = find_elements(xml,"/movie/genre",empty_filter,0,tags);
if (num) {
for(i = 1 ; i <= num ; i++ ) {
tmp = tmp "|"tags[i];
}
minfo2["mi_genre"] = substr(tmp,2);
}

I see what you are trying to do here but I cant see where it is going wrong. 
Anyway I commented out that section and added the line:

minfo2["mi_genre"] = xml["/movie/genre"];

I then modified my nfo file to have all the genre's in one line separated by a 
| and it works properly. Of course that violates the XBMC format but it is a 
quick solution for me.

<movie>
<title>Jimmy Magee: A different Class</title>
<originaltitle></originaltitle>
<rating></rating>
<year>2010</year>
<plot>After nearly fifty years at the top of the Irish sports commentary game, 
Jimmy Magee's exuberance and enthusiasm persists. In this programme Jimmy 
revisits the landscape of his youth, his sporting highlights and his working 
life during the year that was 2010.</plot>
<runtime>26</runtime>
<thumb></thumb>
<fanart></fanart>
<id>-1</id>
<genre>Documentary|Sport</genre>
</movie>

For a man of Lody's skill I think it should be a pretty quick fix to get that 
piece of code working. 

Original issue reported on code.google.com by a...@lordy.org.uk on 27 Jun 2011 at 12:54

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Genre tag fixed r2000 
Still need to fix plot

Original comment by a...@lordy.org.uk on 28 Jun 2011 at 11:32