Skip to main content

Module queue

Module queue 

Source
Expand description

Persistent download history.

Every download — successful or not — is appended to a JSON file in the OS config directory so the record survives app restarts.

File locations

  • macOS: ~/Library/Application Support/kget/history.json
  • Linux: ~/.config/kget/history.json
  • Windows: %APPDATA%\kget\history.json

§Example

use kget::queue::{DownloadHistory, EntryStatus, HistoryEntry};

let mut history = DownloadHistory::load();

let mut entry = HistoryEntry::new(
    "https://example.com/file.iso",
    "/home/user/Downloads",
    None,
);
history.record(entry, EntryStatus::Completed, None);
history.save().unwrap();

for e in history.recent(10) {
    println!("{} {} {}", e.created_at_display(), e.status, e.filename);
}

Structs§

DownloadHistory
Persistent download history backed by a JSON file in the OS config dir.
HistoryEntry
A single record in the download history.

Enums§

EntryStatus
Outcome of a completed download attempt.

Functions§

format_unix
Format a Unix timestamp as YYYY-MM-DD HH:MM UTC without external crates.