summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNayil Mukhametshin <66028747+nlscc@users.noreply.github.com>2020-07-25 23:15:01 +0200
committerNayil Mukhametshin <66028747+nlscc@users.noreply.github.com>2020-07-25 23:15:01 +0200
commit59e3bee9b0af8dd6dde38d80c5d21fe5207eec6f (patch)
tree2bb328d7c32a87e4012852f6033928f2ef40115b
parentfix README (i really need to stop making this mistake) (diff)
downloadsamloader-59e3bee9b0af8dd6dde38d80c5d21fe5207eec6f.tar
samloader-59e3bee9b0af8dd6dde38d80c5d21fe5207eec6f.tar.gz
samloader-59e3bee9b0af8dd6dde38d80c5d21fe5207eec6f.tar.bz2
samloader-59e3bee9b0af8dd6dde38d80c5d21fe5207eec6f.tar.lz
samloader-59e3bee9b0af8dd6dde38d80c5d21fe5207eec6f.tar.xz
samloader-59e3bee9b0af8dd6dde38d80c5d21fe5207eec6f.tar.zst
samloader-59e3bee9b0af8dd6dde38d80c5d21fe5207eec6f.zip
-rw-r--r--samloader/versionfetch.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/samloader/versionfetch.py b/samloader/versionfetch.py
index d5927d7..a9d2437 100644
--- a/samloader/versionfetch.py
+++ b/samloader/versionfetch.py
@@ -11,7 +11,8 @@ def getlatestver(region, model):
root = ET.fromstring(r.text)
vercode = root.find("./firmware/version/latest").text
vc = vercode.split("/")
- if len(vc) == 4:
- return vercode
- else:
- return vercode + "/" + vc[0]
+ if len(vc) == 3:
+ vc.append(vc[0])
+ if vc[2] == "":
+ vc[2] = vc[0]
+ return "/".join(vc)