How to find version by uploaded movie name?

Hi all,

I am trying to find versions by checking their uploaded movie.
I thought the usual filter syntax would work, e.g.:

    filters = [['project', 'is', {'type': 'Project', 'id':show_id}],
              ['sg_uploaded_movie', 'is', mov_name]]
    versions = self.CONNECT.find('Version', filters, columns)

But I get an error saying:

shotgun_api3.shotgun.Fault: API read() Version.sg_uploaded_movie’s ‘url’ data type cannot be used in a filter

What is the best way to do this? I don’t think finding all versions in a project to then check their “sg_uploaded_movie” field is very efficient, right?!

Cheers,
frank

Hi @frank,

I am not at my computer right now, to work out the exact code example. But, I think this error is because the sg_uploaded_movie field is just pointing at an attachment. You may need to walk to the Version in the other direction by getting the File entity and then checking which Version entity it is attached to.

File docs

2 Likes

Thanks, it never occurred to me to search for uploaded movies directly. Will see what the search query is for that.

Thanks,
Frank