a2ee5c
PLUGIN_NAME = 'Classic Disc Numbers'
a2ee5c
PLUGIN_AUTHOR = 'Lukas Lalinsky'
a2ee5c
PLUGIN_DESCRIPTION = '''Moves disc numbers and subtitles from the separate tags to album titles.'''
a2ee5c
PLUGIN_VERSION = "0.1"
a2ee5c
PLUGIN_API_VERSIONS = ["0.15"]
a2ee5c
a2ee5c
from picard.metadata import register_track_metadata_processor
a2ee5c
import re
a2ee5c
a2ee5c
def add_discnumbers(tagger, metadata, release, track):
a2ee5c
    if int(metadata["totaldiscs"] or "0") > 1:
a2ee5c
        if "discsubtitle" in metadata:
a2ee5c
            metadata["album"] = "%s (disc %s: %s)" % (
a2ee5c
                metadata["album"], metadata["discnumber"],
a2ee5c
                metadata["discsubtitle"])
a2ee5c
        else:
a2ee5c
            metadata["album"] = "%s (disc %s)" % (
a2ee5c
                metadata["album"], metadata["discnumber"])
a2ee5c
a2ee5c
register_track_metadata_processor(add_discnumbers)
a2ee5c