Skip to content
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

The plugin does not follow beets-config for renaming illegal characters #7

Open
jinithin opened this issue Apr 19, 2019 · 0 comments
Open
Labels
bug Something isn't working

Comments

@jinithin
Copy link

I don't know if it's the intended behaviour, or if this is not done via calling the "illegal-characters" part of beets (though it seems like it when I read the code).

When importing an album with "illegal" characters, it does not resort to looking in the config.yaml file (eg. ':' becomes '_' instead of '.').

# what it should look like
Daft Punk - TRON. Legacy.log

# what it actually looks like
Daft Punk - TRON_ Legacy.log
@jinithin jinithin changed the title The plugin does not follow beets-renaming The plugin does not follow beets-config for renaming illegal characters Apr 19, 2019
@Holzhaus Holzhaus added the bug Something isn't working label Apr 20, 2019
gtronset added a commit to gtronset/beets-filetote that referenced this issue Nov 5, 2022
This is an exploration of
Holzhaus/beets-extrafiles#7 which appears to
not actually be a bug. Beets source replaces the following as part of
sanitization (see
[/beets/util/__init__.py#L623-L630](https://github.com/beetbox/beets/blob/4a9e7c1d3351d4b5ef67b01f924a3da70b64a74a/beets/util/__init__.py#L623-L630)):

```python
CHAR_REPLACE = [
    (re.compile(r'[\\/]'), '_'),  # / and \ -- forbidden everywhere.
    (re.compile(r'^\.'), '_'),  # Leading dot (hidden files on Unix).
    (re.compile(r'[\x00-\x1f]'), ''),  # Control characters.
    (re.compile(r'[<>:"\?\*\|]'), '_'),  # Windows "reserved characters".
    (re.compile(r'\.$'), '_'),  # Trailing dots.
    (re.compile(r'\s+$'), ''),  # Trailing whitespace.
]
```

Meaning, `_` is the actual correct replacement. Thus, tests have been
added but nothing else should be actionable at this time.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants