flesniak / python-prodj-link

A python interface to Pioneer ProDJ Link
Apache License 2.0
141 stars 26 forks source link

PDB Error: failed to parse the complete file #28

Open MarcoMartignone opened 1 year ago

MarcoMartignone commented 1 year ago

Hi @flesniak,

Thanks for all the amazing work on this tools.

I'm encountering an issue while parsing a large Rekordbox library: INFO: Player 3 Link Info: usb "", 2840 tracks, 11 playlists, 437737/476822MB free

During the parsing process, an error occurs resulting in only a fraction of the library being parsed. The error reads: WARNING: pdb failed [PDB database not available: PDBProvider: failed to parse "databases/player-3-usb.pdb": failed to parse the complete file (1380352/1810432 bytes parsed)]

If you have any advice or insights that could help resolve this issue, I would be extremely grateful.

For your reference, here is the related code:

https://github.com/flesniak/python-prodj-link/blob/16d7065398ce82963dac59c60a14b6d146bb7a8b/prodj/pdblib/pdbdatabase.py#L89-L90

I'm also including the link to the .pdb file I'm trying to parse as well as the file that was partially parsed: https://drive.google.com/drive/folders/1jJxlkp0osE4c6lNcvYSwLj3fTy7mcFkz?usp=share_link

Thanks in advance for your help.

Thanks, Marco

brunchboy commented 1 year ago

It seems that Crate Digger is able to parse that database, this just may be hitting one of the elements that have been discovered in the past few years but not yet incorporated in Python ProDJ Link (I opened issues about a few of them, but stopped when those just lingered). What are you trying to accomplish, is it something that Beat Link Trigger could help you with? That incorporates new discoveries as soon as we make them.

MarcoMartignone commented 1 year ago

Hi @brunchboy,

Indeed, I'm aware that both Crate Digger and Beat Link Trigger are effectively parsing the library.

My main objective is to search for a specific Track ID based on a track name on a CDJ's USB media and subsequently load that track remotely. At the moment, I'm working within TouchDesigner and a Python solution would be cleaner. I understand that I could exetend Beat Link Trigger to interface with TouchDesigner using either OSC or UDP, yet a Python-based approach is preferable in my current context.

brunchboy commented 1 year ago

That makes sense (although I just did an integration with TouchDesigner for a lighting designer in China 😄). Unfortunately, I only deal with Python when I have to, such as a small part of the back end for my window shade automation, so I can’t help you on this side. You may be able to fork the project and make the necessary fixes yourself, though, if Mr. Lesniak no longer has time. My database documentation is language neutral.

One approach that seems like an easy potential win would be to change this project so that it uses Kaitai Struct to parse the data the same way I do: that has a Python implementation, and then you could use the same structure definition as Crate Digger does, thereby always keeping current with new discoveries and fixes.