-
-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
修复 Transmission 暂停-重启错误 + 废弃 Transmission 适配器 #381
Conversation
WalkthroughThe recent changes implement a locking mechanism in the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant PeerBanHelperServer
participant Downloader
participant Transmission
User->>PeerBanHelperServer: Trigger banWave()
PeerBanHelperServer->>PeerBanHelperServer: Acquire banWaveLock
PeerBanHelperServer->>Downloader: runScheduleTasks()
Downloader->>Transmission: Update paused torrents
Transmission->>Transmission: Manage torrent states
PeerBanHelperServer->>PeerBanHelperServer: Release banWaveLock
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- src/main/java/com/ghostchu/peerbanhelper/PeerBanHelperServer.java (4 hunks)
- src/main/java/com/ghostchu/peerbanhelper/downloader/Downloader.java (1 hunks)
- src/main/java/com/ghostchu/peerbanhelper/downloader/impl/transmission/Transmission.java (5 hunks)
Additional comments not posted (5)
src/main/java/com/ghostchu/peerbanhelper/downloader/Downloader.java (1)
55-59
: Approved: Addition of the default methodrunScheduleTasks()
in theDownloader
interface.This change enhances modularity by providing a default implementation that can be overridden by implementing classes if needed.
src/main/java/com/ghostchu/peerbanhelper/downloader/impl/transmission/Transmission.java (3)
48-48
: Approved: Introduction ofDelayQueue<DelayedTorrents>
for managing paused torrents.This change enhances the control flow by enabling asynchronous handling of torrent resumption, which is more efficient than the previous synchronous sleep mechanism.
231-250
: Approved: Implementation of theDelayedTorrents
class.This class is well implemented to work with
DelayQueue
by providing necessary methods to manage delay times and compare instances based on their scheduled start time.
220-222
: Approved: Modification ofrunScheduleTasks()
to invokeunpauseTorrents(false)
.This ensures that any scheduled tasks are processed appropriately, aligning with the changes made to manage paused torrents.
src/main/java/com/ghostchu/peerbanhelper/PeerBanHelperServer.java (1)
103-103
: Approved: Introduction ofReentrantLock
for managing concurrency inbanWave
method.This change improves the robustness of the method by preventing race conditions and ensuring that the method can handle interruptions gracefully.
Deploying pbh-fe with Cloudflare Pages
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (9)
- src/main/java/com/ghostchu/peerbanhelper/downloader/impl/transmission/Transmission.java (7 hunks)
- src/main/java/com/ghostchu/peerbanhelper/text/Lang.java (1 hunks)
- src/main/resources/lang/en_us/messages.yml (1 hunks)
- src/main/resources/lang/messages_fallback.yml (1 hunks)
- src/main/resources/lang/zh_cn/messages.yml (1 hunks)
- webui/src/views/dashboard/components/editDownloaderModal.vue (2 hunks)
- webui/src/views/dashboard/locale/en-US.ts (1 hunks)
- webui/src/views/dashboard/locale/zh-CN.ts (1 hunks)
- webui/src/views/oobe/components/addDownloader.vue (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- src/main/java/com/ghostchu/peerbanhelper/downloader/impl/transmission/Transmission.java
Additional context used
yamllint
src/main/resources/lang/zh_cn/messages.yml
[error] 366-366: no new line character at the end of file
(new-line-at-end-of-file)
src/main/resources/lang/messages_fallback.yml
[error] 367-367: no new line character at the end of file
(new-line-at-end-of-file)
src/main/resources/lang/en_us/messages.yml
[error] 367-367: no new line character at the end of file
(new-line-at-end-of-file)
Additional comments not posted (11)
webui/src/views/oobe/components/addDownloader.vue (2)
15-17
: Approve the discouragement of Transmission usage.The addition of the tooltip and the disabling of the Transmission option are in line with the PR objectives to phase out the Transmission adapter. This change effectively communicates the discouraged status to users.
44-50
: Approve the reformatting of import statements.The reformatting of the import statements improves code consistency and readability without affecting functionality.
webui/src/views/dashboard/locale/zh-CN.ts (1)
51-51
: Approve the addition of the warning message.The new warning message under
'page.dashboard.editModal.transmission.discourage'
is clear and informative, effectively enhancing user awareness about the deprecation of the Transmission adapter.webui/src/views/dashboard/components/editDownloaderModal.vue (2)
16-18
: Approve the discouragement of Transmission usage in the edit modal.Similar to the OOBE component, the addition of the tooltip and the disabling of the Transmission option in the edit modal are well-aligned with the PR objectives to phase out the Transmission adapter.
45-50
: Approve the reformatting of import statements.The reformatting of the import statements in this file, similar to the OOBE component, improves code consistency and readability without affecting functionality.
webui/src/views/dashboard/locale/en-US.ts (1)
50-50
: Approved: New warning message added.The new localization string effectively communicates the risks associated with the frequent use of the Transmission Adapter, aligning with the PR's objectives to discourage its use.
src/main/java/com/ghostchu/peerbanhelper/text/Lang.java (1)
329-329
: Approved: New enum entry added.The addition of
DOWNLOADER_TRANSMISSION_DISCOURAGE
to theLang
enum is consistent with the application's localization practices and supports the new warning message functionality.src/main/resources/lang/messages_fallback.yml (2)
365-366
: Ensure proper formatting forIN_ECOMODE_DESCRIPTION
.The modification to
IN_ECOMODE_DESCRIPTION
retains the existing content but enhances formatting. Ensure that the formatting changes align with the intended display standards and do not introduce any parsing issues.
367-367
: New entry added forDOWNLOADER_TRANSMISSION_DISCOURAGE
.The added message effectively communicates the discouragement of using the Transmission adapter due to potential risks. This aligns with the PR's objectives of enhancing user awareness regarding the deprecated functionality.
Tools
yamllint
[error] 367-367: no new line character at the end of file
(new-line-at-end-of-file)
src/main/resources/lang/en_us/messages.yml (2)
365-366
: Ensure proper formatting forIN_ECOMODE_DESCRIPTION
.The modification to
IN_ECOMODE_DESCRIPTION
retains the existing content but enhances formatting. Ensure that the formatting changes align with the intended display standards and do not introduce any parsing issues.
367-367
: New entry added forDOWNLOADER_TRANSMISSION_DISCOURAGE
.The added message effectively communicates the discouragement of using the Transmission adapter due to potential risks. This aligns with the PR's objectives of enhancing user awareness regarding the deprecated functionality.
Tools
yamllint
[error] 367-367: no new line character at the end of file
(new-line-at-end-of-file)
@@ -12,7 +12,9 @@ | |||
<a-form-item field="config.type" :label="t('page.dashboard.editModal.label.type')" required> | |||
<a-radio-group v-model="config.downloaderConfig.config.type" type="button"> | |||
<a-radio :value="ClientTypeEnum.qBittorrent">qBittorrent</a-radio> | |||
<a-radio :value="ClientTypeEnum.Transmission">Transmission</a-radio> | |||
<a-tooltip :content="t('page.dashboard.editModal.transmission.discourage')"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
添加了flag之后可以启用tr,这个体现在哪儿呢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
新添加总是不允许的,但此 flag 允许用户恢复 testDownloader 的返回结果,这样可以让 WebUI 保存配置更改。并可以隐藏烦人的 “需要采取行动” 提示。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
新添加的话,自己去改配置文件吧
src/main/java/com/ghostchu/peerbanhelper/downloader/impl/transmission/Transmission.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- src/main/java/com/ghostchu/peerbanhelper/downloader/impl/transmission/Transmission.java (7 hunks)
Files skipped from review as they are similar to previous changes (1)
- src/main/java/com/ghostchu/peerbanhelper/downloader/impl/transmission/Transmission.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- webui/src/views/dashboard/locale/en-US.ts (1 hunks)
- webui/src/views/dashboard/locale/zh-CN.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- webui/src/views/dashboard/locale/en-US.ts
Additional comments not posted (1)
webui/src/views/dashboard/locale/zh-CN.ts (1)
50-50
: LGTM!The added localization string is clear and informative. It effectively communicates the deprecation of the Transmission adapter and the associated risks.
The code changes are approved.
修复了 Transmission 暂停-重启的 BUG,并开始推进废弃 Transmission 适配器。
#382
后端更改
-Dpbh.downloader.transmission.i-know-transmission-is-discourage-and-could-be-removed-in-future-please-dont-show-require-take-actions-status-text-and-i-know-what-i-am-doing
JVM 附加参数前端更改
OOBE
Dashboard
Summary by CodeRabbit
New Features
banWave
method to enhance concurrency control.runScheduleTasks()
to theDownloader
interface for improved modularity.Transmission
class using a delay queue.User Interface Changes