User Tools

Site Tools


config:beets

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
config:beets [2024/03/25 18:02] Wulf Rajekconfig:beets [2024/12/24 01:08] (current) – [Path template information] Wulf Rajek
Line 7: Line 7:
 <code> <code>
 #mint21 #mint21
-sudo apt-get install libchromaprint1 +sudo apt-get install libchromaprint1 mp3val flac python3-acoustid
-sudo apt-get install mp3val +
-sudo apt-get install python3-acoustid+
 sudo apt-get remove python-pip sudo apt-get remove python-pip
 sudo apt-get install python3-setuptools sudo apt-get install python3-setuptools
Line 22: Line 20:
 pip install beets-web-import pip install beets-web-import
 pip install python3-discogs-client pip install python3-discogs-client
 +# see notes below to patch copyartifacts
 pip install beets-copyartifacts pip install beets-copyartifacts
-2to3-2.7 -w ~/.local/lib/python3.10/site-packages/beetsplug/copyartifacts.py 
- 
-#adjust as following: 
-#line 104: 
-                file_ext = os.path.splitext(filename)[1].decode('utf8') 
-#line 143: 
-                print('   ', str(os.path.basename(f.decode('utf8')))) 
-#line 147: 
-        print('Copying artifact: {0}'.format(os.path.basename(dest_file.decode('utf8')))) 
-#line 156: 
-        print('Moving artifact: {0}'.format(os.path.basename(dest_file.decode('utf8')))) 
- 
-#add line 127 
-                dest_file = beets.util.bytestring_path(dest_file) 
- 
- 
-vi ~/.local/lib/python3.10/site-packages/beets/autotag/__init__.py 
-change line 75 from 
-def unidecode_punc_only(text): 
-to 
-def unicode_punc_only(text): 
- 
- 
  
 #Buggy as of 19/Sept/2020: #Buggy as of 19/Sept/2020:
 pip install beets-copyartifacts3 pip install beets-copyartifacts3
 pip install beets-extrafiles pip install beets-extrafiles
 +
 +#Mint22:
 +sudo apt-get install python3-acoustid libchromaprint1 mp3val flac
 +pipx install beets
 +pipx inject beets flask=2.2.5 discogs_client requests pylast pyacoustid pycairo pygobject python3-discogs-client discogs-client beets-copyartifacts beets-extrafiles
 +pipx inject beets beets-yearfixer beets-web-import
 +pipx inject beets git+https://github.com/edgars-supe/beets-importreplace.git
 +
 </code> </code>
  
Line 63: Line 47:
 </code> </code>
  
-====== Unicode in Tag replace ======+====== copyartifacts python3 patch ====== 
 +<code> 
 +2to3-2.7 -w ~/.local/lib/python3.10/site-packages/beetsplug/copyartifacts.py
  
-https://github.com/edgars-supe/beets-importreplace+#Mint22: 
 +sudo apt-get install 2to3 
 +2to3 -w ~/.local//share/pipx/venvs/beets/lib/python3.12/site-packages/beetsplug/copyartifacts.py 
 +</code> 
 +then adjust as following:
 <code> <code>
-pip install git+https://github.com/edgars-supe/beets-importreplace.git+#line 104: 
 +                file_ext = os.path.splitext(filename)[1].decode('utf8'
 +#line 143: 
 +                print('   ', str(os.path.basename(f.decode('utf8')))) 
 +#line 147: 
 +        print('Copying artifact: {0}'.format(os.path.basename(dest_file.decode('utf8')))) 
 +#line 156: 
 +        print('Moving artifact: {0}'.format(os.path.basename(dest_file.decode('utf8')))) 
 + 
 +#add line 127 
 +                dest_file = beets.util.bytestring_path(dest_file)
 </code> </code>
- +Change the init:
-add config and add importreplace to plugins config string:+
 <code> <code>
-#replace unicode apostrophes from mb with ascii version in tags +vi ~/.local/lib/python3.10/site-packages/beets/autotag/__init__.py 
-importreplace: +</code> 
-  replacements: +<code> 
-    - item_fields: title artist artist_sort artist_credit +#change line 75 from 
-      album_fieldsalbum artist artist_sort artist_credit +def unidecode_punc_only(text)
-      replace: +#to 
-        '[\u2018-\u201B]''''' +def unicode_punc_only(text):
-        '[\u201C-\u201F]': '"' +
-        '[\u2010-\u2015]': '-'+
 </code> </code>
  
 ====== Unicode in Tag Patch ====== ====== Unicode in Tag Patch ======
 +
 +NOTE: use import-replace plugin instead!
  
 MusicBrainz uses unicode characters for apostrophes, dashes etc rather than ascii versions. A beets plugin for filenames (asciify) solves some issues with this, but tags are unaffected. This patch for v1.5.0/v1.6.0 on python 3.8 solves this for imports: MusicBrainz uses unicode characters for apostrophes, dashes etc rather than ascii versions. A beets plugin for filenames (asciify) solves some issues with this, but tags are unaffected. This patch for v1.5.0/v1.6.0 on python 3.8 solves this for imports:
Line 547: Line 546:
 beet import -A -C -W -I -s /media/music/beets2/Non-Album/ beet import -A -C -W -I -s /media/music/beets2/Non-Album/
 </code> </code>
 +Update id3 tags after changing db 
 +<code> 
 +beet write 
 +</code>
 ====== Addons ====== ====== Addons ======
  
Line 702: Line 704:
 ====== importreplace ====== ====== importreplace ======
  
-A plugin for beets to perform regex replacements during import.+A plugin for beets to perform regex replacements during import, particularly useful to replace unicode apostrophes, double quotes, single quotes and hyphens/en dash from musicbrainz db with ascii equivalents.
  
 https://github.com/edgars-supe/beets-importreplace https://github.com/edgars-supe/beets-importreplace
 +
 +Installation:
 +<code>
 +pip install git+https://github.com/edgars-supe/beets-importreplace.git
 +</code>
 +
 +add config and add importreplace to plugins config string:
 +<code>
 +#replace unicode apostrophes from mb with ascii version in tags
 +importreplace:
 +  replacements:
 +    - item_fields: title artist artist_sort artist_credit
 +      album_fields: album artist artist_sort artist_credit
 +      replace:
 +        '[\u2018-\u201B]': ''''
 +        '[\u201C-\u201F]': '"'
 +        '[\u2010-\u2015]': '-'
 +</code>
 +
 +As this plugin works for import only, use the following to retag/reimport after installation, make sure to copy&paste as the below uses the unicode characters:
 +<code>
 +#for albums:
 +beet import -L ":[’”‐–—]"
 +
 +#for singletons:
 +beet import -L -s ":[’”‐–—]"
 +</code>
config/beets.1711389748.txt.gz · Last modified: by Wulf Rajek