We have hundreds of videos in our Backlot, bur since the API limit for queries is 500, we only receive a partial list when attempting to run an import. It'd be great if we could 1) paginate the total list, 2) allow sorting by oldest or created ascending/descending instead of just newest, and 3) filter the list to only include videos that have not yet been imported.

Ideally, the filtering feature would be done in a way that we can switch between filtered and not. Perhaps we should store all of this information in a table, so that we can integrate with Views? This would cut down on costly (and sometimes long) calls to the API. We might be able to ping Backlot to see if there are any new items, but I can't seem any direct API calls to do that, so it might be more involved. Additionally, we could compare the $last_sync variable to see if we've surpassed a set schedule. Finally, having Views integration would allow us automatic filtration or configuring pages in other ways, such as with tabs.

Sorting and filtering the list does require new options to be added to the various API calls that are initiated, since the V2 Ooyala API does allow for more advanced queries. (See http://support.ooyala.com/developers/documentation/api/asset_video.html)

Since these are all semi-immediate needs for us, I'll try to come up with some solutions and see if they work for others. Thoughts, patches and further discussion are welcome.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

Thanks @torgosPizza! I'd be happy to look at any suggestions you have for this.

Perhaps we should store all of this information in a table, so that we can integrate with Views?

That's an interesting suggestion. Maybe we could create a table similar to the "file_usage" table, which keeps track of every node where a file is in use. Since there isn't any rule of exclusivity on videos, knowing if a video is already in use on a node (or multiple nodes) may be helpful to know. And of course you could filter the list to just un-imported videos.

torgosPizza’s picture

Status: Active » Needs review
FileSize
3.47 KB

I'd forgotten that an attempt at a filtering process (just with the API) was attempted at #1891914: Paginate, filter, and sort the import list . I've attached a new Patch (same as the one in my comment at the above issue) for testing.

I figure, not everyone will want to enable Views, so we should make the changes to work with just the API-driven Import page whenever possible.

torgosPizza’s picture

Ugh. The only issue with the method in that patch, which I'd forgotten until just now, is that the limit is still 500, and the filtering takes place at the table level via array operations. This means that we're not actually filtering against what's listed in the API. Probably the only real way to fix this would be with pagination, which I can integrate with a new patch in addition to the one in #2.

I'd love if the Ooyala API could take a payload in the form of a JSON object, containing embed IDs we want to exclude. But then again that could cause further issues... so this may be a limitation inherent to the Ooyala API itself (w/r/t how many items are returned) and in that case, our two best options are 1) Pagination for API Import page and 2) Views integration for "more advanced" filtering.

torgosPizza’s picture

Status: Needs review » Needs work

Setting back to Needs Work as I'm now actively working on our D7 site again.