Skip to content

Commit

Permalink
fix(backend): include provider watched in the cache
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnisDa committed Dec 26, 2024
1 parent 8442c5c commit 4ab9149
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/models/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ pub struct UserAnalyticsInput {
pub group_by: Option<DailyUserActivitiesResponseGroupedBy>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, PartialEq, InputObject, FromJsonQueryResult, Eq, Serialize, Deserialize)]
pub struct MetadataGroupSearchInput {
pub lot: MediaLot,
Expand Down Expand Up @@ -274,39 +275,45 @@ pub struct PersonSourceSpecifics {
pub is_anilist_studio: Option<bool>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, PartialEq, InputObject, FromJsonQueryResult, Eq, Serialize, Deserialize)]
pub struct PeopleSearchInput {
pub search: SearchInput,
pub source: MediaSource,
pub source_specifics: Option<PersonSourceSpecifics>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, PartialEq, InputObject, FromJsonQueryResult, Eq, Serialize, Deserialize)]
pub struct MetadataSearchInput {
pub lot: MediaLot,
pub search: SearchInput,
pub source: MediaSource,
}

#[skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct UserLevelCacheKey<T> {
pub input: T,
pub user_id: String,
}

#[skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct MetadataRecentlyConsumedCacheInput {
pub entity_id: String,
pub entity_lot: EntityLot,
}

#[skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct ProgressUpdateCacheInput {
pub metadata_id: String,
pub show_season_number: Option<i32>,
pub manga_volume_number: Option<i32>,
pub show_episode_number: Option<i32>,
pub anime_episode_number: Option<i32>,
pub provider_watched_on: Option<String>,
pub podcast_episode_number: Option<i32>,
pub manga_chapter_number: Option<Decimal>,
}
Expand Down
1 change: 1 addition & 0 deletions crates/services/miscellaneous/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1636,6 +1636,7 @@ ORDER BY RANDOM() LIMIT 10;
manga_chapter_number: mcn,
podcast_episode_number: pen,
metadata_id: si.metadata_id.clone(),
provider_watched_on: si.provider_watched_on.clone(),
},
});
self.0.cache_service.expire_key(cache).await?;
Expand Down
1 change: 1 addition & 0 deletions crates/utils/dependent/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1249,6 +1249,7 @@ pub async fn progress_update(
manga_chapter_number: input.manga_chapter_number,
anime_episode_number: input.anime_episode_number,
podcast_episode_number: input.podcast_episode_number,
provider_watched_on: input.provider_watched_on.clone(),
},
});
acquire_lock!(&ss.db, &cache_and_lock_key);
Expand Down

0 comments on commit 4ab9149

Please sign in to comment.