Some minor bugfixes
This commit is contained in:
@@ -108,6 +108,10 @@ public class FileInfoService {
|
||||
try {
|
||||
thumbPath = Paths.get("/lalafin/file" + requestedPath + "/.thumbnails/"
|
||||
+ fileName + ".jpg");
|
||||
if (!Files.exists(thumbPath)) {
|
||||
thumbPath = Paths.get("/lalafin/file" + requestedPath
|
||||
+ "/.thumbnails/" + fileName + ".png");
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
@@ -134,7 +138,12 @@ public class FileInfoService {
|
||||
if ((thumbPath != null && Files.exists(thumbPath))
|
||||
|| thumbnailService.generateThumbnail(contentInfo, thumbPath)) {
|
||||
contentInfo.thumbnailUrl =
|
||||
"/file" + requestedUri + "/.thumbnails/" + fileUri + ".jpg";
|
||||
"/file" + requestedUri + "/.thumbnails/" + fileUri;
|
||||
if (thumbPath.toString().endsWith(".jpg")) {
|
||||
contentInfo.thumbnailUrl += ".jpg";
|
||||
} else if (thumbPath.toString().endsWith(".png")) {
|
||||
contentInfo.thumbnailUrl += ".png";
|
||||
}
|
||||
}
|
||||
folderInfo.content.add(contentInfo);
|
||||
});
|
||||
@@ -154,9 +163,9 @@ public class FileInfoService {
|
||||
+ "/" + requestedFilenameUri;
|
||||
}
|
||||
if (requestedFilename.endsWith(".zip")) {
|
||||
fileInfo.viewUrl = "/view" + requestedUri + "/" + requestedFilenameUri + "/1";
|
||||
fileInfo.viewUrl = "/view" + requestedUri + "/1";
|
||||
} else if (requestedFilename.endsWith(".epub")) {
|
||||
fileInfo.viewUrl = "/view" + requestedUri + "/" + requestedFilenameUri + "/0";
|
||||
fileInfo.viewUrl = "/view" + requestedUri + "/0";
|
||||
}
|
||||
return fileInfo;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user