Skip to content

Commit

Permalink
remove unused journal module
Browse files Browse the repository at this point in the history
  • Loading branch information
keinsell committed Feb 2, 2025
1 parent fc02c01 commit 0d9b3e8
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 218 deletions.
159 changes: 0 additions & 159 deletions TASK.md

This file was deleted.

10 changes: 1 addition & 9 deletions src/analyzer/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,4 @@ pub struct IngestionPhase
pub(crate) duration_range: Range<IngestionDate>,
pub(crate) prev: Option<Box<IngestionPhase>>,
pub(crate) next: Option<Box<IngestionPhase>>,
}

/// !TODO
/// `JournalAnalysis` is a struct that represents the analytics of a complete
/// user's ingestion history it contains a various aspects of information, such
/// as classification by psychoactive groups, peeking into recommended dosages
/// and history of usage, pattern recognition and statically defined rule engine
/// to inform user again stupid decisions they are about to make.
pub struct JournalAnalysis {}
}
21 changes: 0 additions & 21 deletions src/analyzer/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,25 +104,4 @@ impl IngestionAnalysis
phases,
})
}

/// The progress of the ingestion event, represented as a float between 0.0
/// and 1.0. This value represents the fraction of the total duration
/// (excluding the afterglow phase) that has elapsed.
pub fn progress(&self) -> f64
{
let now = chrono::Local::now();
let total_duration = self.ingestion_end - self.ingestion_start;
let elapsed_time = if now < self.ingestion_start
{
chrono::Duration::zero()
}
else
{
(now - self.ingestion_start).min(total_duration)
};

(elapsed_time.num_seconds() as f64 / total_duration.num_seconds() as f64).clamp(0.0, 1.0)
}


}
7 changes: 0 additions & 7 deletions src/journal/README.md

This file was deleted.

19 changes: 0 additions & 19 deletions src/journal/mod.rs

This file was deleted.

3 changes: 1 addition & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ mod analyzer;
mod cli;
mod core;
mod database;
pub mod ingestion;
mod journal;
mod ingestion;
mod prelude;
mod substance;
mod tui;
Expand Down
2 changes: 1 addition & 1 deletion src/substance/repository.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use std::str::FromStr;

#[io_cached(
disk = true,
sync_to_disk_on_cache_change = true,
sync_to_disk_on_cache_change = false,
map_error = r##"|e| SubstanceError::DiskError"##,
time = 2592000000
)]
Expand Down

0 comments on commit 0d9b3e8

Please sign in to comment.