`dont_convert` option implemented.
Local testing indicates success.
@@ -31,6 +31,8 @@ from beets.plugins import BeetsPlugin
from beets.util.confit import ConfigTypeError
from beets import art
from beets.util.artresizer import ArtResizer
+from beets.library import parse_query_string
+from beets.library import Item
_fs_lock = threading.Lock()
_temp_files = [] # Keep track of temporary transcoded files for deletion.
@@ -92,6 +94,12 @@ def should_transcode(item, fmt):
"""Determine whether the item should be transcoded as part of
conversion (i.e., its bitrate is high or it has the wrong format).
"""
+ dont_convert_queries = config['convert']['dont_convert'].as_str_seq()
+ if dont_convert_queries:
+ for query_string in dont_convert_queries:
+ query, _ = parse_query_string(query_string, Item)
+ if query.match(item):
+ return False
if config['convert']['never_convert_lossy_files'] and \
not (item.format.lower() in LOSSLESS_FORMATS):
return False
