Skip to content

Commit

Permalink
feat: add media dir category for nsfw and normal
Browse files Browse the repository at this point in the history
  • Loading branch information
li-guohao committed Jul 5, 2023
1 parent 4c82d6f commit 2b2d9f8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
group=run.ikaros.jellyfin
description=A jellyfin plugin for ikaros.
version=0.2.1
version=0.2.2
11 changes: 10 additions & 1 deletion src/main/java/run/ikaros/jellyfin/MediaDirInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public Disposable generate() {

private void generateJellyfinMediaDirAndFiles() {
String mediaDirAbsolutePath = workDirAbsolutePath + File.separatorChar + MEDIA_DIR_NAME;
String nsfwMediaDirAbsolutePath = mediaDirAbsolutePath + File.separatorChar + "nsfw";
String normalMediaDirAbsolutePath = mediaDirAbsolutePath + File.separatorChar + "normal";
PagingWrap<Subject> pagingWrap = new PagingWrap<>(1, 9999, 0, null);

File mediaDir = new File(mediaDirAbsolutePath);
Expand All @@ -61,7 +63,14 @@ private void generateJellyfinMediaDirAndFiles() {
}

subjectOperate.findAllByPageable(pagingWrap)
.doOnEach(subjectSignal -> handleSubject(subjectSignal, mediaDirAbsolutePath))
.doOnEach(subjectSignal -> {
Subject subject = subjectSignal.get();
if (subject == null) {
return;
}
handleSubject(subjectSignal,
subject.getNsfw() ? nsfwMediaDirAbsolutePath : normalMediaDirAbsolutePath);
})
.subscribeOn(Schedulers.boundedElastic())
.subscribe();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: PluginJellyfin
# plugin entry class that extends BasePlugin
clazz: run.ikaros.jellyfin.JellyfinPlugin
# plugin 'version' is a valid semantic version string (see semver.org).
version: 0.2.1
version: 0.2.2
requires: ">=0.3.1"
author:
name: Ikaros OSS Team
Expand Down

0 comments on commit 2b2d9f8

Please sign in to comment.