File tree 2 files changed +32
-0
lines changed
2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -212,6 +212,25 @@ def _get_submission_url(self):
212
212
else :
213
213
return None
214
214
215
+ try :
216
+ _LIB .discid_get_toc_string .argtypes = (c_void_p , )
217
+ _LIB .discid_get_toc_string .restype = c_char_p
218
+ except AttributeError :
219
+ pass
220
+ def _get_toc_string (self ):
221
+ """The TOC suitable as value of the `toc parameter`
222
+ when accessing the MusicBrainz Web Service.
223
+ """
224
+ if self ._success :
225
+ try :
226
+ result = _LIB .discid_get_toc_string (self ._handle )
227
+ except AttributeError :
228
+ return None
229
+ else :
230
+ return _decode (result )
231
+ else :
232
+ return None
233
+
215
234
_LIB .discid_get_first_track_num .argtypes = (c_void_p , )
216
235
_LIB .discid_get_first_track_num .restype = c_int
217
236
def _get_first_track_num (self ):
@@ -292,6 +311,18 @@ def submission_url(self):
292
311
url = url .replace ("/bare/cdlookup.html" , "/cdtoc/attach" )
293
312
return url
294
313
314
+ @property
315
+ def toc_string (self ):
316
+ """The TOC suitable as value of the `toc parameter`
317
+ when accessing the MusicBrainz Web Service.
318
+
319
+ This is a :obj:`unicode` or :obj:`str <python:str>` object
320
+ and enables fuzzy searching when the actual Disc ID is not found.
321
+
322
+ .. seealso:: `MusicBrainz Web Service <http://musicbrainz.org/doc/Development/XML_Web_Service/Version_2#discid>`_
323
+ """
324
+ return self ._get_toc_string ()
325
+
295
326
@property
296
327
def first_track_num (self ):
297
328
"""Number of the first track"""
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ Disc object
33
33
.. autoattribute :: id
34
34
.. autoattribute :: freedb_id
35
35
.. autoattribute :: submission_url
36
+ .. autoattribute :: toc_string
36
37
.. autoattribute :: first_track_num
37
38
.. autoattribute :: last_track_num
38
39
.. autoattribute :: sectors
You can’t perform that action at this time.
0 commit comments