Services may be disabled from config
This commit is contained in:
parent
b105dd649d
commit
52265c4f3e
@ -4,10 +4,14 @@ language = string(default="system")
|
|||||||
|
|
||||||
[services]
|
[services]
|
||||||
[[tidal]]
|
[[tidal]]
|
||||||
|
enabled = boolean(default=True)
|
||||||
username = string(default="")
|
username = string(default="")
|
||||||
password = string(default="")
|
password = string(default="")
|
||||||
quality=string(default="lossless")
|
quality=string(default="lossless")
|
||||||
|
|
||||||
|
|
||||||
[[youtube]]
|
[[youtube]]
|
||||||
transcode = boolean(default=True)
|
enabled = boolean(default=True)
|
||||||
|
transcode = boolean(default=True)
|
||||||
|
|
||||||
|
[[zaycev.net]]
|
||||||
|
enabled = boolean(default=True)
|
@ -120,6 +120,7 @@ class settings(base.baseSettings):
|
|||||||
self.map.append(("transcode", self.transcode))
|
self.map.append(("transcode", self.transcode))
|
||||||
sizer.Add(self.transcode, 0, wx.ALL, 5)
|
sizer.Add(self.transcode, 0, wx.ALL, 5)
|
||||||
self.SetSizer(sizer)
|
self.SetSizer(sizer)
|
||||||
|
self.on_enabled()
|
||||||
|
|
||||||
def on_enabled(self, *args, **kwargs):
|
def on_enabled(self, *args, **kwargs):
|
||||||
for i in self.map:
|
for i in self.map:
|
||||||
|
@ -12,6 +12,7 @@ log = logging.getLogger("extractors.zaycev.net")
|
|||||||
|
|
||||||
class interface(object):
|
class interface(object):
|
||||||
name = "zaycev.net"
|
name = "zaycev.net"
|
||||||
|
enabled = True
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.results = []
|
self.results = []
|
||||||
|
@ -74,5 +74,5 @@ def get_extractors():
|
|||||||
""" Function for importing everything wich is located in the extractors package and has a class named interface."""
|
""" Function for importing everything wich is located in the extractors package and has a class named interface."""
|
||||||
import extractors
|
import extractors
|
||||||
module_type = types.ModuleType
|
module_type = types.ModuleType
|
||||||
classes = [m for m in extractors.__dict__.values() if type(m) == module_type and hasattr(m, 'interface')]
|
classes = [m for m in extractors.__dict__.values() if type(m) == module_type and hasattr(m, 'interface') and m.interface.enabled != False]
|
||||||
return classes#sorted(classes, key=lambda c: c.name)
|
return classes#sorted(classes, key=lambda c: c.name)
|
Loading…
x
Reference in New Issue
Block a user