def _method_playlist_PUT(self, args, request): srcid = int(args[0]) a = [] # Build a query model for id in args[1].split(','): id = id.strip() if not id: continue if len(a) > 0: a.append(RB.RhythmDBQueryType.DISJUNCTIVE_MARKER) a.extend([RB.RhythmDBQueryType.EQUALS, RB.RhythmDBPropType.ENTRY_ID, int(id)]) db = self.shell.props.db model = telemotec.query_model_new(db, *a) utils.run_in_main(telemotec.query_model_do, db, model) source = self.sources.source(srcid) source.props.query_model = model self.player.props.source = source
def build_model(self): db = self.base.model.props.db args = [] isall = False for i in xrange(len(self.artists)): artist = self.artists[i] if artist[1]: args = [] isall = True break if i != 0: args.append(RB.RhythmDBQueryType.DISJUNCTIVE_MARKER) args.extend([RB.RhythmDBQueryType.EQUALS, RB.RhythmDBPropType.ARTIST, artist[0]]) self.model = telemotec.query_model_new(db, *args) telemotec.query_model_set_sorted(self.model) if isall: self.model.copy_contents(self.base.model) else: self.model.chain(self.base.model, False) utils.run_in_main(telemotec.query_model_do, db, self.model)
def _method_playlist_PUT(self, args, request): srcid = int(args[0]) a = [] # Build a query model for id in args[1].split(','): id = id.strip() if not id: continue if len(a) > 0: a.append(RB.RhythmDBQueryType.DISJUNCTIVE_MARKER) a.extend([ RB.RhythmDBQueryType.EQUALS, RB.RhythmDBPropType.ENTRY_ID, int(id) ]) db = self.shell.props.db model = telemotec.query_model_new(db, *a) utils.run_in_main(telemotec.query_model_do, db, model) source = self.sources.source(srcid) source.props.query_model = model self.player.props.source = source
def build_model(self): db = self.base.model.props.db args = [] for i in xrange(len(self.albums)): album = self.albums[i] if i != 0: args.append(RB.RhythmDBQueryType.DISJUNCTIVE_MARKER) args.extend([RB.RhythmDBQueryType.EQUALS, RB.RhythmDBPropType.ALBUM, album[0]]) self.model = telemotec.query_model_new(db, *args) self.model.chain(self.base.model, False) utils.run_in_main(telemotec.query_model_do, db, self.model)
def build_model(self): db = self.base.model.props.db args = [] for i in xrange(len(self.albums)): album = self.albums[i] if i != 0: args.append(RB.RhythmDBQueryType.DISJUNCTIVE_MARKER) args.extend([ RB.RhythmDBQueryType.EQUALS, RB.RhythmDBPropType.ALBUM, album[0] ]) self.model = telemotec.query_model_new(db, *args) self.model.chain(self.base.model, False) utils.run_in_main(telemotec.query_model_do, db, self.model)