Adding {subtitle} to the file naming patterns variables (#1195)

This commit is contained in:
Aditya Chandel
2025-09-22 19:52:54 -06:00
committed by GitHub
parent dedc21f0fb
commit 907d33d206
4 changed files with 99 additions and 7 deletions
@@ -36,6 +36,8 @@ public class PathPatternResolver {
? metadata.getTitle()
: "Untitled");
String subtitle = sanitize(metadata != null ? metadata.getSubtitle() : "");
String authors = sanitize(
metadata != null
? String.join(", ", metadata.getAuthors())
@@ -70,6 +72,7 @@ public class PathPatternResolver {
Map<String, String> values = new LinkedHashMap<>();
values.put("authors", authors);
values.put("title", title);
values.put("subtitle", subtitle);
values.put("year", year);
values.put("series", series);
values.put("seriesIndex", seriesIndex);
@@ -169,6 +172,8 @@ public class PathPatternResolver {
private interface MetadataProvider {
String getTitle();
String getSubtitle();
List<String> getAuthors();
Integer getYear();
@@ -211,6 +216,11 @@ public class PathPatternResolver {
return metadata.getTitle();
}
@Override
public String getSubtitle() {
return metadata.getSubtitle();
}
@Override
public List<String> getAuthors() {
return metadata.getAuthors() != null ? metadata.getAuthors().stream().toList() : Collections.emptyList();
@@ -264,6 +274,11 @@ public class PathPatternResolver {
return metadata.getTitle();
}
@Override
public String getSubtitle() {
return metadata.getSubtitle();
}
@Override
public List<String> getAuthors() {
return metadata.getAuthors() != null