OwenCochell / cursepy

A CurseForge API written in python
MIT License
7 stars 1 forks source link

Error with "client.addon_files" after upgrading to 1.2.0 #5

Closed Arweix closed 2 years ago

Arweix commented 2 years ago

Hello. After update, I get an error:

final.append(base.CurseDependency(depen['id'], depen['addonId'], depen['fileId'], depen['type']))
KeyError: 'id'

Error due to this line: for f in client.addon_files(selectedMod.id):

OwenCochell commented 2 years ago

Hmm, i'm not seeing that error on my end. Could you send me an addon ID that causes this line to fail?

I worry that the dependency format may differ depending on the addon. We may have to make cursepy a bit smarter in getting dependency info, at least for the ForgeSVC. I would be able to figure out this strange formatting with an example.

Thanks!

Arweix commented 2 years ago

ExtraBotany - https://www.curseforge.com/minecraft/mc-mods/extrabotany (299086) By the way, not only this modification has this error. All addons that have dependencies have it

OwenCochell commented 2 years ago

Alright, I believe I have fixed this issue. Apologies for the delayed response, these past few weeks have been crazy for me.

The issue was when retrieving all addon files from ForgeSVC, only basic dependency info is provided. This would lead to a key error, as cursepy is trying to access info that does not exist. Now, when all files are retrieved, we simply fill in None for the missing info. It is unfortunate that we are unable to get full dependency info, but this is a limitation of Curseforge. You can still make a request for a specific addon file and get full dependency data.

This change is live, and the version you want is 1.3.0. Let me know if I missed anything, or if you have any other recommendations. Thanks for pointing this out!

Arweix commented 2 years ago

Yes, there is no problem now. Thanks