Added more settings in Tidal

This commit is contained in:
Manuel Cortez 2019-07-08 16:43:31 -05:00
parent 69452b69bd
commit 207a7110ef
2 changed files with 29 additions and 16 deletions

View File

@ -9,6 +9,9 @@ enabled = boolean(default=True)
username = string(default="")
password = string(default="")
quality=string(default="high")
include_albums = boolean(default=True)
include_compilations = boolean(default=True)
include_singles = boolean(default=True)
[[youtube]]
enabled = boolean(default=True)

View File

@ -64,21 +64,24 @@ class interface(base.baseInterface):
elif field == "artist":
data = []
artist = search_response.artists[0].id
albums = self.session.get_artist_albums(artist)
for album in albums:
tracks = self.session.get_album_tracks(album.id)
for track in tracks:
data.append(track)
compilations = self.session.get_artist_albums_other(artist)
for album in compilations:
tracks = self.session.get_album_tracks(album.id)
for track in tracks:
data.append(track)
singles = self.session.get_artist_albums_ep_singles(artist)
for album in singles:
tracks = self.session.get_album_tracks(album.id)
for track in tracks:
data.append(track)
if config.app["services"]["tidal"]["include_albums"]:
albums = self.session.get_artist_albums(artist)
for album in albums:
tracks = self.session.get_album_tracks(album.id)
for track in tracks:
data.append(track)
if config.app["services"]["tidal"]["include_compilations"]:
compilations = self.session.get_artist_albums_other(artist)
for album in compilations:
tracks = self.session.get_album_tracks(album.id)
for track in tracks:
data.append(track)
if config.app["services"]["tidal"]["include_singles"]:
singles = self.session.get_artist_albums_ep_singles(artist)
for album in singles:
tracks = self.session.get_album_tracks(album.id)
for track in tracks:
data.append(track)
for search_result in data:
s = base.song(self)
s.title = search_result.name
@ -133,7 +136,6 @@ class settings(base.baseSettings):
usernamebox.Add(self.username, 0, wx.ALL, 5)
sizer.Add(usernamebox, 0, wx.ALL, 5)
self.map.append(("username", self.username))
password = wx.StaticText(self, wx.NewId(), _("Password"))
self.password = wx.TextCtrl(self, wx.NewId(), style=wx.TE_PASSWORD)
passwordbox = wx.BoxSizer(wx.HORIZONTAL)
@ -154,6 +156,14 @@ class settings(base.baseSettings):
self.quality.GetValue = self.get_quality_value
self.quality.SetValue = self.set_quality_value
self.map.append(("quality", self.quality))
include = wx.StaticBoxSizer(parent=self, orient=wx.HORIZONTAL, label=_("Search by artist"))
self.include_albums = wx.CheckBox(include.GetStaticBox(), wx.NewId(), _("Include albums"))
self.include_compilations = wx.CheckBox(include.GetStaticBox(), wx.NewId(), _("Include compilations"))
self.include_singles = wx.CheckBox(include.GetStaticBox(), wx.NewId(), _("Include singles"))
sizer.Add(include, 0, wx.ALL, 5)
self.map.append(("include_albums", self.include_albums))
self.map.append(("include_compilations", self.include_compilations))
self.map.append(("include_singles", self.include_singles))
self.SetSizer(sizer)
def on_enabled(self, *args, **kwargs):