redirect to proper directory
generate thumbnail for directories when not otherwise specified
This commit is contained in:
parent
2a3f55db82
commit
167e214a38
2 changed files with 12 additions and 4 deletions
|
|
@ -153,6 +153,10 @@ public class EntryDao {
|
|||
|
||||
Album childAlbum = read(dir);
|
||||
Entry childCover = childAlbum.getCover();
|
||||
if (childCover == null) {
|
||||
Iterator<Entry> i = childAlbum.getContents().iterator();
|
||||
childCover = i.hasNext() ? i.next() : null;
|
||||
}
|
||||
if (childCover != null) {
|
||||
childCover.setFile(false);
|
||||
childCover.setName(dir.getName());
|
||||
|
|
|
|||
|
|
@ -65,6 +65,10 @@ public class AlbumServlet
|
|||
}
|
||||
|
||||
if (file.isDirectory()) {
|
||||
if (!pathInfo.endsWith("/")) {
|
||||
res.sendRedirect(req.getContextPath() + req.getRequestURI() + "/");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
List<Entry> entries = dao.read(file).getContents();
|
||||
res.setContentType("text/html");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue