murfguy / MixMingler

A site to help discover streamers on Mixer.com
MIT License
0 stars 0 forks source link

[Database/Backend] duplicate inserts offsetting auto-increment on stream types #27

Closed murfguy closed 6 years ago

murfguy commented 6 years ago

Need to investigate areas where we are attempting to detect new stream types and ensure that we are only adding types when we have not yet seen that type, while also minimizing SQL queries to ensure quick performance.

murfguy commented 6 years ago

Possible cause found: Some games, or at least similar titles, can exist multiple times in Mixer's database of types. Since the stream_types table structure does not allow for duplicate slugs, it is causing these games to be inserted, but ignored since the slugs match.

Suggested fix: Mimic what mixer does with their type urls which is: mixer.com/browse/games/[typeId]/[slug]

This means we can properly use the "detect known ids" method to stop duplicate inserts. It makes URLs less elegant, but more functional.

A good example to keep an eye on for this is : The Awesome Adventures of Captain Spirit https://mixer.com/browse/games/563282/the-awesome-adventures-of-captain-spirit https://mixer.com/browse/games/563285/the-awesome-adventures-of-captain-spirit

As a proxy item, which should maybe try an mimic Mixer's slug methodology. Need to research how characters are handled.

murfguy commented 6 years ago

Cause determined to be the same as listed above. Issue fixed.