Skip to content

Commit

Permalink
Correct equality check for committing person (#1227)
Browse files Browse the repository at this point in the history
* chore(services/misc): add correct log

* chore(frontend): change the label of select item

* fix(utils/dependent): handle query for commit person correctly

* chore(utils/dependent): remove useless `println!`
  • Loading branch information
IgnisDa authored Feb 1, 2025
1 parent 20d1d82 commit 5dcec14
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,12 @@ export default function Page() {
required
name="lot"
label="Type"
data={Object.values(ExerciseLot)}
defaultValue={loaderData.details?.lot}
readOnly={loaderData.action === Action.Update}
data={Object.values(ExerciseLot).map((l) => ({
value: l,
label: startCase(l.toLowerCase()),
}))}
/>
<Group wrap="nowrap">
<Select
Expand Down
2 changes: 1 addition & 1 deletion crates/services/miscellaneous/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2867,7 +2867,7 @@ ORDER BY RANDOM() LIMIT 10;

ryot_log!(trace, "Invalidating invalid media import jobs");
self.invalidate_import_jobs().await.trace_ok();
ryot_log!(trace, "Checking for updates for media in Watchlist");
ryot_log!(trace, "Checking for updates for monitored media");
self.update_monitored_metadata_and_queue_notifications()
.await
.trace_ok();
Expand Down
5 changes: 3 additions & 2 deletions crates/utils/dependent/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -782,8 +782,9 @@ pub async fn commit_person(
match Person::find()
.filter(person::Column::Source.eq(input.source))
.filter(person::Column::Identifier.eq(&input.identifier))
.apply_if(input.source_specifics.clone(), |query, v| {
query.filter(person::Column::SourceSpecifics.eq(v))
.filter(match input.source_specifics.clone() {
None => person::Column::SourceSpecifics.is_null(),
Some(specifics) => person::Column::SourceSpecifics.eq(specifics),
})
.one(db)
.await?
Expand Down

0 comments on commit 5dcec14

Please sign in to comment.