Added option --pretend to only print the filenames#1162
Added option --pretend to only print the filenames#1162sampsyo merged 4 commits intobeetbox:masterfrom
Conversation
… without importing them
|
Thank you for splitting this out! I'll add a few very low-level comments in-line. Thanks for your patience with this. 🎉 |
beets/importer.py
Outdated
There was a problem hiding this comment.
Rather than use this intermediate session.pretend field, we should probably just access session.config['pretend'] for uniformity. To make this work without an explicit membership check, you can add pretend: false to the import section of config_default.yaml.
|
OK, there are my tiny, nit-picking comments. One last thing, which may not be attainable: it's somewhat worrisome that the pretend flag has to appear in four different conditionals. For example, it would be awesome to find a way to make it orthogonal to the "Nothing imported from…" message so that (a) no change would be necessary there, and (b) we'd still get the warning, even in pretend mode. This cleanliness may not be possible to achieve easily, but it's worth pondering. |
…only one place where it is read. Changed the output to use the log system rather than print_.
|
I think I've worked out all the points you mentioned. |
|
Hmm... I tried to change the
Any ideas how to solve this? |
docs/reference/cli.rst
Outdated
|
Fantastic! Thank you for being persistent. This is getting into good shape. At the risk of being demanding, can I ask for one last iteration? On a closer inspection, I think the best way to get the full orthogonality we need here is to use a separate pipeline stage for To see how to do this, look in the Does that make sense? I'd be happy to help with this if you need assistance puzzling through. Let me know and I'll make you a collaborator so you can push to a branch. Also: Yes, good point about interacting with your new filter idea. A new event like |
Corrected the documentation (shortcut -e is not available any more)
|
Here we go 😄... This seems to be a very straight forward solution. The only drawback is the creation of the pipeline stages, it's a bit more complex now. And: Yes, you're right, I forgot to remove the BTW: What is the right place to start a chat about the new filter. Should I open an issue? |
Added option --pretend to only print the filenames
|
Awesome! Thank you again for working through this. Yes, let's talk about the filter in a new issue (or a new PR). Specifically, I think it now should be quite straightforward to implement with (a) a new plugin event, and (b) extending |
Added option
--pretend(or-e) to only print the filenames of files to import without actually importing them.