1 #The zukebox server search service implementation
3 from brisa.core.reactors import install_default_reactor
4 reactor = install_default_reactor()
6 from os.path import join, dirname, abspath
8 from brisa.upnp.device import Device, Service, ServiceController
10 class Search(Service):
12 Implements a search service of zukebox-server
15 service_type = "urn:schemas-upnp-org:service:Search:1"
16 service_name = "Search"
18 def __init__(self, xml_path):
19 scpd_path = pjoin(xml_path, "zukebox-search-scpd.xml");
20 Service.__init__(self, service_name, service_type, '', scpd_path,
21 SearchController(service_type))
23 def get_list_audio(self):
24 return self.control_controller.get_list_audio()
26 class SearchController(ServiceController):
28 Implements a search service of zukebox-server
30 def __init__(self, service_type):
31 ServiceController.__init__(self, service_type)
33 self.name_music_list = []
34 self.name_artist_list = []
36 def soap_SearchGenreList(self, *args, **kargs):
37 rt = {"Genre_list": self.genre_list}
38 return {"SearchGenreList": rt}
40 def soap_SearchMusicList(self, *args, **kargs):
41 rt = {"Music_list": self.name_music_list}
42 return {"SearchMusicList": rt}
44 def soap_SearchArtistList(self, *args, **kargs):
45 rt = {"Artist_list": self.name_artist_list}
46 return {"SearchArtistList": rt}