This commit is contained in:
katboi01 2025-08-12 18:58:03 +02:00
parent f2909d2992
commit 5c8283ab5b
1 changed files with 2 additions and 2 deletions

View File

@ -54,7 +54,7 @@ class Database:
return self.db.run_query(query) return self.db.run_query(query)
def get_post(self, id): def get_post(self, id):
query = f'''SELECT cast(x_posts.id as TEXT), x_posts.*, x_accounts.x_handle, x_accounts.rating from x_posts query = f'''SELECT cast(x_posts.id as TEXT), x_posts.*, x_accounts.x_handle, cast(account_id as TEXT) as account_id, x_accounts.rating, saved_files from x_posts
LEFT JOIN x_accounts LEFT JOIN x_accounts
ON x_posts.account_id = x_accounts.id WHERE x_posts.id = {id} ON x_posts.account_id = x_accounts.id WHERE x_posts.id = {id}
LIMIT 1''' LIMIT 1'''
@ -95,7 +95,7 @@ class Database:
where_query = self.build_where_query(artist, actions_taken, last_id, include_ratings, tags) where_query = self.build_where_query(artist, actions_taken, last_id, include_ratings, tags)
query = f''' query = f'''
SELECT x_posts.id, cast(x_posts.id as TEXT) as id_str, action_taken, saved_files != \'{{}}\' as is_saved, text, files, date, x_handle, x_accounts.rating FROM x_posts SELECT x_posts.id, cast(x_posts.id as TEXT) as id_str, action_taken, saved_files, text, files, date, x_handle, cast(account_id as TEXT) as account_id, x_accounts.rating FROM x_posts
LEFT JOIN x_accounts LEFT JOIN x_accounts
ON x_posts.account_id = x_accounts.id ON x_posts.account_id = x_accounts.id
{where_query} {where_query}