How to Sync Playlist to SD Card & Modify Tag During Move #6665
Replies: 1 comment 1 reply
|
A small local plugin can rewrite only the copied file: import os
from beets.plugins import BeetsPlugin
from beets.util import bytestring_path, normpath
class PlayerExportPlugin(BeetsPlugin):
def __init__(self):
super().__init__()
self.config.add({"root": "/Volumes/mp3_player"})
self.register_listener("item_copied", self.item_copied)
def item_copied(self, item, source, destination):
root = normpath(bytestring_path(self.config["root"].as_filename()))
destination = normpath(destination)
try:
if os.path.commonpath([root, destination]) != root:
return
except ValueError:
return
item.write(
path=destination,
tags={"artist": item.albumartist or item.artist},
)Configure the mount point if needed: plugins: playerexport
playerexport:
root: /Volumes/mp3_playerThen your existing command can stay the same: beet move -e playlist:music_for_player -d /Volumes/mp3_player
The relevant implementation paths are |
Uh oh!
There was an error while loading. Please reload this page.
Sorry for the combo title, I want to make sure others can find it.
I use beets to organize all my music. I made an
.m3uplaylist with ~800 songs, and I want to sync them to an sd card. I usebeets move -e playlist:music_for_player -d /Volumes/mp3_playerand they're copied over, which is great. However, my mp3 player does not use$albumartist, it uses$artistfor sorting and separation and display, meaning that my Charlie XCX album is listed under multiple artists, one for eachCharlie XCX feat. SOME_ARTIST.I'd like to be able to perform the move and also apply a change/normalization to the moved files, replacing
$artistwith$albumartist. Is this possible?All reactions