[fix] DocumentRegistry: don't create empty sdr and add hasProvider() (#3675)

As suggested by @poire-z https://github.com/koreader/koreader/pull/3653#issuecomment-364663156
This commit is contained in:
Frans de Jonge
2018-02-10 18:36:18 +01:00
committed by GitHub
parent 229c492979
commit ced9e45d92
7 changed files with 37 additions and 21 deletions

View File

@@ -104,14 +104,14 @@ function DropBoxApi:listFolder(path, token)
table.insert(dropbox_list, {
text = text,
url = files.path_display,
type = tag
type = tag,
})
--show only file with supported formats
elseif tag == "file" and DocumentRegistry:getProvider(text) then
elseif tag == "file" and DocumentRegistry:hasProvider(text) then
table.insert(dropbox_file, {
text = text,
url = files.path_display,
type = tag
type = tag,
})
end
end
@@ -126,7 +126,7 @@ function DropBoxApi:listFolder(path, token)
table.insert(dropbox_list, {
text = files.text,
url = files.url,
type = files.type
type = files.type,
})
end
return dropbox_list