Skip to content

Commit

Permalink
feat: 短网址优化, 有直链会生成直链短网址
Browse files Browse the repository at this point in the history
  • Loading branch information
Leon406 committed Nov 15, 2023
1 parent 7aa3a58 commit 1319af7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build_app.spec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# 本文件用于打包 MacOS 应用
# pyinstaller --clean --noconfirm build_app.spec

version = '0.6.10'
version = '0.6.11'
block_cipher = None


Expand Down
2 changes: 1 addition & 1 deletion lanzou/gui/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = '0.6.10'
version = '0.6.11'
9 changes: 6 additions & 3 deletions lanzou/gui/dialogs/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def update_ui(self):
self.lb_name.setText("文件名:")
self.lb_desc.setText("文件描述:")
self.tx_dl_link.setText("") # 清空旧的信息
self.tx_short.setText("") # 清空旧的信息
self.lb_dl_link.setVisible(True)
self.tx_dl_link.setVisible(True)
else:
Expand Down Expand Up @@ -96,13 +97,15 @@ def call_get_short_url(self):
if self._short_link_flag:
self._short_link_flag = False
self.tx_short.setPlaceholderText("后台获取中,请稍候!")
url = self.tx_share_url.text()
url = self.tx_dl_link.toPlainText()
if not url:
url = self.tx_share_url.text()
print(url)
from lanzou.api.extra import get_short_url

short_url = get_short_url(url)
if short_url:
self.tx_short.setText(short_url)
self.tx_short.setPlaceholderText("")
self.tx_short.setPlaceholderText("单击获取")
self._short_link_flag = True
else:
self.tx_short.setText("")
Expand Down

0 comments on commit 1319af7

Please sign in to comment.