Skip to content

Commit

Permalink
Add loadext plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jackwilsdon committed Apr 20, 2019
1 parent 7b910c3 commit 3553c20
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions beetsplug/loadext.py
@@ -0,0 +1,17 @@
from __future__ import division, absolute_import, print_function

from beets.plugins import BeetsPlugin


class LoadExtPlugin(BeetsPlugin):
def __init__(self):
super(LoadExtPlugin, self).__init__()

self.register_listener('library_opened', self.library_opened)

def library_opened(self, lib):
# TODO: Find a way of getting a connection without calling a private method.
conn = lib._connection()

for ext in self.config.get(list):
print(lib.load_extension(ext))

0 comments on commit 3553c20

Please sign in to comment.