fix: update SQL queries to filter reviews with null remote_actor_url
This commit is contained in:
@@ -171,7 +171,7 @@ impl PostgresDiaryRepository {
|
|||||||
r.remote_actor_url
|
r.remote_actor_url
|
||||||
FROM reviews r
|
FROM reviews r
|
||||||
INNER JOIN movies m ON m.id = r.movie_id
|
INNER JOIN movies m ON m.id = r.movie_id
|
||||||
WHERE r.user_id = $1{}
|
WHERE r.user_id = $1 AND r.remote_actor_url IS NULL{}
|
||||||
ORDER BY {}
|
ORDER BY {}
|
||||||
LIMIT {} OFFSET {}",
|
LIMIT {} OFFSET {}",
|
||||||
search_clause, order_clause, limit_param, offset_param
|
search_clause, order_clause, limit_param, offset_param
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ impl SqliteDiaryRepository {
|
|||||||
r.id AS review_id, r.movie_id, r.user_id, r.rating, r.comment, r.watched_at, r.created_at, r.remote_actor_url
|
r.id AS review_id, r.movie_id, r.user_id, r.rating, r.comment, r.watched_at, r.created_at, r.remote_actor_url
|
||||||
FROM reviews r
|
FROM reviews r
|
||||||
INNER JOIN movies m ON m.id = r.movie_id
|
INNER JOIN movies m ON m.id = r.movie_id
|
||||||
WHERE r.user_id = ?{}
|
WHERE r.user_id = ? AND r.remote_actor_url IS NULL{}
|
||||||
ORDER BY {}
|
ORDER BY {}
|
||||||
LIMIT ? OFFSET ?",
|
LIMIT ? OFFSET ?",
|
||||||
search_clause, order_clause
|
search_clause, order_clause
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ export const API_URL = import.meta.env.VITE_API_URL ?? ""
|
|||||||
|
|
||||||
export function posterUrl(path: string | undefined | null): string | undefined {
|
export function posterUrl(path: string | undefined | null): string | undefined {
|
||||||
if (!path) return undefined
|
if (!path) return undefined
|
||||||
|
if (path.startsWith("http://") || path.startsWith("https://")) return path
|
||||||
const clean = path.startsWith("/") ? path.slice(1) : path
|
const clean = path.startsWith("/") ? path.slice(1) : path
|
||||||
return `${API_URL}/images/${clean}`
|
return `${API_URL}/images/${clean}`
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user