Esempio n. 1
0
 def status(self):
     status = {}
     handler = self.rb
     status['playing'] = handler.get_playing_status()
     if status['playing']:
         playing_entry = handler.get_playing_entry()
         if playing_entry:
             status['playing_entry'] = get_song(playing_entry)
             status['playing_time'] = handler.get_playing_time()
     status['playing_order'] = handler.get_play_order()
     status['muted'] = handler.get_mute()
     status['volume'] = handler.get_volume()
     return status
Esempio n. 2
0
 def find_by_id(self, song_id):
     entry = self.rb.get_entry(song_id)
     if not entry:
         return None
     log.debug('Found song %d', song_id)
     return get_song(entry)
Esempio n. 3
0
 def get_queue(self):
     entries = self.queue.get_play_queue()
     queue = defaultdict(lambda:[])
     for entry in entries:
         queue['entries'].append(get_song(entry))
     return queue
Esempio n. 4
0
 def query(self, query_filter):
     entries = defaultdict(lambda: [])
     for entry in self.rb.query(query_filter):
         entries['entries'].append(get_song(entry))
     return entries