uisautomation / sms2jwplayer

Tool to help export SMS content to jwplayer
0 stars 1 forks source link

use media id as primary key when determining create/update #39

Closed rjw57 closed 6 years ago

rjw57 commented 6 years ago

This has temporarily been deployed to transcode1 and has been tested. It no longer uploads 800-odd new videos for no good reason.

We previously used the clip id as a primary key for determining if a video needed to be updated or created. Unfortunately this meant that our previous change which modified our clip id selection resulted in duplicate videos being uploaded with the same media id and differing clip id.

Compounding this error was the fact that these videos had identical publication dates set which meant that, in practice, they came back from the JWP API in a semi-random order depending on the vagaries of their database.

Move to using media id as the primary key which should stop this happening in future. We still need to tidy up the videos in JWP. The best approach would be to simply delete all the videos with multiple clip ids.