Skip to content

Commit 55d7fa3

Browse files
authored
Allow partial person details (#651)
* fix(frontend): add correct check for default value * refactor(backend): change order of functions * refactor(backend): remove indirection of person details * feat(frontend): re-order only if old order is not new order * feat(frontend): close re-order drawer only if there is a change * feat(backend): get name in partial person model * feat(backend): get person name from anilist * feat(backend): get person name from audible * feat(backend): get person name from igdb * feat(backend): get person name from manga updates * feat(backend): get person name from vndb * feat(database): add `is_partial` field to person table * fix(backend): do not hard unwrap person name * fix(backend): create seen items correctly * fix(frontend): show input on correct place * ci: remove healthcheck from dockerfile * fix(database): set all people as not partial * feat(backend): do not update person every time * feat(backend): make getting details for person * feat(backend): update person if it is partial * refactor(backend): change name of trait members * feat(backend): return `is_partial` for media and person items * feat(frontend): display text if media is partially downloaded * feat(frontend): redirect to correct page after marking as watched * fix(frontend): show `Show Details` btn on podcasts too * feat(backend): mutation to update person details * feat(frontend): add action to update person * fix(backend): update `is_partial` value when updating people * fix(backend): extend possible jobs for people * fix(backend): associate media with people * build(backend): bump version * feat(database): add `created_on` field to `user_to_entity` Also update it with the correct values for exercises. * feat(database): update media items correctly * fix(database): take user_id into account when updating column * fix(database): set created_on to the least of seen or added to collection * fix(database): also take the last updated on into account * feat(backend): return `created_on` for user exercise details * feat(frontend): display when the exercise was first done on * chore(database): change name of migration * fix(database): change migration for updating created_on * feat(database): change varchar columns to text * fix(database): change all rust enum columns to text * style(database): add indentation * ci: update rust toolchain
1 parent 8713dc5 commit 55d7fa3

File tree

60 files changed

+770
-614
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+770
-614
lines changed

Cargo.lock

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

Dockerfile

-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ COPY --from=frontend-builder --chown=ryot:ryot /app/apps/frontend/node_modules .
5656
COPY --from=frontend-builder --chown=ryot:ryot /app/apps/frontend/package.json ./package.json
5757
COPY --from=frontend-builder --chown=ryot:ryot /app/apps/frontend/build ./build
5858
COPY --from=backend-builder --chown=ryot:ryot /app/ryot /usr/local/bin/ryot
59-
HEALTHCHECK --interval=5m --timeout=3s \
60-
CMD curl -f http://localhost:5000/config || exit 1
6159
CMD [ \
6260
"concurrently", "--names", "frontend,backend,proxy", "--kill-others", \
6361
"PORT=3000 npx remix-serve ./build/server/index.js", \

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 = "4.2.7"
3+
version = "4.2.8"
44
edition = "2021"
55
repository = "https://github.com/IgnisDa/ryot"
66
license = "GPL-3.0"

apps/backend/src/background.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ use serde::{Deserialize, Serialize};
88
use strum::Display;
99

1010
use crate::{
11-
entities::metadata,
11+
entities::{metadata, person},
1212
exporter::ExporterService,
1313
fitness::resolver::ExerciseService,
1414
importer::{DeployImportJobInput, ImporterService},
1515
miscellaneous::resolver::MiscellaneousService,
1616
models::{
1717
fitness::Exercise,
18-
media::{PartialMetadataPerson, ProgressUpdateInput, ReviewPostedEvent},
18+
media::{ProgressUpdateInput, ReviewPostedEvent},
1919
ExportItem,
2020
},
2121
};
@@ -145,8 +145,8 @@ pub enum ApplicationJob {
145145
ReEvaluateUserWorkouts(i32),
146146
UpdateMetadata(metadata::Model),
147147
UpdateExerciseJob(Exercise),
148+
UpdatePerson(person::Model),
148149
RecalculateCalendarEvents,
149-
AssociatePersonWithMetadata(i32, PartialMetadataPerson, usize),
150150
AssociateGroupWithMetadata(MetadataLot, MetadataSource, String),
151151
ReviewPosted(ReviewPostedEvent),
152152
PerformExport(i32, Vec<ExportItem>),
@@ -205,16 +205,13 @@ pub async fn perform_application_job(
205205
}
206206
true
207207
}
208+
ApplicationJob::UpdatePerson(person) => misc_service.update_person(person.id).await.is_ok(),
208209
ApplicationJob::UpdateExerciseJob(exercise) => {
209210
exercise_service.update_exercise(exercise).await.is_ok()
210211
}
211212
ApplicationJob::RecalculateCalendarEvents => {
212213
misc_service.recalculate_calendar_events().await.is_ok()
213214
}
214-
ApplicationJob::AssociatePersonWithMetadata(metadata_id, person, index) => misc_service
215-
.associate_person_with_metadata(metadata_id, person, index)
216-
.await
217-
.is_ok(),
218215
ApplicationJob::AssociateGroupWithMetadata(lot, source, group_identifier) => misc_service
219216
.associate_group_with_metadata(lot, source, group_identifier)
220217
.await

apps/backend/src/entities/person.rs

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ pub struct Model {
1919
pub created_on: DateTimeUtc,
2020
pub last_updated_on: DateTimeUtc,
2121
pub name: String,
22+
pub is_partial: Option<bool>,
2223
#[sea_orm(column_type = "Json")]
2324
#[graphql(skip)]
2425
pub images: Option<Vec<MetadataImage>>,

apps/backend/src/entities/user_to_entity.rs

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use crate::models::{
1515
pub struct Model {
1616
#[sea_orm(primary_key)]
1717
pub id: i32,
18+
pub created_on: DateTimeUtc,
1819
pub last_updated_on: DateTimeUtc,
1920
pub user_id: i32,
2021
pub metadata_id: Option<i32>,

0 commit comments

Comments
 (0)