You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This idea was cooked up in #4571 (although there was a slight bit of confusion at the time) and it was recommended that I make a new thread.
While regex replacement functionality does exist in both the substitute and rewrite plugins, I haven't found an option to directly perform a find and replace on the database and file tags.
So as a proposal, this command/ would act similarly to beet modify and act on the library and tags. Additionally, functionality similar to import-replace could allow users to perform the replacements before autotagging to help strengthen potential matches.
Here's what I dreamed up:
beet replace [options] QUERY find:replace
Similar to QUERYfind:replace runs a simple find and replace while find::replace runs a regex find and replace
Running beet replace [options] would run the replacements set under in the config, but without having to run an import .
Options (same as beet modify):
-M don't move
-W don't write
-w write (default)
-a albums instead of items
-y skip yes prompt
Additional options:
-i case insensitive
-e matches entire word (using -e because "whole word" would intuitively be -w)
-f specify a field? (I'm not sure if this would be part of the query functionality or should be it's own option)
Config options:
auto: yes/no run config on import
case_insensitive: yes/no
entire_word: yes/no (not "whole word" for clarity as "-w" is already being used)
Additional config ideas from import-replace (quoting mostly from the import-replace readme):
item_fields is a set of fields to run replacements on for items
album_fields is a set of fields to run replacements on for albums
replace is a set of regex/replacement pairs
Overall the config may look like:
pluginname:
auto: yes
case_insensitive: no
entire_word: no
replacements:
- item_fields: title
replace:
'The':'That' (alternatively `The::'that' would be regex)
- item_fields: album
- album_fields: album
replace:
'Foo':'Bar'
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This idea was cooked up in #4571 (although there was a slight bit of confusion at the time) and it was recommended that I make a new thread.
While regex replacement functionality does exist in both the substitute and rewrite plugins, I haven't found an option to directly perform a find and replace on the database and file tags.
So as a proposal, this command/ would act similarly to
beet modify
and act on the library and tags. Additionally, functionality similar to import-replace could allow users to perform the replacements before autotagging to help strengthen potential matches.Here's what I dreamed up:
beet replace [options] QUERY find:replace
Similar to
QUERY
find:replace
runs a simple find and replace whilefind::replace
runs a regex find and replaceRunning
beet replace [options]
would run the replacements set under in the config, but without having to run an import .Options (same as
beet modify
):-M
don't move-W
don't write-w
write (default)-a
albums instead of items-y
skip yes promptAdditional options:
-i
case insensitive-e
matches entire word (using -e because "whole word" would intuitively be -w)-f
specify a field? (I'm not sure if this would be part of the query functionality or should be it's own option)Config options:
auto: yes/no
run config on importcase_insensitive: yes/no
entire_word: yes/no
(not "whole word" for clarity as "-w" is already being used)Additional config ideas from import-replace (quoting mostly from the import-replace readme):
item_fields
is a set of fields to run replacements on for itemsalbum_fields
is a set of fields to run replacements on for albumsreplace
is a set of regex/replacement pairsOverall the config may look like:
Beta Was this translation helpful? Give feedback.
All reactions