diff --git a/beetsplug/convert.py b/beetsplug/convert.py index bb06488f9..536acf16e 100644 --- a/beetsplug/convert.py +++ b/beetsplug/convert.py @@ -84,6 +84,7 @@ def get_format(fmt=None): return (command.encode("utf-8"), extension.encode("utf-8")) + def in_no_convert(item: Item) -> bool: no_convert_query = config["convert"]["no_convert"].as_str() @@ -92,7 +93,8 @@ def in_no_convert(item: Item) -> bool: return query.match(item) else: return False - + + 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). diff --git a/test/plugins/test_convert.py b/test/plugins/test_convert.py index 9057b2472..e43970dda 100644 --- a/test/plugins/test_convert.py +++ b/test/plugins/test_convert.py @@ -18,12 +18,11 @@ import os.path import re import sys import unittest -import pytest +import pytest from mediafile import MediaFile from beets import util -from beetsplug import convert from beets.library import Item from beets.test import _common from beets.test.helper import ( @@ -34,6 +33,7 @@ from beets.test.helper import ( control_stdin, ) from beets.util import bytestring_path, displayable_path +from beetsplug import convert def shell_quote(text): @@ -352,7 +352,6 @@ class TestNoConvert: ("bitrate:320 , format:ogg", True), ], ) - def test_no_convert_skip(self, config_value, should_skip): item = Item(format="ogg", bitrate=256) convert.config["convert"]["no_convert"] = config_value