Created
March 7, 2017 18:19
-
-
Save tigranl/79652e7dfac1d6216c1c0a2d0bbf696f to your computer and use it in GitHub Desktop.
NFO
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from beets import autotag | |
from beets.plugins import BeetsPlugin | |
from beets import ui | |
from beets.ui.commands import PromptChoice | |
from beets import config | |
class Nfo(BeetsPlugin): | |
def __init__(self): | |
super(Nfo, self).__init__() | |
self.register_listener('import', self.nfo) | |
def nfo(self, lib, paths): | |
link = 'https://musicbrainz.org/release/{0}' | |
with open(lib.Item.title, 'w') as f: | |
if lib.Item: | |
f.write(link.format(lib.Item.mb_trackid)) | |
else: | |
f.write(link.format(lib.Album.mb_albumid)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment