From ae6c8d9ee701f6d87153c7d8796d35cf8823f986 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 17 Dec 2021 08:07:57 +0200 Subject: [PATCH] fdsfsd --- files/classes/submission.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/files/classes/submission.py b/files/classes/submission.py index 9d7e35bd4..b89727152 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -220,6 +220,12 @@ class Submission(Base): elif "youtu.be" in self.domain or "youtube.com" == self.domain: return f"https://{site}/assets/images/default_thumb_yt.webp" else: return f"https://{site}/assets/images/default_thumb_link.webp" + @property + @lazy + def full_thumb(self): + if self.thumb_url.startswith('/'): return 'https://rdrama.net' + self.thumb_url + return self.thumb_url + @property @lazy def json_raw(self): @@ -235,7 +241,7 @@ class Submission(Base): 'title': self.title, 'is_nsfw': self.over_18, 'is_bot': self.is_bot, - 'thumb_url': self.thumb_url, + 'thumb_url': self.full_thumb, 'domain': self.domain, 'url': self.url, 'body': self.body,