mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Allow addon page URL on AddonsDialog (#3467)
* Allow users to just copy&paste addon page URL to addon 'code' field. https://forums.ankiweb.net/t/get-addons-allow-url-on-code-section/36370
This commit is contained in:
parent
9ced6be03e
commit
761fb76ba7
2 changed files with 7 additions and 1 deletions
|
@ -195,6 +195,7 @@ Taylor Obyen <162023405+taylorobyen@users.noreply.github.com>
|
|||
Kris Cherven <krischerven@gmail.com>
|
||||
twwn <github.com/twwn>
|
||||
Shirish Pokhrel <singurty@gmail.com>
|
||||
Park Hyunwoo <phu54321@naver.com>
|
||||
|
||||
********************
|
||||
|
||||
|
|
|
@ -1066,7 +1066,12 @@ class GetAddons(QDialog):
|
|||
def accept(self) -> None:
|
||||
# get codes
|
||||
try:
|
||||
ids = [int(n) for n in self.form.code.text().split()]
|
||||
sids = self.form.code.text().split()
|
||||
sids = [
|
||||
re.sub(r"^https://ankiweb.net/shared/info/(\d+)$", r"\1", id_)
|
||||
for id_ in sids
|
||||
]
|
||||
ids = [int(id_) for id_ in sids]
|
||||
except ValueError:
|
||||
showWarning(tr.addons_invalid_code())
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue