fix(file): update file type and size retrieval to use primaryFile structure (#383)

This commit is contained in:
brios
2026-04-22 17:27:03 -04:00
committed by Zach Yale
parent e172fa83a1
commit 707f0a8b9b
3 changed files with 19 additions and 21 deletions
@@ -771,7 +771,7 @@ public class BookRuleEvaluatorService {
case DATE_FINISHED -> progressJoin.get("dateFinished");
case LAST_READ_TIME -> progressJoin.get("lastReadTime");
case PERSONAL_RATING -> progressJoin.get("personalRating");
case FILE_SIZE -> root.get("fileSizeKb");
case FILE_SIZE -> root.join("bookFiles", JoinType.LEFT).get("fileSizeKb");
case METADATA_SCORE -> root.get("metadataMatchScore");
case TITLE -> root.get("metadata").get("title");
case SUBTITLE -> root.get("metadata").get("subtitle");
@@ -814,7 +814,7 @@ public class BookRuleEvaluatorService {
yield cb.function("GREATEST", Float.class, koreader, kobo, pdf, epub, cbx);
}
case FILE_TYPE -> cb.function("SUBSTRING_INDEX", String.class,
root.get("fileName"), cb.literal("."), cb.literal(-1));
root.join("bookFiles", JoinType.LEFT).get("fileName"), cb.literal("."), cb.literal(-1));
default -> null;
};
}