Compare commits

...

10 Commits

Author SHA1 Message Date
Alex Ling
2645e8cd05 Merge branch 'dev' 2020-11-24 05:31:06 +00:00
Alex Ling
b2dc44a919 Reverse J and K for page navigation 2020-11-24 05:09:06 +00:00
Alex Ling
c8db397a3b Bump version to v0.16.0 2020-11-24 04:30:47 +00:00
Alex Ling
6384d4b77a Log "DB optimization finished" in the info level 2020-11-24 04:05:07 +00:00
Alex Ling
1039732d87 Log the full file path in error messages (#123) 2020-11-24 04:03:53 +00:00
Alex Ling
011123f690 Allow keyboard navigation on reader page (#124) 2020-11-24 03:57:38 +00:00
Alex Ling
e602a35b0c Merge branch 'dev' 2020-11-02 16:32:08 +00:00
Alex Ling
7792d3426e Bump version to v0.15.1 2020-11-01 09:22:05 +00:00
Alex Ling
b59c8f85ad Fix scroller issues in continuous reader (#121) 2020-10-31 04:29:46 +00:00
Alex Ling
18834ac28e Set thumbnail size and mimetype 2020-10-29 04:06:44 +00:00
7 changed files with 36 additions and 14 deletions

View File

@@ -52,7 +52,7 @@ The official docker images are available on [Dockerhub](https://hub.docker.com/r
### CLI
```
Mango - Manga Server and Web Reader. Version 0.15.0
Mango - Manga Server and Web Reader. Version 0.16.0
Usage:

View File

@@ -5,12 +5,6 @@ let longPages = false;
$(() => {
getPages();
const storedMode = localStorage.getItem('mode') || 'continuous';
setProp('mode', storedMode);
updateMode(storedMode, page);
$('#mode-select').val(storedMode);
$('#page-select').change(() => {
const p = parseInt($('#page-select').val());
toPage(p);
@@ -117,6 +111,12 @@ const getPages = () => {
setProp('items', items);
setProp('loading', false);
const storedMode = localStorage.getItem('mode') || 'continuous';
setProp('mode', storedMode);
updateMode(storedMode, page);
$('#mode-select').val(storedMode);
})
.catch(e => {
const errMsg = `Failed to get the page dimensions. ${e}`;
@@ -292,3 +292,19 @@ const flipPage = (isNext) => {
replaceHistory(newIdx);
saveProgress(newIdx);
};
/**
* Handle the global keydown events
*
* @function keyHandler
* @param {event} event - The $event object
*/
const keyHandler = (event) => {
const mode = getProp('mode');
if (mode === 'continuous') return;
if (event.key === 'ArrowLeft' || event.key === 'k')
flipPage(false);
if (event.key === 'ArrowRight' || event.key === 'j')
flipPage(true);
};

View File

@@ -1,5 +1,5 @@
name: mango
version: 0.15.0
version: 0.16.0
authors:
- Alex Ling <hkalexling@gmail.com>

View File

@@ -118,8 +118,8 @@ class Entry
"width" => size.width,
"height" => size.height,
}
rescue
Logger.warn "Failed to read page #{i} of entry #{@id}"
rescue e
Logger.warn "Failed to read page #{i} of entry #{zip_path}. #{e}"
sizes << {"width" => 1000_i32, "height" => 1000_i32}
end
end
@@ -220,10 +220,14 @@ class Entry
thumbnail = ImageSize.resize img.data, height: 300
end
img.data = thumbnail
img.size = thumbnail.size
unless img.mime == "image/webp"
# image_size.cr resizes non-webp images to jpg
img.mime = "image/jpeg"
end
Storage.default.save_thumbnail @id, img
rescue e
Logger.warn "Failed to generate thumbnail for entry " \
"#{@book.title}/#{@title}. #{e}"
Logger.warn "Failed to generate thumbnail for file #{@zip_path}. #{e}"
end
img

View File

@@ -7,7 +7,7 @@ require "option_parser"
require "clim"
require "./plugin/*"
MANGO_VERSION = "0.15.0"
MANGO_VERSION = "0.16.0"
# From http://www.network-science.de/ascii/
BANNER = %{

View File

@@ -293,7 +293,7 @@ class Storage
Logger.info "#{trash_thumbnails_count} dangling thumbnails deleted"
end
end
Logger.debug "DB optimization finished"
Logger.info "DB optimization finished"
end
end

View File

@@ -17,6 +17,8 @@
flipAnimation: null
}">
<div @keydown.window.debounce="keyHandler($event)"></div>
<div class="uk-container uk-container-small">
<div id="alert"></div>
<div x-show="loading">