New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add list-tracks command #46
Conversation
Add a list-tracks command that prints all tracks that are part of a collection. Closes #45
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me aside from the inline comments I left. I'm not sure how useful this command will be to solve @sindreruud's usecase, but in any case, I'm fine with adding this command. In particuar I agree that actually writing m3u's is not really in-scope for this plugin (unless it is very easy to hook into importfeeds
and let it do all the work).
beetsplug/alternatives.py
Outdated
beets.config[beets.library.Item._format_config_key].set( | ||
options.format) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should use beets.ui._set_format
, see the usage in beets.ui.add_format_option
. This should also fix the type errors on Python 2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was my initial idea, too. However, _set_format
is an internal method on the CommonOptionsParser
object and I’d like to avoid constructing such an object if we don’t need it. I tackled the Python 2.7 error by using decargs
.
description=""" | ||
List all tracks that are currently part of an alternative | ||
collection""", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does argparse
strip the additional linebreak here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. (I had to insert the linebreak because of flake8)
README.md
Outdated
The `--format` option accepts a [beets path format][path-format] string that is | ||
used to format each track. | ||
|
||
[path-format]: https://beets.readthedocs.io/en/v1.4.9/reference/pathformat.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better change this to the latest
readthedocs URL.
https://beets.readthedocs.io/en/latest/reference/pathformat.html
Looking good 🎉 I'm just gonna go ahead and merge, this is a reasonable command to have whether or not it ultimately solves @sindreruud's usecase. |
btw, the recent travis failures on Python 3.9 were caused by this bug: https://travis-ci.community/t/python-development-versions-no-longer-include-pip-due-to-virtualenv-20-x/7180 which is fixed now |
Closes #45
Add a list-tracks command that prints all tracks that are part of a collection.
@sindreruud could you have a look at this and check if this would work for you?