ProductSet and files (aka media) clarification

Hi folks,

Following on from this thread: Solved: productSet and media? - Shopify Community

I have 2 questions:

  1. I am curious about the behaviour of EXTERNAL_VIDEO type media items - the documentation is not clear. I have successfully tested creating new IMAGE media files when syncing a product, and sending an array of media items, some of which already exist (by sending the id) and some of which aren’t (by sending the original source). We’re not interested in VIDEO or 3D_MODEL at the moment, content to just upload everything to youtube and link them. Can I create them as part of productSet like images, by just providing an originalSource url? Or do I need another process to create them first and wait for an id?

  2. How does one identify the correct id of newly created items? If there are several created by sending an originalSource instead of an id, I need to work out which of the returned ids correspond to which of the new images so i can update my database correctly - I had thought I could use the filename, but it seems this can’t be returned, and probably wouldn’t help if there’s a new UUID appended as part of the process. I suppose I could just replace the entire media array our end? Is that what you’d suggest?