[vlc-commits] VLSub: Handle error when fetching translations list

Marvin Scholz git at videolan.org
Thu Apr 12 14:05:51 CEST 2018


vlc/vlc-3.0 | branch: master | Marvin Scholz <epirat07 at gmail.com> | Fri Feb 16 17:25:15 2018 +0100| [8eecab0c6853b0a4abf0ab4ca0be2af5b201aa06] | committer: Hugo Beauzée-Luyssen

VLSub: Handle error when fetching translations list

(cherry picked from commit 9c2208569c2702f6292b1f7b8320a3b16b0d6088)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=8eecab0c6853b0a4abf0ab4ca0be2af5b201aa06
---

 share/lua/extensions/VLSub.lua | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/share/lua/extensions/VLSub.lua b/share/lua/extensions/VLSub.lua
index f64fc9879a..5d93e8a2a5 100644
--- a/share/lua/extensions/VLSub.lua
+++ b/share/lua/extensions/VLSub.lua
@@ -931,8 +931,15 @@ function get_available_translations()
   then
     openSub.actionLabel = lang["int_searching_transl"]
 
-    local translations_content, lol = get(translations_url)
+    local translations_content, status, resp = get(translations_url)
     local translations_avail = openSub.option.translations_avail
+
+    if translations_content == false then
+        -- Translation list download error
+        setMessage(error_tag(lang["mess_error"] .. " (" .. status .. ")"))
+        return
+    end
+
     all_trsl = parse_xml(translations_content)
     local lg, trsl
 



More information about the vlc-commits mailing list