Added get_metadata into base songs
This commit is contained in:
parent
dae1df79ad
commit
6aeffd57bb
@ -31,6 +31,14 @@ class baseInterface(object):
|
|||||||
def transcoder_enabled(self):
|
def transcoder_enabled(self):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def get_metadata(self, item):
|
||||||
|
data = dict()
|
||||||
|
keys = ["title", "album", "artist", "tracknumber"]
|
||||||
|
for k in keys:
|
||||||
|
if hasattr(item, k):
|
||||||
|
data[k] = getattr(item, k)
|
||||||
|
return data
|
||||||
|
|
||||||
class song(object):
|
class song(object):
|
||||||
""" Represents a song in all services. Data will be filled by the service itself"""
|
""" Represents a song in all services. Data will be filled by the service itself"""
|
||||||
|
|
||||||
@ -51,6 +59,9 @@ class song(object):
|
|||||||
def get_download_url(self):
|
def get_download_url(self):
|
||||||
self.download_url = self.extractor.get_download_url(self.url)
|
self.download_url = self.extractor.get_download_url(self.url)
|
||||||
|
|
||||||
|
def get_metadata(self):
|
||||||
|
return self.extractor.get_metadata(self)
|
||||||
|
|
||||||
class baseSettings(wx.Panel):
|
class baseSettings(wx.Panel):
|
||||||
config_section = "base"
|
config_section = "base"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user