Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def delete_channels(self, display_names: Iterable[str]):
channels = self.session.query(Channel).filter(Channel.displayname.in_(display_names))
for channel in channels:
self.session.delete(channel)
self.session.commit()
.join(Channel, Channel.yt_channelid == Video.publisher) \
.filter(Video.id.in_(self.video_id_filter)) \
.order_by(*self.config.order_by).all()
if not self.date_end_filter[1]:
date_end_filter = time.mktime(time.gmtime()) + 20
else:
date_end_filter = self.date_end_filter[0]
query = self.database.session.query(Video) \
.join(Channel, Channel.yt_channelid == Video.publisher) \
.filter(Video.publish_date > self.date_begin_filter) \
.filter(Video.publish_date < date_end_filter)
if self.channel_filter:
query = query.filter(Channel.displayname.in_(self.channel_filter))
if not self.include_watched_filter:
query = query.filter(~Video.watched)
query = query.order_by(*self.config.order_by)
return query.all()