161 |
tag.M.tracknum tag.M.title |
tag.M.tracknum tag.M.title |
162 |
| _ -> (gettext M.unknown) |
| _ -> (gettext M.unknown) |
163 |
|
|
|
let time_to_string time = |
|
|
let days = time / 60 / 60 / 24 in |
|
|
let rest = time - days * 60 * 60 * 24 in |
|
|
let hours = rest / 60 / 60 in |
|
|
let rest = rest - hours * 60 * 60 in |
|
|
let minutes = rest / 60 in |
|
|
let seconds = rest - minutes * 60 in |
|
|
if days > 0 |
|
|
then Printf.sprintf " %dd " days |
|
|
else if hours > 0 |
|
|
then Printf.sprintf " %d:%02d:%02d " hours minutes seconds |
|
|
else Printf.sprintf " %d:%02d " minutes seconds |
|
|
|
|
164 |
let max_eta = 1000.0 *. 60.0 *. 60.0 *. 24.0 |
let max_eta = 1000.0 *. 60.0 *. 60.0 *. 24.0 |
165 |
|
|
166 |
let calc_file_eta f = |
let calc_file_eta f = |
303 |
| Col_file_network -> Gui_global.network_name f.file_network |
| Col_file_network -> Gui_global.network_name f.file_network |
304 |
| Col_file_age -> |
| Col_file_age -> |
305 |
let age = (BasicSocket.last_time ()) - f.file_age in |
let age = (BasicSocket.last_time ()) - f.file_age in |
306 |
time_to_string age |
Date.time_to_string_long age |
307 |
| Col_file_last_seen -> |
| Col_file_last_seen -> |
308 |
if f.file_last_seen > 0 |
if f.file_last_seen > 0 |
309 |
then let last = (BasicSocket.last_time ()) |
then let last = (BasicSocket.last_time ()) |
310 |
- f.file_last_seen in |
- f.file_last_seen in |
311 |
time_to_string last |
Date.time_to_string_long last |
312 |
else Printf.sprintf "---" |
else Printf.sprintf "---" |
313 |
| Col_file_eta -> |
| Col_file_eta -> |
314 |
let eta = calc_file_eta f in |
let eta = calc_file_eta f in |
315 |
if eta >= 1000 * 60 * 60 * 24 then |
if eta >= 1000 * 60 * 60 * 24 then |
316 |
Printf.sprintf "---" |
Printf.sprintf "---" |
317 |
else time_to_string eta |
else Date.time_to_string_long eta |
318 |
| Col_file_priority -> |
| Col_file_priority -> |
319 |
Printf.sprintf "%3d" f.file_priority |
Printf.sprintf "%3d" f.file_priority |
320 |
|
|