Skip to content

Commit 7b21d13

Browse files
committed
fix(backend): error when searching
Fixes #854.
1 parent 8c758bb commit 7b21d13

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/backend/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ryot"
3-
version = "5.5.3"
3+
version = "5.5.4"
44
edition = "2021"
55
repository = "https://github.com/IgnisDa/ryot"
66
license = "GPL-3.0"

apps/backend/src/miscellaneous/resolver.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3382,7 +3382,7 @@ impl MiscellaneousService {
33823382
.filter(metadata::Column::Lot.eq(input.lot))
33833383
.filter(metadata::Column::Source.eq(input.source))
33843384
.filter(metadata::Column::Identifier.is_in(&all_identifiers))
3385-
.into_tuple::<(String, i32, bool)>()
3385+
.into_tuple::<(String, String, bool)>()
33863386
.all(&self.db)
33873387
.await?
33883388
.into_iter()
@@ -3394,7 +3394,7 @@ impl MiscellaneousService {
33943394
.map(|i| {
33953395
let interaction = interactions.get(&i.identifier).cloned();
33963396
MetadataSearchItemResponse {
3397-
has_interacted: interaction.unwrap_or_default().1,
3397+
has_interacted: interaction.clone().unwrap_or_default().1,
33983398
database_id: interaction.map(|i| i.0),
33993399
item: i,
34003400
}

apps/backend/src/models.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ pub mod media {
200200
pub item: MetadataSearchItem,
201201
/// Whether the user has interacted with this media item.
202202
pub has_interacted: bool,
203-
pub database_id: Option<i32>,
203+
pub database_id: Option<String>,
204204
}
205205

206206
#[derive(Clone, Debug, Serialize, Deserialize, SimpleObject, FromQueryResult)]

apps/frontend/app/routes/_dashboard.media.$action.$lot.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ const MediaSearchItem = (props: {
511511
action: "search" | "list";
512512
hasInteracted: boolean;
513513
reviewScale: UserReviewScale;
514-
maybeItemId?: number;
514+
maybeItemId?: string;
515515
}) => {
516516
const navigate = useNavigate();
517517
const loaderData = useLoaderData<typeof loader>();

libs/generated/src/graphql/backend/graphql.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ export type MetadataSearchItem = {
936936
};
937937

938938
export type MetadataSearchItemResponse = {
939-
databaseId?: Maybe<Scalars['Int']['output']>;
939+
databaseId?: Maybe<Scalars['String']['output']>;
940940
/** Whether the user has interacted with this media item. */
941941
hasInteracted: Scalars['Boolean']['output'];
942942
item: MetadataSearchItem;
@@ -2791,7 +2791,7 @@ export type MetadataSearchQueryVariables = Exact<{
27912791
}>;
27922792

27932793

2794-
export type MetadataSearchQuery = { metadataSearch: { details: { total: number, nextPage?: number | null }, items: Array<{ databaseId?: number | null, hasInteracted: boolean, item: { identifier: string, title: string, image?: string | null, publishYear?: number | null } }> } };
2794+
export type MetadataSearchQuery = { metadataSearch: { details: { total: number, nextPage?: number | null }, items: Array<{ databaseId?: string | null, hasInteracted: boolean, item: { identifier: string, title: string, image?: string | null, publishYear?: number | null } }> } };
27952795

27962796
export type PeopleSearchQueryVariables = Exact<{
27972797
input: PeopleSearchInput;

0 commit comments

Comments
 (0)