jingai / plugin.image.iphoto

Imports Apple iPhoto and Aperture libraries into XBMC. Creates Events, Albums, Faces, Places, Keywords, and Ratings listings.
Other
23 stars 5 forks source link

iphoto_parser.py error #3

Closed larseggert closed 11 years ago

larseggert commented 12 years ago

I'm getting error in the debug log like this:

20:55:09 T:2792438672  NOTICE: Rewriting referenced masters path '/Users/lars/Pictures/iPhoto Library'
20:55:09 T:2792438672  NOTICE: as '/home/atv/Pictures/iPhoto Library'
20:55:09 T:2792438672  NOTICE: Rewriting iPhoto archive path '/Users/lars/Pictures/iPhoto Library'
20:55:09 T:2792438672  NOTICE: as '/home/atv/Pictures/iPhoto Library'
20:55:11 T:2792438672  NOTICE: iphoto.db: Parse: not well-formed (invalid token): line 45333, column 31
20:55:11 T:2792438672   ERROR: Traceback (most recent call last):
20:55:11 T:2792438672   ERROR:   File "/root/.xbmc/addons/plugin.image.iphoto/addon.py", line 573, in import_library
20:55:11 T:2792438672   ERROR:     iparser.Parse()
20:55:11 T:2792438672   ERROR:   File "/root/.xbmc/addons/plugin.image.iphoto/resources/lib/iphoto_parser.py", line 959, in Parse
20:55:11 T:2792438672   ERROR:     raise e
20:55:11 T:2792438672   ERROR: ExpatError: not well-formed (invalid token): line 45333, column 31
20:55:11 T:2792438672  NOTICE: None
20:55:11 T:2792438672  NOTICE: iPhoto: Library parse failed.

when lines contain stuff like:

<key>OriginalType</key><string><_/string>

or

<key>ImageType</key><string></_string>

(And note that I needed to add that underscore in the closing string tag between the less-than and the forward-slash, because github wouldn't show the line otherwise.)

jingai commented 12 years ago

I'll have a look at this as soon as I can. If possible, a copy of your AlbumData.xml file would help me track it down. I understand if you don't want to provide it, though.

larseggert commented 12 years ago

I'd rather not. But lines containing empty strings seem to be the problem. (Because after I edit them out, the file parses OK.)

jingai commented 12 years ago

No problem -- I understand completely. What version of iPhoto are you using (Apple's app, not my plugin)?

larseggert commented 12 years ago

9.2.3

jingai commented 11 years ago

I'm really sorry it's taken me so long to get to this.. but after looking at it a bit, I think I agree with the error it is throwing -- it is in fact invalid. Could you at least provide me with the surrounding XML for one of those images that has an empty token for OriginalType/ImageType?

I can force the issue on one of my own images, but the problem is that this is a valid error. The fix might ultimately be on your end, rather than working around it in the addon (which would be hard, to be honest, because I'd have to differentiate this from a 'real' error, and I don't know enough about what caused it to do that).

jingai commented 11 years ago

Closing due to inactivity. iphoto_parser.py error handling has since been revamped and may correct this anyway.