Skip to content

Commit

Permalink
Merge branch 'notifications-bucket-part-2' into continue-watching-part-2
Browse files Browse the repository at this point in the history
  • Loading branch information
elpiel committed Jul 27, 2023
2 parents 426b861 + df2fc57 commit 9f99b82
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/models/ctx/update_notifications.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub fn update_notifications<E: Env + 'static>(
},
);

notifications.created = E::now();
notifications.last_updated = Some(E::now());
let notification_items_effects = update_notification_items::<E>(
&mut notifications.items,
notification_catalogs,
Expand Down
1 change: 0 additions & 1 deletion src/types/addon/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion src/types/notifications/notifications_bucket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<MetaItemId, HashMap<VideoId, NotificationItem>>,
/// The last time notifications were pulled.
#[serde(default)]
pub last_updated: Option<DateTime<Utc>>,
/// The moment that the notification bucket was initialized.
#[derivative(Default(value = "Utc::now()"))]
pub created: DateTime<Utc>,
}
Expand All @@ -39,6 +45,7 @@ impl NotificationsBucket {

acc
}),
last_updated: None,
created: E::now(),
}
}
Expand Down

0 comments on commit 9f99b82

Please sign in to comment.