File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 31
31
from beets .util .confit import ConfigTypeError
32
32
from beets import art
33
33
from beets .util .artresizer import ArtResizer
34
+ from beets .library import parse_query_string
35
+ from beets .library import Item
34
36
35
37
_fs_lock = threading .Lock ()
36
38
_temp_files = [] # Keep track of temporary transcoded files for deletion.
@@ -92,6 +94,12 @@ def should_transcode(item, fmt):
92
94
"""Determine whether the item should be transcoded as part of
93
95
conversion (i.e., its bitrate is high or it has the wrong format).
94
96
"""
97
+ no_convert_queries = config ['convert' ]['no_convert' ].as_str_seq ()
98
+ if no_convert_queries :
99
+ for query_string in no_convert_queries :
100
+ query , _ = parse_query_string (query_string , Item )
101
+ if query .match (item ):
102
+ return False
95
103
if config ['convert' ]['never_convert_lossy_files' ] and \
96
104
not (item .format .lower () in LOSSLESS_FORMATS ):
97
105
return False
@@ -133,6 +141,7 @@ def __init__(self):
133
141
u'quiet' : False ,
134
142
u'embed' : True ,
135
143
u'paths' : {},
144
+ u'no_convert' : u'' ,
136
145
u'never_convert_lossy_files' : False ,
137
146
u'copy_album_art' : False ,
138
147
u'album_art_maxwidth' : 0 ,
Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ New features:
13
13
* :doc: `/plugins/lyrics `: The plugin can now produce reStructuredText files
14
14
for beautiful, readable books of lyrics. Thanks to :user: `anarcat `.
15
15
:bug: `2628 `
16
+ * :doc: `/plugins/convert `: Adds ``no_convert `` option which ignores transcoding
17
+ items matching provided query string. Thanks to :user: `Stunner `.
18
+ :bug: `2732 ` :bug: `2751 `
16
19
* :doc: `/plugins/fetchart `: The plugin has now a quiet switch that will only
17
20
display missing album arts. Thanks to :user: `euri10 `.
18
21
:bug: `2683 `
Original file line number Diff line number Diff line change @@ -73,6 +73,9 @@ file. The available options are:
73
73
this does not guarantee that all converted files will have a lower
74
74
bitrate---that depends on the encoder and its configuration.
75
75
Default: none.
76
+ - **no_convert **: Does not transcode items matching provided query string
77
+ (see :doc: `/reference/query `). (i.e. ``format:AAC, format:WMA `` or
78
+ ``path::\.(m4a|wma)$ ``)
76
79
- **never_convert_lossy_files **: Cross-conversions between lossy codecs---such
77
80
as mp3, ogg vorbis, etc.---makes little sense as they will decrease quality
78
81
even further. If set to ``yes ``, lossy files are always copied.
You can’t perform that action at this time.
0 commit comments