mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 02:22:21 +00:00
breaking(sqlite): Add metadata into calendar store for more efficient queries in the future
This commit is contained in:
@@ -8,9 +8,9 @@ use std::{collections::HashMap, io::BufReader};
|
||||
#[derive(Debug, Clone)]
|
||||
// specified in https://datatracker.ietf.org/doc/html/rfc5545#section-3.6
|
||||
pub enum CalendarObjectType {
|
||||
Event,
|
||||
Journal,
|
||||
Todo,
|
||||
Event = 0,
|
||||
Todo = 1,
|
||||
Journal = 2,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
@@ -114,6 +114,14 @@ impl CalendarObject {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_object_type(&self) -> CalendarObjectType {
|
||||
match self.data {
|
||||
CalendarObjectComponent::Todo(_) => CalendarObjectType::Todo,
|
||||
CalendarObjectComponent::Event(_) => CalendarObjectType::Event,
|
||||
CalendarObjectComponent::Journal(_) => CalendarObjectType::Journal,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_first_occurence(&self) -> Result<Option<CalDateTime>, Error> {
|
||||
match &self.data {
|
||||
CalendarObjectComponent::Event(event) => event.get_first_occurence(),
|
||||
|
||||
Reference in New Issue
Block a user