fix: show N/A for magnet link dates
All checks were successful
Build MIPS Binary / build (push) Successful in 4m14s

Magnet links don't have creation_date, so timestamp is 0.
Now shows 'N/A' instead of 01/01/1970 00:00
This commit is contained in:
spinline
2026-02-08 05:28:14 +03:00
parent 619951fa1c
commit 32f4946530

View File

@@ -46,6 +46,9 @@ fn format_duration(seconds: i64) -> String {
}
fn format_date(timestamp: i64) -> String {
if timestamp <= 0 {
return "N/A".to_string();
}
let dt = chrono::DateTime::from_timestamp(timestamp, 0);
match dt {
Some(dt) => dt.format("%d/%m/%Y %H:%M").to_string(),