Have the indexer actually set the downloadsdir parameter on the recoll-we-move-files script command line. Previously, a custom directory could only be set for the default recoll configuration or if RECOLL_CONFDIR was set
This commit is contained in:
parent
02a4a69482
commit
489e88c87d
@ -95,27 +95,27 @@ def list_all_files(dir):
|
||||
|
||||
#######################
|
||||
def usage():
|
||||
print("Usage: recoll-we-move-files.py [<downloaddir>]", file=sys.stderr)
|
||||
print("Usage: recoll-we-move-files.py [<downloadsdir>]", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
config = rclconfig.RclConfig()
|
||||
|
||||
# Source dir is parameter, else from config else default Downloads directory
|
||||
# The directory where we find the files created by the browser extension is given as parameter, else
|
||||
# comes from the configuration else we use the default Downloads directory:
|
||||
if len(sys.argv) == 2:
|
||||
downloadsdir = sys.argv[1]
|
||||
elif len(sys.argv) == 1:
|
||||
downloadsdir = config.getConfParam("webdownloadsdir")
|
||||
if not downloadsdir:
|
||||
downloadsdir = "~/Downloads"
|
||||
downloadsdir = os.path.expanduser(downloadsdir)
|
||||
|
||||
if len(sys.argv) == 2:
|
||||
mydir = sys.argv[1]
|
||||
elif len(sys.argv) == 1:
|
||||
mydir = downloadsdir
|
||||
else:
|
||||
usage()
|
||||
if not os.path.isdir(mydir):
|
||||
|
||||
if not os.path.isdir(downloadsdir):
|
||||
usage()
|
||||
|
||||
# Get target webqueue recoll directory from recoll configuration
|
||||
# Get the target webqueue recoll directory from the recoll configuration
|
||||
webqueuedir = config.getConfParam("webqueuedir")
|
||||
if not webqueuedir:
|
||||
if _mswindows:
|
||||
@ -128,7 +128,7 @@ os.makedirs(webqueuedir, exist_ok = True)
|
||||
# logdeb("webqueuedir is %s" % webqueuedir)
|
||||
|
||||
# Get the lists of all files created by the browser addon
|
||||
mfiles, cfiles = list_all_files(mydir)
|
||||
mfiles, cfiles = list_all_files(downloadsdir)
|
||||
|
||||
# Only keep the last version
|
||||
mfiles = delete_previous_instances(mfiles, downloadsdir)
|
||||
|
||||
@ -65,6 +65,7 @@ bool runWebFilesMoverScript(RclConfig *config)
|
||||
}
|
||||
vector<string> cmdvec;
|
||||
config->pythonCmd("recoll-we-move-files.py", cmdvec);
|
||||
cmdvec.push_back(downloadsdir);
|
||||
|
||||
/* Arrange to not actually run the script if the directory did not change */
|
||||
static time_t dirmtime;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user