Background task cannot return a media object?

I have a background task that returns (among other things) a Media object.

However, when I try to access the task result with task.get_return_value() I get this error:

undefined: The state or return value could not be serialised

I get this for any kind of media object.

The interesting thing is that my app can easily switch from running the task in the background to running the task in the foreground. In the latter case everything works fine.
Also if the task returns other data, but no media object, running it in the background is fine.

So my conclusion is that there is something fishy with the serialisation of media objects in the background task code.

Suggestions?

Created a feature request for this: Let background task return a Media object

my discussion on this a few months ago, if you haven’t seen this…

1 Like

Thanks for pointing this out. I have added a comment.