mirror of
https://github.com/beetbox/beets.git
synced 2025-12-31 21:12:43 +01:00
Adding auto add support
This commit is contained in:
parent
f64df80974
commit
0fa02519a7
1 changed files with 11 additions and 0 deletions
|
|
@ -26,6 +26,12 @@ class IPFSPlugin(BeetsPlugin):
|
|||
|
||||
def __init__(self):
|
||||
super(IPFSPlugin, self).__init__()
|
||||
self.config.add({
|
||||
'auto': True,
|
||||
})
|
||||
|
||||
if self.config['auto']:
|
||||
self.import_stages = [self.auto_add]
|
||||
|
||||
def commands(self):
|
||||
cmd = ui.Subcommand('ipfs',
|
||||
|
|
@ -73,6 +79,11 @@ class IPFSPlugin(BeetsPlugin):
|
|||
cmd.func = func
|
||||
return [cmd]
|
||||
|
||||
def auto_add(self, session, task):
|
||||
if task.is_album:
|
||||
self.ipfs_add(task.album)
|
||||
task.album.store()
|
||||
|
||||
def ipfs_play(self, lib, opts, args):
|
||||
from beetsplug.play import PlayPlugin
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue