def initialize(self, core, config):
self.core = core
self.config = config
# Store path of currently playing album
track = self.core.playback.get_current_track().get()
if track:
track_path = urllib.url2pathname(urlparse.urlparse(track.uri.split('file://')[1]).path)
self.album_path = os.path.dirname(track_path)
else:
return self.redirect('/auto')
# Read all section config to an array. Ready for dynamic amount of sections
self.sections = []
section = 0
exists = "s{}_folder".format(section) in self.config['auto']
while exists:
self.sections.append({
"start": self.config['auto']["s{}_start".format(section)],
"folder": self.config['auto']["s{}_folder".format(section)],
"max_volume": self.config['auto']["s{}_max_volume".format(section)]
})
section += 1
exists = "s{}_folder".format(section) in self.config['auto']
评论列表
文章目录