plugin download: use cache if dest_path is empty:
if dest_path is not set, the file will be downloaded in cache. A new name will be generated using a hash of the uri. If the file is already downloded in cache, it won't be downloaded again (in this case returned progress_id is an empty string).
This commit is contained in:
parent
c16dd25fc9
commit
f71b40f86f
1 changed files with 43 additions and 9 deletions
|
|
@ -346,6 +346,8 @@ class Const(object):
|
|||
## Files ##
|
||||
FILE_TYPE_DIRECTORY = "directory"
|
||||
FILE_TYPE_FILE = "file"
|
||||
# when filename can't be found automatically, this one will be used
|
||||
FILE_DEFAULT_NAME = "unnamed"
|
||||
|
||||
## Permissions management ##
|
||||
ACCESS_PERM_READ = "read"
|
||||
|
|
@ -378,10 +380,13 @@ class Const(object):
|
|||
## Misc ##
|
||||
SAVEFILE_DATABASE = APP_NAME_FILE + ".db"
|
||||
IQ_SET = '/iq[@type="set"]'
|
||||
ENV_PREFIX = "SAT_" # Prefix used for environment variables
|
||||
# Prefix used for environment variables
|
||||
ENV_PREFIX = "SAT_"
|
||||
IGNORE = "ignore"
|
||||
NO_LIMIT = -1 # used in bridge when a integer value is expected
|
||||
DEFAULT_MAX_AGE = 1209600 # default max age of cached files, in seconds
|
||||
# used in bridge when a integer value is expected
|
||||
NO_LIMIT = -1
|
||||
# default max age of cached files, in seconds
|
||||
DEFAULT_MAX_AGE = 3600 * 24 * 14
|
||||
HASH_SHA1_EMPTY = "da39a3ee5e6b4b0d3255bfef95601890afd80709"
|
||||
STANZA_NAMES = ("iq", "message", "presence")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue