Skip to content

Commit

Permalink
1.0.3 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
devhotteok committed Feb 18, 2021
1 parent 38a0dfa commit 671e41a
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 15 deletions.
2 changes: 2 additions & 0 deletions Engines/TwitchLinkBiscuitEngine.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ def setRange(self, start, end):
end = self.realTotalSeconds
self.totalSeconds = end - start
self.totalFiles = int((self.totalSeconds / self.realTotalSeconds) * self.realTotalFiles)
if self.totalFiles == 0:
self.totalFiles = 1
self.reloadTotalTime()

def reloadTotalTime(self):
Expand Down
12 changes: 7 additions & 5 deletions Services/TwitchLinkDataBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ def checkStatus(self):
try:
status = data["status"]
self.statusMessage = status["message"].get(translator.getLanguage())
self.serverNotice = data["notice"].get(translator.getLanguage())
notice = data["notice"].get(translator.getLanguage())
self.serverNotice = notice["message"]
self.serverNoticeUrl = notice["url"]
if not status["running"]:
self.programStatus = "Unavailable"
return
Expand Down Expand Up @@ -310,7 +312,7 @@ def isRestricted(self, contentType, channel, content_id):
reason = "#'{channel}' has restricted downloading {content}s from their channel."
else:
reason = "#'{channel}' has restricted downloading this {content}."
Utils.info("content-restricted", "#{reason}\n\nTo protect the streamer's rights, TwitchLink blocks content downloads when restrictions requests are received.", reason=T(reason, channel=channel.displayName, content=T(contentType)))
Utils.info("content-restricted", "#{reason}\n\nTo protect the streamer's rights, {name} blocks content downloads when restrictions requests are received.", reason=T(reason, channel=channel.displayName, content=T(contentType)), name=T("#PROGRAM_NAME"))
return True

def setDownloadingState(self, state):
Expand All @@ -334,7 +336,7 @@ def setupDownload(self, dataModel, accessToken):
"date": stream.createdAt.date(self.localization.timezone),
"time": stream.createdAt.time(self.localization.timezone)
}
logs = "[Stream] [{channel}] [{started_at}] {title}".format(**kwargs)
logs = "[Stream]\nChannel : {channel}\nStarted at : {started_at}\nTitle : {title}\nStream ID : {id}".format(**kwargs)
fileName = Utils.safeFormat(self.templates.streamFilename, **kwargs)
fileName = self.getSafeFileName(fileName) + ".ts"
self.fileDownload = {"downloadType": "stream", "stream": stream, "streamData": streamData, "resolution": streamData.getResolutions()[0], "fileName": fileName, "saveDirectory": self.temp.fileSaveDirectory}
Expand All @@ -353,7 +355,7 @@ def setupDownload(self, dataModel, accessToken):
"time": video.publishedAt.time(self.localization.timezone),
"views": video.viewCount
}
logs = "[Video] [{channel}] [{published_at}] {title}".format(**kwargs)
logs = "[Video]\nChannel : {channel}\nPublished at : {published_at}\nTitle : {title}\nVideo ID : {id}".format(**kwargs)
fileName = Utils.safeFormat(self.templates.videoFilename, **kwargs)
fileName = self.getSafeFileName(fileName) + ".ts"
self.fileDownload = {"downloadType": "video", "video": video, "videoData": videoData, "resolution": videoData.getResolutions()[0], "range": [None, None], "fileName": fileName, "saveDirectory": self.temp.fileSaveDirectory}
Expand All @@ -374,7 +376,7 @@ def setupDownload(self, dataModel, accessToken):
"time": clip.createdAt.time(self.localization.timezone),
"views": clip.viewCount
}
logs = "[Clip] [{channel}] [{created_at}] {title}".format(**kwargs)
logs = "[Clip]\nChannel : {channel}\nCreated at : {created_at}\nTitle : {title}\nClip ID : {id}".format(**kwargs)
fileName = Utils.safeFormat(self.templates.clipFilename, **kwargs)
fileName = self.getSafeFileName(fileName) + ".mp4"
self.fileDownload = {"downloadType": "clip", "clip": clip, "clipData": clipData, "resolution": clipData.getResolutions()[0], "fileName": fileName, "saveDirectory": self.temp.fileSaveDirectory}
Expand Down
8 changes: 6 additions & 2 deletions TwitchLink.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,17 @@ def checkStatus(self):
Utils.info("warning", "#{name} is currently unavailable.\n{message}", name=T("#PROGRAM_NAME"), message=self.db.statusMessage)
elif status == "Available":
if self.db.serverNotice != None:
Utils.info("notice", self.db.serverNotice)
if self.db.serverNoticeUrl == None:
Utils.info("notice", self.db.serverNotice)
else:
if Utils.ask("notice", self.db.serverNotice, "open", "ok", True):
QDesktopServices.openUrl(QUrl(self.db.serverNoticeUrl))
return True
else:
if self.db.updateNote == None:
updateInfoString = "#A new version of {name} has been released!\n\n* {updateType}"
else:
updateInfoString = "#A new version of {name} has been released!\n{updateNote}\n\n* {updateType}"
updateInfoString = "#A new version of {name} has been released!\n\n{updateNote}\n\n* {updateType}"
if status == "Update Found":
if Utils.ask("update-notice", updateInfoString, "update", "ok", True, name=T("#PROGRAM_NAME"), updateNote=self.db.updateNote, updateType=T("#Optional update")):
QDesktopServices.openUrl(QUrl(self.db.updateUrl))
Expand Down
4 changes: 2 additions & 2 deletions TwitchLinkConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ class Config:

PROGRAM_PATH = sys.executable.replace("\\", "/")

VERSION = "1.0.2"
VERSION = "1.0.3"

DB_COMPATIBLE_VERSIONS = ["1.0.0", "1.0.1"]
DB_COMPATIBLE_VERSIONS = ["1.0.0", "1.0.1", "1.0.2"]

PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)).replace("\\", "/")
SYSTEM_DRIVE = os.getenv("SYSTEMDRIVE").replace("\\", "/")
Expand Down
4 changes: 4 additions & 0 deletions resources/translations/TwitchLinkKeywordTranslations.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
"en": "Update Notice",
"ko": "업데이트 알림"
},
"open": {
"en": "Open",
"ko": "열기"
},
"update": {
"en": "Update",
"ko": "업데이트"
Expand Down
12 changes: 6 additions & 6 deletions resources/translations/TwitchLinkTranslations.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"en": "A new version of {name} has been released!\n\n* {updateType}",
"ko": "{name}의 새로운 버전이 출시되었습니다!\n\n* {updateType}"
},
"#A new version of {name} has been released!\n{updateNote}\n\n* {updateType}": {
"en": "A new version of {name} has been released!\n{updateNote}\n\n* {updateType}",
"ko": "{name}의 새로운 버전이 출시되었습니다!\n{updateNote}\n\n* {updateType}"
"#A new version of {name} has been released!\n\n{updateNote}\n\n* {updateType}": {
"en": "A new version of {name} has been released!\n\n{updateNote}\n\n* {updateType}",
"ko": "{name}의 새로운 버전이 출시되었습니다!\n\n{updateNote}\n\n* {updateType}"
},
"#Optional update": {
"en": "Optional update",
Expand Down Expand Up @@ -427,9 +427,9 @@
"en": "'{channel}' has restricted downloading this {content}.",
"ko": "'{channel}'님이 해당 {content}의 다운로드를 제한하였습니다."
},
"#{reason}\n\nTo protect the streamer's rights, TwitchLink blocks content downloads when restrictions requests are received.": {
"en": "{reason}\n\nTo protect the streamer's rights, TwitchLink blocks content downloads when restrictions requests are received.",
"ko": "{reason}\n\nTwitchLink는 스트리머의 권리를 존중합니다.\nTwitchLink는 스트리머의 권리를 보호하기 위해 콘텐츠 제한 요청이 접수되면 해당 콘텐츠의 다운로드를 제한합니다."
"#{reason}\n\nTo protect the streamer's rights, {name} blocks content downloads when restrictions requests are received.": {
"en": "{reason}\n\nTo protect the streamer's rights, {name} blocks content downloads when restrictions requests are received.",
"ko": "{reason}\n\n{name}는 스트리머의 권리를 존중합니다.\n{name}는 스트리머의 권리를 보호하기 위해 콘텐츠 제한 요청이 접수되면 해당 콘텐츠의 다운로드를 제한합니다."
},
"#{name} - Select Folder": {
"en": "{name} - Select Folder",
Expand Down

1 comment on commit 671e41a

@Leatherback-Azi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요약 -

  1. 코드 안정화, 일부 코드 가독성 향상
  2. TwitchLink의 프로젝트명 변경을 대비한 프로젝트명 출력방식 수정

Please sign in to comment.