File tree Expand file tree Collapse file tree 5 files changed +18
-19
lines changed
Expand file tree Collapse file tree 5 files changed +18
-19
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ let generate_text file_name =
6363 let human_sizes =
6464 List. mapi
6565 (fun i size ->
66- if List. nth ! strmodes i |> String. starts_with ~prefix: " d" then " -"
66+ if String. starts_with ~prefix: " d" @@ List. nth ! strmodes i then " -"
6767 else humanise_size @@ Int64. to_int size)
6868 ! sizes
6969 in
@@ -90,16 +90,16 @@ let generate_text file_name =
9090
9191 (* TODO: terminal colours *)
9292 let res =
93- List. init ( List. length ! strmodes) ( fun i ->
94- let raw_size = List. nth human_sizes i in
95- let size = List. nth colorised_sizes i in
96- let strmode = List. nth ! strmodes i in
97- let mtime = List. nth colorised_dates i in
98- let name = List. nth ! names i in
99- strmode ^ " "
100- ^ repeat " " (max_size - String. length raw_size)
101- ^ size ^ " " ^ mtime ^ " " ^ name )
102- |> String. concat " \n "
93+ String. concat " \n "
94+ @@ List. init ( List. length ! strmodes) ( fun i ->
95+ let raw_size = List. nth human_sizes i in
96+ let size = List. nth colorised_sizes i in
97+ let strmode = List. nth ! strmodes i in
98+ let mtime = List. nth colorised_dates i in
99+ let name = List. nth ! names i in
100+ strmode ^ " "
101+ ^ repeat " " (max_size - String. length raw_size )
102+ ^ size ^ " " ^ mtime ^ " " ^ name)
103103 in
104104
105105 archive_read_free archive >> = fun () -> res
Original file line number Diff line number Diff line change 11let directory () =
22 let stream =
33 Unix. open_process_in
4- " eza -a1F --color=always --group-directories-first --icons=always --git"
4+ @@ " eza -a1F --color=always --group-directories-first --icons=always --git"
55 in
6- stream |> In_channel. input_all |> print_endline ;
6+ print_endline @@ In_channel. input_all stream ;
77 In_channel. close stream
Original file line number Diff line number Diff line change 11let generate_thumb file_name cache_file =
2- (* create quicklook thumbnail *)
3- Printf. sprintf " ffmpeg -ss 00:00:01 -i \" %s\" -frames:v 1 \" %s\" " file_name
4- cache_file
5- |> Unix. open_process_in |> ignore
2+ ignore @@ Unix. open_process_in
3+ @@ Printf. sprintf " ffmpeg -ss 00:00:01 -i \" %s\" -frames:v 1 \" %s\" " file_name
4+ cache_file
65
76let thumbnail ~width ~height file =
87 let cache_file = Helpers. get_cache_file file `THUMB in
Original file line number Diff line number Diff line change 11val thumbnail : width :int -> height :int -> string -> unit
2- (* * Generate thumbnails with quicklook *)
2+ (* * Generate thumbnails with ffmpeg *)
Original file line number Diff line number Diff line change @@ -23,6 +23,6 @@ let cache_dir =
2323 dirpath
2424
2525let get_cache_file file_name cache_type =
26- let hash = Digest.MD5. file file_name |> Digest. to_hex in
26+ let hash = Digest. to_hex @@ Digest. MD5. file file_name in
2727
2828 cache_dir ^ hash ^ match cache_type with `TEXT -> " .txt" | `THUMB -> " .png"
You can’t perform that action at this time.
0 commit comments