diff --git a/src/models/ctx/update_notifications.rs b/src/models/ctx/update_notifications.rs index 64855e676..d488c5643 100644 --- a/src/models/ctx/update_notifications.rs +++ b/src/models/ctx/update_notifications.rs @@ -63,7 +63,7 @@ pub fn update_notifications( }, ); - notifications.created = E::now(); + notifications.last_updated = Some(E::now()); let notification_items_effects = update_notification_items::( &mut notifications.items, notification_catalogs, diff --git a/src/types/addon/response.rs b/src/types/addon/response.rs index c80699286..f764d6736 100644 --- a/src/types/addon/response.rs +++ b/src/types/addon/response.rs @@ -7,7 +7,6 @@ use crate::types::{ resource::{MetaItem, MetaItemPreview, Stream, Subtitles}, }; - /// Resource Response from an addon. /// /// Deserializing the struct from json will skip any invalid Vec items diff --git a/src/types/notifications/notifications_bucket.rs b/src/types/notifications/notifications_bucket.rs index e55f24549..2049109b3 100644 --- a/src/types/notifications/notifications_bucket.rs +++ b/src/types/notifications/notifications_bucket.rs @@ -15,9 +15,15 @@ use crate::{ #[derive(Default, Derivative, Clone, PartialEq, Eq, Serialize, Deserialize, Debug)] pub struct NotificationsBucket { + #[serde(default)] pub uid: UID, - /// Notifications + /// Notifications per meta item and video id + #[serde(default)] pub items: HashMap>, + /// The last time notifications were pulled. + #[serde(default)] + pub last_updated: Option>, + /// The moment that the notification bucket was initialized. #[derivative(Default(value = "Utc::now()"))] pub created: DateTime, } @@ -39,6 +45,7 @@ impl NotificationsBucket { acc }), + last_updated: None, created: E::now(), } }