mmmmmtasty / SportScanner

Scanner and Metadata Agent for Plex that uses sportdb
101 stars 31 forks source link

Index just overran the index field in metadata_items table #37

Closed jbalcorn closed 2 years ago

jbalcorn commented 2 years ago

SportScanner calculates the episode number to be

ep = int('%s%02d%02d%04d' % (year[-2:],month, day, abs(hash(file)) % (10 ** 4)))

Well, it's 2022 and that number is larger than a signed 32 bit integer 2^32 = 2,147,483,647 Today = 2,201,240,000 So any 2 events in the same season on the same day are seen as the same event.

Need to figure out how to fix this.

Ugly, but will work: If it's 2022 or later, only use a 3-digit hash.

Best: update the database to use BIGINT. I've already put that out to the Plex devs.

jbalcorn commented 2 years ago

Submitted a PR that fixes the problem, but it's a bit of a kludge. Open to better ideas.....