Code help on launching an import from within a plugin #4724
-
Sorry for cross posting between here and discord. No responses over there. I am working on a plugin and I would like to launch an import session from code. I have a specific staging directory that I would like to point the import to and have it run in the normal interactive mode. I have been trying to get beets.ui.commands import_files(lib, paths, query) to work for me. Can't seem to get it to work. For parameters, I am passing the path to the staging directory in via the paths parameter. In my mind there is no query, but if I leave that blank, the import does indeed fire up, but it appears that it is running for the entire library instead of the staging directory. Thought maybe that paths mean something else and I should be putting the staging directory in as the query. Tried that and the command did not return. Is there another way to do this? Ami I just confused about the parameters? Any help will be appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I'm not sure if I understand entirely what you mean by "from code" but I try to explain the usual ways beets can import things via the cli:
So maybe this helps with your question: Yes indeed if you want to reimport a query is required. If you want to import/reimport and know a directory, then a regular import and passing a path is the way to go. HTH |
Beta Was this translation helpful? Give feedback.
-
I believe this has already been answered on Discourse. |
Beta Was this translation helpful? Give feedback.
I believe this has already been answered on Discourse.