l3uddz / plex_dupefinder

Find and delete duplicate files in Plex
GNU General Public License v3.0
308 stars 54 forks source link

Error int(item.index) when it doesn't exists #76

Open ironwoox opened 8 months ago

ironwoox commented 8 months ago

Describe the bug I ran Dupefinder on new TV Show libary and recived the following error.

line 352, in item.grandparentTitle, int(item.parentIndex), int(item.index), item.title) ^^^^^^^^^^^^^^^ TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'

However I'm total pleb. I asked ChatGPT and it provided me with this

title = "%s - %02dx%02d - %s" % (
    item.grandparentTitle, int(item.parentIndex) if item.parentIndex is not None else 0, int(item.index) if item.index is not None else 0, item.title)

and it fixed my issue. and I decided to share it here