all repos — FixYouTube-legacy @ 19a3c98a130934ac200dd7d8e61e2dc80ff0d411

A better way to embed YouTube videos everywhere (inspired by FixTweet).

quick fix
Marco Andronaco andronacomarco@gmail.com
Thu, 24 Aug 2023 11:35:30 +0200
commit

19a3c98a130934ac200dd7d8e61e2dc80ff0d411

parent

854682880d8f501080fd50e69195e8101132c4c6

1 files changed, 4 insertions(+), 0 deletions(-)

jump to
M fxyoutube/db.pyfxyoutube/db.py

@@ -22,6 +22,10 @@ url = TextField()

timestamp = DateTimeField(default=datetime.now) def cache_video(info): + try: + Video.delete().where(Video.id == info["id"]).execute() + except DoesNotExist: + pass return Video.create(**info) def get_video_from_cache(video):