Skip to content

Commit

Permalink
enable global configuration of path rewrites (fixes #78)
Browse files Browse the repository at this point in the history
  • Loading branch information
koniu committed Jul 21, 2020
1 parent 4e748d6 commit c3151ab
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@
'perpage': 25,
'csvfields': 'filename title author size time mtype url',
'title_link': 'download',
'mounts': {
# Override default links for directories.
# Useful for rewriting links to access the files on a server.
# If not specified, the url will be dir path prefixed with 'file://'.
#
# Path in recoll.conf : Remote url
# '/media/data/docs' : 'https://media.server.com/docs',
# '/var/www/data' : 'file:///192.168.1.2/data',
},
}

# sort fields/labels
Expand Down Expand Up @@ -123,7 +132,7 @@ def get_config():
config['mounts'] = {}
for d in config['dirs']:
name = 'mount_%s' % urllib.quote(d,'')
config['mounts'][d] = select([bottle.request.get_cookie(name), 'file://%s' % d], [None, ''])
config['mounts'][d] = select([bottle.request.get_cookie(name), DEFAULTS['mounts'].get(d), 'file://%s' % d], [None, ''])
return config
#}}}
#{{{ get_dirs
Expand Down

0 comments on commit c3151ab

Please sign in to comment.