diff --git a/CHANGELOG.MD b/CHANGELOG.MD index d602a65..71fd4e2 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,4 +1,8 @@ +# 17.1.8 + +- 硬链接目录时不请求从第三方拉取条目 + # 17.1.7 - 请求条目同步前进行查询 diff --git a/gradle.properties b/gradle.properties index e13a6d0..e6deedc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ group=run.ikaros.plugin description=A mikan plugin for ikaros. -version=17.1.7 \ No newline at end of file +version=17.1.8 \ No newline at end of file diff --git a/src/main/java/run/ikaros/plugin/mikan/MikanSubHandler.java b/src/main/java/run/ikaros/plugin/mikan/MikanSubHandler.java index c9c1e34..9ba3ff5 100644 --- a/src/main/java/run/ikaros/plugin/mikan/MikanSubHandler.java +++ b/src/main/java/run/ikaros/plugin/mikan/MikanSubHandler.java @@ -165,7 +165,6 @@ public Mono parseMikanSubRssAndAddToQbittorrent() { } return syncSubject(bgmTvSubjectId); }) - .flatMap(this::saveSubjectFromTag) .doOnError(throwable -> log.error("parse mikan sub rss item fail.", throwable)) .doOnComplete(() -> { // 如果新添加的种子文件状态是缺失文件,则需要再恢复下 @@ -207,13 +206,19 @@ private synchronized Mono saveSubjectFromTag(Subject subject) { .map(tag -> subject); } - private synchronized Mono syncSubject(String bgmTvSubjectId) { + private Mono getSubjectWithBgmTvId(String bgmTvSubjectId) { AssertUtils.notBlank(bgmTvSubjectId, "'bgmTvSubjectId' must not be blank."); return syncPlatformOperate.findSubjectSyncBySubjectIdAndPlatform( Long.parseLong(bgmTvSubjectId), SubjectSyncPlatform.BGM_TV) .map(SubjectSync::getSubjectId) - .flatMap(subjectOperate::findById) - .switchIfEmpty(subjectOperate.syncByPlatform(null, SubjectSyncPlatform.BGM_TV, bgmTvSubjectId)); + .flatMap(subjectOperate::findById); + } + + private synchronized Mono syncSubject(String bgmTvSubjectId) { + AssertUtils.notBlank(bgmTvSubjectId, "'bgmTvSubjectId' must not be blank."); + return getSubjectWithBgmTvId(bgmTvSubjectId) + .switchIfEmpty(subjectOperate.syncByPlatform(null, SubjectSyncPlatform.BGM_TV, bgmTvSubjectId)) + .flatMap(this::saveSubjectFromTag); } public Mono importQbittorrentFilesAndAddSubject() { @@ -235,8 +240,7 @@ public Mono importQbittorrentFilesAndAddSubject() { .flatMap(torrentInfo -> Mono.just( torrentInfo.getTags()) .filter(StringUtils::hasText) - .flatMap(bgmTvSubjectId -> syncSubject(bgmTvSubjectId) - .flatMap(this::saveSubjectFromTag) + .flatMap(bgmTvSubjectId -> getSubjectWithBgmTvId(bgmTvSubjectId) .flatMap(subject -> { String contentPath = torrentInfo.getContentPath(); File torrentFile = new File(contentPath); diff --git a/src/main/resources/plugin.yaml b/src/main/resources/plugin.yaml index b58d8b0..cacc2fb 100644 --- a/src/main/resources/plugin.yaml +++ b/src/main/resources/plugin.yaml @@ -4,7 +4,7 @@ name: PluginMikan # plugin entry class that extends BasePlugin clazz: run.ikaros.plugin.mikan.MikanPlugin # plugin 'version' is a valid semantic version string (see semver.org). -version: 17.1.7 +version: 17.1.8 requires: ">=0.17.4" author: name: Ikaros OSS Team