It there any trick that would let me build the queue programmatically?

Hi. This is another discussion about the queue sort order, of course, only I’m aiming for the nuclear option: offloading the sorting to my own scripts. The situation is that I have a backlog of episodes on a bunch of subscriptions added at different times, and I’m interspersing them in the chronological order of each podcast, with some personal preferences: two daily news/political episodes, then one of infotainment to bring the blood pressure down. This order is quite tedious to do manually via the app interface, but seems to be pretty well scriptable. (It’s also vaguely similar to ‘smart shuffling’, which I just discovered, but may turn out to be different enough from it.)

The question: do the authors/maintainers, by any chance, know of any functions in the app that would allow me to have the queue populated programmatically by scripts, with the least amount of hassle? I.e. something like importing a playlist, or maybe there are some intents that put an episode into the queue.

From what I know so far, it seems that exporting the database, fiddling with the queue in it and re-importing is the best bet. Since I’m in control of all the data, I should likely avoid corrupting the status of episodes, though would still need to press ‘download’ on each one in the queue. Doing this once a month or so sounds alright, compared to dragging episodes ad nauseam. But maybe there’s a more lightweight option? Carefully preserving the database consistency is sorta involved, and this approach may break stuff when the app updates the database structure.

Synchronization apparently won’t help me with this, as it’s said to not affect the queue: Backing up your episodes – AntennaPod

To clarify, this is not a feature request, though I’d guess that the feature, if implemented in an approachable way, would alleviate the needs of some ‘advanced’ users. Maybe something like an API, e.g. via the ‘content providers’ thing.

For the context, the current version now is 2.2.1 (though I’m using a sideloaded build).