1# -*- coding: utf-8 -*-
2
3# Copyright © 2015 Samir Benmendil <me@rmz.io>
4# This work is free. You can redistribute it and/or modify it under the
5# terms of the Do What The Fuck You Want To Public License, Version 2,
6# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
7
8PLUGIN_NAME = 'Soundtrack'
9PLUGIN_AUTHOR = 'Samir Benmendil'
10PLUGIN_LICENSE = 'WTFPL'
11PLUGIN_LICENSE_URL = 'http://www.wtfpl.net/'
12PLUGIN_DESCRIPTION = '''Sets the albumartist to "Soundtrack" if releasetype is a soundtrack.'''
13PLUGIN_VERSION = "0.2"
14PLUGIN_API_VERSIONS = ["1.0", "2.0"]
15
16from picard.metadata import register_album_metadata_processor
17
18
19def soundtrack(tagger, metadata, release):
20    if "soundtrack" in metadata["releasetype"]:
21        metadata["albumartist"] = "Soundtrack"
22        metadata["albumartistsort"] = "Soundtrack"
23
24register_album_metadata_processor(soundtrack)
25