Yooooomi / your_spotify

Self hosted Spotify tracking dashboard
GNU General Public License v3.0
2.82k stars 113 forks source link

Full extended import - Cannot read properties of null #237

Closed oxodao closed 1 year ago

oxodao commented 1 year ago

Hi !

I'm trying to import my full extended history but I'm facing an error:

server_1  | [error]  TypeError: Cannot read properties of null (reading 'id')
server_1  |     at /app/lib/tools/importers/full_privacy.js:118:59
server_1  |     at Array.forEach (<anonymous>)
server_1  |     at FullPrivacyImporter.<anonymous> (/app/lib/tools/importers/full_privacy.js:117:27)
server_1  |     at Generator.next (<anonymous>)
server_1  |     at fulfilled (/app/lib/tools/importers/full_privacy.js:5:58)
server_1  |     at runMicrotasks (<anonymous>)
server_1  |     at processTicksAndRejections (node:internal/process/task_queues:96:5)
server_1  | [error]  This import failed, but metadata is kept so that you can retry it later in the settings

The offending line seems to be this one: https://github.com/Yooooomi/your_spotify/blob/fb74d4fe7e6b909fdfa1be01b897dea4eef2c18b/server/src/tools/importers/full_privacy.ts#L178

Not sure why this happens, maybe because of songs that were removed from the Spotify library, or it could also be songs that were locally imported in the client as I remember doing this a few time..

Maybe this has changed since though, as my export is quite old dating back to Feb 2022

Running on the latest docker image, my import fails at 2236 out of 64583 listenings...

Regards

Yooooomi commented 1 year ago

Hello! Can you backup your database and test with the latest nightly if this is solved? I worked on a similar issue for the next release.

oxodao commented 1 year ago

It does seems to do the job indeed ! Thanks !

Does it handles dedupe ? Like I've re-imported everything but as it already had 2236 listenings imported are those duplicated ?

Yooooomi commented 1 year ago

Yes it does handle them. I think it's stated in the readme iirc.