question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Files without extension cannot have one added

See original GitHub issue

Problem

I imported a bunch of music in files without extensions. They import, and the files are renamed, but none of them have an extension, which makes them unacceptable for playing in some players.

Adding the $format symbol to the path: configurations don’t work properly, and no extension is added when all the files are targeted with the move command.

Running this command in verbose (-vv) mode:

$ beet -vv mv -p "Multi Muysic"
user configuration: /home/egon/.config/beets/config.yaml
data directory: /home/egon/.config/beets
plugin paths:
Sending event: pluginload
library database: /home/egon/.config/beets/library.db
library directory: /music/beets
Sending event: library_opened
Moving 0 items (8 already in place).
Sending event: cli_exit

Led to this problem:

Moving 0 items (8 already in place).

Here’s a link to the music files that trigger the bug (if relevant):

The filenames are the problem, not the content of the filenames

beet ls "Multi Muysic" --path
/music/beets/A-D/Aavikko/Multi Muysic/01 Synchro Start
/music/beets/A-D/Aavikko/Multi Muysic/02 New York–London–Siilinjärvi–Tokyo
/music/beets/A-D/Aavikko/Multi Muysic/03 Sports Criminal
/music/beets/A-D/Aavikko/Multi Muysic/04 Seoul ’88
/music/beets/A-D/Aavikko/Multi Muysic/05 Omavastuualue
/music/beets/A-D/Aavikko/Multi Muysic/06 Slalom Tripmaster
/music/beets/A-D/Aavikko/Multi Muysic/07 Bermuda 3
/music/beets/A-D/Aavikko/Multi Muysic/12 Torpedo Girls

Setup

  • OS: Linux nuc 4.4.0-57-generic #78-Ubuntu SMP Fri Dec 9 23:50:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
  • Python version: 2.7.12
  • beets version: 1.4.9, 1.5.0
  • Turning off plugins made problem go away (yes/no): no

My configuration (output of beet config) is:

plugins: fromfilename duplicates chroma missing bucket badfiles mbsync embedart fetchart discogs
duplicates:
    tiebreak:
        items: [bitrate]
    copy: ''
    tag: ''
    checksum: ''
    format: ''
    merge: no
    count: no
    full: no
    album: no
    path: no
    strict: no
    keys: []
    delete: no
    move: ''
incremental: yes
bucket:
    bucket_alpha:
    - 0-9
    - A-D
    - E-L
    - M-R
    - S-Z
    - Unicode
    bucket_alpha_regex:
        0-9: "^[0-9\xD8]"
        A-D: "^[a-dA-D\xC6\u0391\u0410\xC1\xC2\u0100\u0386\u0412\u010C\u0421\u0414]"
        E-L: "^[e-lE-L\xC9\u039A\u0399\u041D]"
        M-R: "^[m-rM-R\u041C\xD3\u03A1\u0418\u039C\u03A0\u041F\u0393\u03BC]"
        S-Z: "^[s-zS-Z\u0160\xDC\u03A3\u0531]"
        Unicode: "^[\u30AB\uB0A8\u4E45\u51A8\u5742\u5C0F\u5E73\u6731\u677E\u6C34\u6D5C\u7802\u83C5\u9577\u12A0\u304B\u30B7\u054B\u4EF2\u524D\u584A\u5DBA\u6238\u6751\u68B6\u6C60\u6DF1\u7D30\u9060\u98A8\u306F\u30C1\u30B8\u4E09\u4F0A\u5411\u5883\u5E03\u65B0\u6771\u691B\u6D45\u7530\u82B1\u9234\u9F13\u3086\u305F\u0639\u0645\u0646\u05D0\u05D6\u5409\u690D\u77E2\u042E]"
    extrapolate: no
    bucket_year: []
discogs:
    user_token: REDACTED
    apikey: REDACTED
    apisecret: REDACTED
    source_weight: 0.5
    tokenfile: discogs_token.json
directory: /music/beets

paths:
    default: '%bucket{$albumartist}/${albumartist}/${album}%aunique{}/$track ${title}.%lower{$format}'
    singleton: Non-Album/$artist/${title}.%lower{$format}
    comp: Compilations/$album%aunique{}/$track ${title}.%lower{$format}

import:
    move: no

replace:
    '[\\/]': _
    '[\x00-\x1f]': _
    '[<>:"\?\*\|]': _
    \s+$: ''
    ^\s+: ''
    ^-: _
max_filename_length: 0
embedart:
    remove_art_file: no
    maxwidth: 0
    ifempty: no
    auto: yes
    compare_threshold: 0
fetchart:
    fanarttv_key: REDACTED
    cautious: no
    sources:
    - filesystem
    - coverart
    - itunes
    - amazon
    - albumart
    minwidth: 0
    cover_names:
    - cover
    - front
    - art
    - album
    - folder
    google_engine: 001442825323518660753:hrh5ch1gjzm
    store_source: no
    google_key: REDACTED
    auto: yes
    maxwidth: 0
    enforce_ratio: no
missing:
    count: no
    total: no
    album: no
chroma:
    auto: yes

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
egon010commented, Apr 27, 2021

If the main program’s goal is to preserve extension, and not mess with them, then moving this kind of case to a plugin seems like the most desired path. It was unclear that $format isn’t meant to specify an extension for a file.

This is probably an edge case I’ve discovered. There may be an interaction with any naming format that wants to have more than one .SOMETING in the last portion of the name path, but that wouldn’t be a legal name in all filesystems, so maybe it’s just not supported.

I will investigate a plugin.

0reactions
stale[bot]commented, Jun 26, 2021

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Types Of File Preview Errors And How To Handle Them
If you're seeing the error message Files without extensions cannot be previewed, it's because the file doesn't have a suffix attached to the...
Read more >
How To Open a File With No Extension
You should first confirm if your file actually has no extension, or you just don't have the program needed to open a particular...
Read more >
Solved: Help with Extensionless files can't be previewed
Put the extensions back on the files and you should be able to view/open them. Changing the name should not have messed them...
Read more >
How to add a New file (without extension) to 'New' Context ...
I want to add New File without an extension [ . ] to the New context menu in Windows and have already tried...
Read more >
asp.net core - How to serve static file with no extension
Adding an alternative solution. You have to set ServeUnknownFileTypes to true and after that set the default content type. app.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found