Libation icon indicating copy to clipboard operation
Libation copied to clipboard

Stateless import functionality from command line interface.

Open mattalxndr opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe.

The current functionality of the command line interface and docker image is essentially "import all unimported titles every n minutes".

This works fine, but I am running libation import as part of a larger process, and I would prefer to maintain state myself, and keep the container stateless.

Put a different way, I'm already keeping track of which titles have been imported, so libation keeping track is a redundancy.

Describe the solution you'd like

--ids=#####,#####

Instead of "import all unimported titles every n minutes", I would like to be able to pass in an optional list of Audible IDs, which would make it "import these titles if unimported".

Obviously, the polling wouldn't make sense with this option passed, so the script would exit after one import, if this parameter is present.

--rescan

Libation's current default import behavior is to follow the "downloaded" status as it exists in its database without consulting the filesystem.

So an optional rescan flag would make sense as well, which mirrors the existing "auto set Downloaded status" menu option. The scan would happen before the import, and it would filter the list of titles to be imported.

Describe alternatives you've considered

One way to accomplish statelessness now would be to destroy the volumes/container after every run, but then I would not be taking advantage of the caching of my Audible data that libation provides.

Also, to avoid a full import every time, I would need to update the database before every import, in order to control which titles are downloaded. Something along the lines of this would be necessary:

UPDATE book SET imported = TRUE;
UPDATE book SET imported = FALSE WHERE id = %;

Additional context

If I pass these two parameters and run the import with an empty "Books" directory, the container would be stateless.


EDIT: Just noticed libationcli set-status. So my rescan flag is unnecessary.

mattalxndr avatar Aug 13 '23 20:08 mattalxndr

So this is already possible. eg. liberate B002V5H6F4 B002V5H55A

see liberate --help for more info

Mbucari avatar Aug 18 '23 17:08 Mbucari

I don't think we'll ever get "stateless" (and I kind of don't think it would help if we did) ... but we could come closer to it by exposing more of the command line from the docker configuration, and deleting the script we provide now (I think that might have been a good idea before we added more to the API, but it's definitely not anymore).

I've got to take another look at this, maybe it'll make sense this time.

-Wm

On Fri, Aug 18, 2023 at 10:15 AM Mbucari @.***> wrote:

So this is already possible. eg. liberate B002V5H6F4 B002V5H55A

— Reply to this email directly, view it on GitHub https://github.com/rmcrackan/Libation/issues/711#issuecomment-1684207872, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ7H6PI7ZGNBQ2XL64ZM4TXV6PKZANCNFSM6AAAAAA3O37QE4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

wtanksleyjr avatar Aug 18 '23 17:08 wtanksleyjr

Cleaning up old tickets. See Mbucari's solution above.

rmcrackan avatar Jul 13 '24 11:07 rmcrackan