beetbox / beets

music library manager and MusicBrainz tagger
http://beets.io/
MIT License
12.89k stars 1.82k forks source link

Beets doesn't rename song's filenames #3653

Closed entuccio closed 4 years ago

entuccio commented 4 years ago

Problem

Running this command in verbose (-vv) mode:

user configuration: /Users/daniele/.config/beets/config.yaml
data directory: /Users/daniele/.config/beets
plugin paths: 
Sending event: pluginload
lyrics: Disabling google source: no API key configured.
library database: /Users/daniele/.config/beets/library.db
library directory: /Volumes/GoogleDrive/My Drive/DaniSynologyNas/Musica
Sending event: library_opened
Usage: 
  beet COMMAND [ARGS...]
  beet help COMMAND

Options:
  --format-item=FORMAT_ITEM
                        print with custom format
  --format-album=FORMAT_ALBUM
                        print with custom format
  -l LIBRARY, --library=LIBRARY
                        library database file to use
  -d DIRECTORY, --directory=DIRECTORY
                        destination music directory
  -v, --verbose         log more details (use twice for even more)
  -c CONFIG, --config=CONFIG
                        path to configuration file
  -h, --help            show this help message and exit

Commands:
  clearart          remove images from file metadata
  config            show or edit the user configuration
  duplicates (dup)  List duplicate tracks or albums.
  edit              interactively edit metadata
  embedart          embed image files into file metadata
  extractart        extract an image from file metadata
  fetchart          download album art
  fields            show fields available for queries and format strings
  help (?)          give detailed help on a specific sub-command
  import (imp, im)  import new music
  info              show file metadata
  lastgenre         fetch genres
  lastimport        import last.fm play-count
  list (ls)         query the library
  lyrics            fetch song lyrics
  mbupdate          Update MusicBrainz collection
  missing (miss)    List missing tracks.
  modify (mod)      change metadata fields
  move (mv)         move or copy items
  mpdstats          run a MPD client to gather play statistics
  play              send music to a player as a playlist
  random            choose a random track or album
  remove (rm)       remove matching items from the library
  scrub             clean audio tags
  splupdate         update the smart playlists. Playlist names may be passed
                    as arguments.
  stats             show statistics about the library or a query
  update (upd, up)  update the library
  version           output version information
  write             write tag information to files
  ydl               Download music from YouTube
Sending event: cli_exit

Led to this problem:

(paste here)

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

Setup

My configuration (output of beet config) is:

directory: /Volumes/GoogleDrive/My Drive/DaniSynologyNas/Musica

import:
    move: yes
    copy: no
    write: yes

plugins: edit lyrics scrub mbcollection mpdstats fetchart smartplaylist mpdupdate random embedart random lastimport duplicates missing fromfilename lastimport info hook play lastgenre ydl discogs

embedart:
    auto: yes      

ignore_hidden: yes                        

mpd:
    host: localhost
    port: 6600

lyrics:
  auto: no
  sources:
    - google
    - lyricwiki
    - musixmatch
    - genius

smartplaylist:
    relative_to: /Volumes/GoogleDrive/My Drive/DaniSynologyNas/Musica
    playlist_dir: ~/.mpd/playlists
    playlists:
        - name: smart_allFrancoBattiato.m3u
          query: 'artist:Franco Battiato'

        - name: smart_allMuse.m3u
          query: 'artist:Muse'

        - name: smart_allSystemOfaDown.m3u
          query: 'artist:System of a Down'

        - name: smart_allLucioBattisti.m3u
          query: 'artist:Lucio Battisti'

        - name: smart_allQueen.m3u
          query: 'artist:Queen'

        - name: smart_allFabriFibra.m3u
          query: 'artist:fabri fibra'

        - name: smart_allKaos.m3u
          query: 'artist:kaos one'

hook:
  hooks:
    # chiama Alfred quando inizia importazione
    - event: import_task_start
      command: /usr/bin/osascript /Applications/Alfred.alfredpreferences/workflows/user.workflow.768A02FA-A8F7-444B-9288-CB9F22FACACE/inizioimportazione.scpt

    # chiama Alfred quando completa una importazione
    - event: import
      command: /usr/bin/osascript /Applications/Alfred.alfredpreferences/workflows/user.workflow.768A02FA-A8F7-444B-9288-CB9F22FACACE/importazione.scpt

#serve per creare la playlist di un album
play:
    command: /usr/local/bin/mpc load

missing:
    format: $albumartist - $title -$year
    count: no
    total: no

mbcollection:
    auto: yes
    remove: yes

musicbrainz:
    user: entuccio
    pass: 

fetchart:
    auto: yes
    minwidth: 0
    maxwidth: 0
    enforce_ratio: no
    cautious: no
    cover_names:
    - cover
    - front
    - art
    - album
    - folder
    sources:
    - filesystem
    - coverart
    - itunes
    - amazon
    - albumart
    google_key: REDACTED
    google_engine: 001442825323518660753:hrh5ch1gjzm
    fanarttv_key: REDACTED
    store_source: no

duplicates:
    album: no
    checksum: ''
    copy: ''
    count: no
    delete: no
    format: ''
    full: no
    keys: []
    merge: no
    move: ''
    path: no
    tiebreak: {}
    strict: no
    tag: ''

sort_album: year+

replace:
    '[\\/]': ''
    '^\.': _
    '[\x00-\x1f]': ''
    '[<>:"\?\*\|]': ''
    '\.$': ''
    '\s+$': ''
    '^\s+': ''
    '[\xf9]': ''
    '[\xfa]': ''
    '[ù]': ''

color: yes

bell: yes

paths:
    default: $albumartist/$album%aunique{}/$track $title
    singleton: Non-Album/$artist/$title
    comp: Compilations/$album%aunique{}/$track $title
sampsyo commented 4 years ago

Hello! Did you mean to include details, such as how to reproduce the problem?

entuccio commented 4 years ago

I would like to delete specific letters/symbols of the song's filenames. (while I import)

In specific I would like to delete "ì$&()+òàè"é*'_-?!" characters in file name.

sampsyo commented 4 years ago

Hello again—to make it possible to understand what's going wrong, you will need to provide (much) more detail. I wrote this blog post about reporting bugs effectively, which you might find useful: https://www.cs.cornell.edu/~asampson/blog/bugrubric.html

entuccio commented 4 years ago

Sorry.

Let me explain better

I would like to delete specific letters/symbols of the song's filenames. (while I import) In specific I would like to delete "ì$&()+òàè"é*'_-?!" characters in file name.

So for example when I import a song with filename: Non è così?.mp3 ---> non cos.mp3 perchè sì.mp3 --> perch s.mp3

I tried to do "beet update" but it seems it haven't any effect on filenames.

I also tried to import new album or songs.

I specified in configuration:

replace: '[\xf9]': '' '[\xfa]': '' '[ù]': ''

Which are ASCII code for "ù" (in this case i wanted to replace [ù->' ']

Is there something wrong in my configuration file?

Thanks

sampsyo commented 4 years ago

Got it! That's a good start, and your replace config looks good (although you should not need the square brackets for single characters). But it would be great to see the actual verbose output from a command that encounters this problem, including ls showing exactly what the filenames are before and after.

The most likely explanation here is encoding problems: your filenames encode the ù character differently from how the replacement thing is searching for them.

entuccio commented 4 years ago

Weird.

I wrote all code I found for character "ù" .

I have an italian keyboard on my Mac.

replace: '[\xf9]': '' '[\xfa]': '' 'ù': 'u' 'ù': 'u' '\xf9': 'u' '\x0249': 'u' '\x249': 'u' '\00F9': 'u' '00F9': 'u' '151': 'u' '\151': 'u' 'U+00F9': 'u' 'F9': 'u' (assuming replace ù with u)

Where can I find my correct encode code for ù ? Thanks

entuccio commented 4 years ago

Tried all this:

https://graphemica.com/%C3%B9

jtpavlock commented 4 years ago

Does %asciify{text} as seen in template functions work ?

jslpc commented 4 years ago

Just a heads up, you may want to remove your MusicBrainz password from your config when pasting it in an issue.

jackwilsdon commented 4 years ago

Good catch @jslpc. I've gone ahead and removed it from the original issue, although I'm rather confused as to why it wasn't redacted by beet config...

@entuccio I'd suggest changing your musicbrainz password.

stale[bot] commented 4 years ago

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.