Skip to content

feat(import): Add support for reading skipped paths from logfile - #4387

Merged
sampsyo merged 4 commits into
beetbox:masterfrom
Holzhaus:import-from-logfile
Jun 29, 2022
Merged

feat(import): Add support for reading skipped paths from logfile#4387
sampsyo merged 4 commits into
beetbox:masterfrom
Holzhaus:import-from-logfile

Conversation

@Holzhaus

@Holzhaus Holzhaus commented Jun 26, 2022

Copy link
Copy Markdown
Contributor

Description

Fixes #4379.

To Do

  • Documentation. (If you've add a new command-line flag, for example, find the appropriate page under docs/ to describe it.)
  • Changelog. (Add an entry to docs/changelog.rst near the top of the document.)
  • Test. (Encouraged but not strictly required.)

@Holzhaus
Holzhaus force-pushed the import-from-logfile branch from f3d0039 to 74e5498 Compare June 26, 2022 17:38

@sampsyo sampsyo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super cool; thank you for looking into this!

If it doesn't seem overly complex to implement, I think I'd prefer to use an explicit command-line flag (like beet import --read-log foo.log) as opposed to implicitly allowing logs as arguments alongside files/directories. The main benefit would be that it will be more "debuggable" from the perspective of the user: if the log file isn't want they expect or is malformed, they can get a useful error message instead of letting the text file be treated as a media file. I hope this makes sense!

Comment thread beets/ui/commands.py Outdated
Holzhaus added a commit to Holzhaus/beets that referenced this pull request Jun 27, 2022
Holzhaus added a commit to Holzhaus/beets that referenced this pull request Jun 27, 2022
@Holzhaus
Holzhaus force-pushed the import-from-logfile branch from cb1d45e to 6c81679 Compare June 27, 2022 18:23
Holzhaus added a commit to Holzhaus/beets that referenced this pull request Jun 27, 2022
@Holzhaus
Holzhaus force-pushed the import-from-logfile branch 2 times, most recently from 999b960 to 47cb273 Compare June 27, 2022 20:20
@Holzhaus
Holzhaus force-pushed the import-from-logfile branch from 47cb273 to 3e37d01 Compare June 27, 2022 22:17

@Holzhaus Holzhaus left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it doesn't seem overly complex to implement, I think I'd prefer to use an explicit command-line flag (like beet import --read-log foo.log) as opposed to implicitly allowing logs as arguments alongside files/directories.

Done. I also added a small test for the helper function.

Sorry for the force-pushing, I abused git as a way to deploy the code on my NAS (so I can test it on my library). Also don't have windows so I had to use the CI for trial and error test driven development ;-)

@sampsyo sampsyo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome; thanks for taking this "flag" approach! I think this is basically there—I have one or two very low-level comments for your consideration.

Comment thread beets/ui/commands.py Outdated
Comment thread beets/ui/commands.py
Comment thread beets/ui/commands.py Outdated
@Holzhaus

Copy link
Copy Markdown
Contributor Author

ready to review

@sampsyo sampsyo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great. Thanks for the fast and clean work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow importing from logfile

2 participants