Sperryfreak01 / RadarrSync

120 stars 47 forks source link

Script crashes on invalid Profile ID #5

Closed mattmac24 closed 5 years ago

mattmac24 commented 6 years ago

Hi,

I am getting a python error when I run this script(and other forks of this script). But perhaps this may be to do with my python environment? I have not changed anything other than the profile id from 5 to 7 which is hardcoded in the script.

Traceback (most recent call last):
  File "RadarrSync.py", line 93, in <module>
    searchid.append(int(r.json()['id']))
TypeError: list indices must be integers or slices, not str

I am running the script with python3 RadarrSync.py

Can I please have some help to get this running?

Thanks in advance :)

Xert0 commented 6 years ago

is it because in searchid.append(int(r.json()['id'])) it is put as ['id'] rather than [id]?

mattmac24 commented 6 years ago

I just tried it as [id] and got the same error:

Traceback (most recent call last): File "RadarrSync.py", line 93, in <module> searchid.append(int(r.json()[id])) TypeError: list indices must be integers or slices, not builtin_function_or_method

I do not understand what is happening, I have tried this on two computers now and received this error. Others seem to be able to run the code without any error so i'm confused.

mattmac24 commented 6 years ago

Worked it out. This is the error you get when the quality profile of your server is wrong and doesn't exist.

Sperryfreak01 commented 5 years ago

Reopening this as an enhancement. I found a way to support profile verification and also allow users to enter the profile ID number or just the profile name as shown in the Radarr web interface. Working on the update now.

mattmac24 commented 5 years ago

Great to hear! The OCD in me requires that I delete all of the default profiles and create my own new one. Took me more then it should have to find out the correct profile ID to use.

Sperryfreak01 commented 5 years ago

This is fixed but I need to update documentation to make it more clear how to use it.