In the D6 version of this module (haven't tested D7 yet) it is possible to re-import videos that already exist as nodes from Backlot. There's no real way to filter them yet, but it's easy enough to conditionally only add a checkbox to a video if its $status === FALSE. Ideally, we could only show Unimported videos (or All) with a configuration setting; I may follow this patch up with something that does this.
Alternatively, if we were able to compare values in the database before we send the API request, that would be better, so we're not dealing with a large table/list of videos for users who have many videos in Backlot (like we do).
For now, this patch simply checks the $status of the video and if it's FALSE adds the checkbox to the form. After the patch, if I select the "Check all" checkbox at the top of the Import screen, it only adds the videos not already imported.
I'm sure there's a better way, but for right now this is simple, and what we need.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 1493470-ooyala-Importcheckboxes-5.patch | 3.47 KB | torgospizza |
| #1 | 1493470.1-import-filter.patch | 3.81 KB | deviantintegral |
| ooyala.checkbox-imported.patch | 626 bytes | torgospizza |
Comments
Comment #1
deviantintegral commentedI agree that we should expose this as a UI instead. How does this patch look?
Comment #2
deviantintegral commentedComment #3
torgospizzaI'm actually looking at this again with 7.x-2.x, and I think there's an even better way to do it: Custom Metadata via the Backlot API.
http://support.ooyala.com/developers/documentation/api/asset_metadata.html
This would allow us to write metadata back to Ooyala backlot for each asset that's imported, and in this case I think an "imported_at" timestamp would be great. You can then use the "include" parameter during your GET requests to filter out a) any videos previously imported, or b) videos that were imported at certain times, or onto certain sites. (For instance, maybe there could be additional metadata with site IDs or domains, so if you run multiple sites, you could have the site listed in this metadata as well. Up to 100, as per API standards.)
It would of course require some cron implementation for videos that have already been imported into Drupal, but I think it might be something worth researching, especially as we approach the 500-video limit for the API. The filtering needs to happen at the Backlot side, not on the Drupal side within an array_diff().
Comment #4
torgospizzaAlso it looks like in 7.x, $form_state['post'] no longer exists, so the patch in #1 does not work. Changing it to $form_state['input'] works, e.g.:
Comment #5
torgospizzaHere's an updated patch for the latest version of 7.x-2.x-dev. It allows the list to be filtered by Imported and Unimported.
This issue is also related to a new (meta?) issue I opened: #1891914: Paginate, filter, and sort the import list
Comment #6
torgospizza