Various scripts that I maintain

lyricfetch: Add basic file count to statusbar

Signed-off-by: Shiloh Fen <shiloh@shilohfen.com>

+7 -3
+7 -3
scripts/lyricfetch.nu
··· 33 33 34 34 print "Indexing compatible files in library" 35 35 let files = fd -g '*.flac' $library | lines 36 - print $"(ansi blue)($files | length)(ansi reset) compatible files found" 36 + let files_count = $files | length 37 + print $"(ansi blue)($files_count)(ansi reset) compatible files found" 37 38 38 39 if $clear { 39 40 print "Clearing all lyrics from library" ··· 45 46 46 47 mut autosave = 0 47 48 48 - for file in $files { 49 + for file in ($files | enumerate) { 49 50 $autosave += 1 50 51 if $minimal_screen {print (ansi clear_entire_screen) ; print (ansi cursor_home)} 52 + 53 + let index = $file.index 54 + let file = $file.item 51 55 52 56 log debug "Performing database operations" 53 57 let this = if $file in $db { ··· 89 93 } 90 94 91 95 if not $minimal_screen {print} 92 - print $"<- Fetching lyrics for (ansi green)($meta.artist) – ($meta.title)(ansi reset) ->" 96 + print $"<- Fetching lyrics for (ansi green)($meta.artist) – ($meta.title)(ansi reset) \((ansi cyan)($index)(ansi reset)/(ansi purple)($files_count)(ansi reset)\) ->" 93 97 fetch-lyrics dumb --instance $dumb_instance $meta.artist $meta.title 94 98 | if $in == null { 95 99 print $"(ansi red)No lyrics found for (ansi yellow)($meta.artist) – ($meta.title)(ansi reset)"