Skip to content

Commit

Permalink
3.1.2 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
devhotteok committed Sep 4, 2023
1 parent 0031e1a commit 891798b
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 17 deletions.
3 changes: 2 additions & 1 deletion AppData/Updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ def getUpdaters(cls, versionFrom: str) -> list[typing.Callable[[dict], dict]] |
"3.0.3": None,
"3.0.4": None,
"3.1.0": cls.Update_3_1_0,
"3.1.1": None
"3.1.1": None,
"3.1.2": None
}
updaters = []
versionFound = False
Expand Down
2 changes: 1 addition & 1 deletion Core/Meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class Meta:
APP_NAME = "TwitchLink"

APP_VERSION = "3.1.1"
APP_VERSION = "3.1.2"

AUTHOR = "DevHotteok"

Expand Down
5 changes: 5 additions & 0 deletions Download/Downloader/Core/Engine/Playlist/PlaylistEngine.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ def start(self) -> None:
self._raiseException(self._safeTempDirectory.getError())
self._finish()

def _finish(self) -> None:
if self._safeTempDirectory.getError() == None:
self._safeTempDirectory.clear()
super()._finish()

def _startFFmpegProcess(self) -> None:
self._FFmpeg = FFmpeg(self.logger, parent=self)
self._FFmpeg.started.connect(self._updatePlaylist)
Expand Down
14 changes: 12 additions & 2 deletions Services/Playlist/PlaylistManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,19 @@ def __init__(self, networkAccessManager: QtNetwork.QNetworkAccessManager, url: Q
self._maxRetryCount = maxRetryCount
self._retryInterval = retryInterval
self._running = False
self._currentNetworkError: QtNetwork.QNetworkReply.NetworkError | None = None
self._retryCount = 0
self._nextSequence = 0

def update(self) -> None:
if self._reply == None:
self._error = None
self._currentNetworkError = None
self._retryCount = 0
self._updatePlaylist()

def _updatePlaylist(self) -> None:
if self._reply == None:
self._error = None
self._running = True
self._reply = self._networkAccessManager.get(self._request)
self._reply.finished.connect(self._requestDone)
Expand All @@ -50,14 +56,18 @@ def _requestDone(self) -> None:
if self._error != None:
return
if reply.error() == QtNetwork.QNetworkReply.NetworkError.NoError:
self._currentNetworkError = None
try:
self.playlist.loads(reply.readAll().data().decode(), baseUrl=self.url)
except Exception as e:
self._raiseException(e)
else:
self._running = False
self.playlistUpdated.emit()
elif self._currentNetworkError == QtNetwork.QNetworkReply.NetworkError.ContentAccessDenied and self._retryCount != 0:
self._raiseException(Exceptions.NetworkError(reply))
elif self._retryCount < self._maxRetryCount:
self._currentNetworkError = reply.error()
self._retryCount += 1
self._retryTimer.start(self._retryInterval)
else:
Expand All @@ -75,7 +85,7 @@ def _raiseException(self, exception: Exceptions.AbortRequested | Exceptions.Netw
self.errorOccurred.emit(exception)

def _retryTimerTimeout(self) -> None:
self.update()
self._updatePlaylist()

def hasNewSegments(self) -> bool:
segments = list(self.playlist.getRangedSegments(*self._range))
Expand Down
11 changes: 4 additions & 7 deletions Services/Temp/TempManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,10 @@ def getError(self) -> Exceptions.FileSystemError | None:
def path(self) -> str:
return self._directory.path()

def __del__(self):
try:
if self.getError() == None:
self._dirLock.close()
self._directory.removeRecursively()
except:
pass
def clear(self):
self._dirLock.close()
self._dirLock.remove()
self._directory.removeRecursively()


class TempManager(QtCore.QObject):
Expand Down
7 changes: 4 additions & 3 deletions Ui/MainWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,18 @@ def setup(self) -> None:
file = QtCore.QFile(Config.TRACEBACK_FILE, self)
if file.open(QtCore.QIODevice.OpenModeFlag.ReadOnly):
fileName = file.readAll().data().decode()
url = Utils.joinUrl(Config.HOMEPAGE_URL, "report", params={"lang": App.Translator.getLanguage()})
self.information.showAppInfo(
DocumentData(
contentId="CRASH_REPORT",
title=T("#{appName} has crashed.", appName=Config.APP_NAME),
content=T("#{appName} has crashed due to an unexpected error.\nIf this happens frequently, please attach the following log file and report it to us.\n\nFile: {fileName}", appName=Config.APP_NAME, fileName=fileName),
content=T("#{appName} has crashed due to an unexpected error.\nIf you see this message, please attach the following log file and report it to us.\n\nFile: {fileName}", appName=Config.APP_NAME, fileName=fileName),
contentType="text",
modal=True,
buttons=[
DocumentButtonData(text=T("ok"), role="accept", default=True),
DocumentButtonData(text=T("close"), role="accept", default=False),
DocumentButtonData(text=T("open-file"), action=f"file:{fileName}", role="action", default=False),
DocumentButtonData(text=T("report-error"), action=f"url:{Config.HOMEPAGE_URL}", role="action", default=False)
DocumentButtonData(text=T("report-error"), action=f"url:{url}", role="action", default=True)
]
)
)
Expand Down
4 changes: 4 additions & 0 deletions resources/translations/KeywordTranslations.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
"en": "Cancel",
"ko": "취소"
},
"close": {
"en": "Close",
"ko": "닫기"
},
"notification": {
"en": "Notification",
"ko": "알림"
Expand Down
6 changes: 3 additions & 3 deletions resources/translations/Translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
"en": "{appName} has crashed.",
"ko": "{appName}이/가 충돌하였습니다."
},
"#{appName} has crashed due to an unexpected error.\nIf this happens frequently, please attach the following log file and report it to us.\n\nFile: {fileName}": {
"en": "{appName} has crashed due to an unexpected error.\nIf this happens frequently, please attach the following log file and report it to us.\n\nFile: {fileName}",
"ko": "예기치 못한 오류로 인해 {appName}이/가 강제 종료되었습니다.\n이러한 일이 자주 발생한다면 아래 로그 파일을 첨부하여 문의하세요.\n\n파일: {fileName}"
"#{appName} has crashed due to an unexpected error.\nIf you see this message, please attach the following log file and report it to us.\n\nFile: {fileName}": {
"en": "{appName} has crashed due to an unexpected error.\nIf you see this message, please attach the following log file and report it to us.\n\nFile: {fileName}",
"ko": "예기치 못한 오류로 인해 {appName}이/가 강제 종료되었습니다.\n이 메시지를 보게 된다면 아래 로그 파일을 첨부하여 오류를 신고해 주세요.\n\n파일: {fileName}"
},
"#There are one or more downloads in progress.\nAre you sure you want to stop/cancel them all?": {
"en": "There are one or more downloads in progress.\nAre you sure you want to stop/cancel them all?",
Expand Down

0 comments on commit 891798b

Please sign in to comment.