From: Scott Worley Date: Sat, 13 Sep 2014 16:23:59 +0000 (-0700) Subject: A manually-callable cleanup utility X-Git-Url: http://git.scottworley.com/picsort/commitdiff_plain/8cec3490a14ec25bd4cd58797d1d959dd7cb84ff?ds=sidebyside A manually-callable cleanup utility --- diff --git a/picsorter.js b/picsorter.js index 31091fa..1f6b8f0 100644 --- a/picsorter.js +++ b/picsorter.js @@ -221,6 +221,18 @@ Mousetrap.bind('%', function() { say((100 * input_index / files.length).toFixed( Mousetrap.bind('!', show_commands); Mousetrap.bind('esc', function() { $("#name").hide(); $("#shell_out").hide(); }); +function clean_picinfo() { + files_index = {}; + $.each(files, function(i, f) { + files_index[f] = true; + }); + for (f in picinfo) { + if (!files_index[f]) { + delete picinfo[f]; + } + } +} + function undelete_all() { for (f in picinfo) { delete picinfo[f].deleted;