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
+1 -1
View File
@@ -52,7 +52,7 @@ The official docker images are available on [Dockerhub](https://hub.docker.com/r
### CLI ### CLI
``` ```
Mango - Manga Server and Web Reader. Version 0.15.0 Mango - Manga Server and Web Reader. Version 0.16.0
Usage: Usage:
+22 -6
View File
@@ -5,12 +5,6 @@ let longPages = false;
$(() => { $(() => {
getPages(); getPages();
const storedMode = localStorage.getItem('mode') || 'continuous';
setProp('mode', storedMode);
updateMode(storedMode, page);
$('#mode-select').val(storedMode);
$('#page-select').change(() => { $('#page-select').change(() => {
const p = parseInt($('#page-select').val()); const p = parseInt($('#page-select').val());
toPage(p); toPage(p);
@@ -117,6 +111,12 @@ const getPages = () => {
setProp('items', items); setProp('items', items);
setProp('loading', false); setProp('loading', false);
const storedMode = localStorage.getItem('mode') || 'continuous';
setProp('mode', storedMode);
updateMode(storedMode, page);
$('#mode-select').val(storedMode);
}) })
.catch(e => { .catch(e => {
const errMsg = `Failed to get the page dimensions. ${e}`; const errMsg = `Failed to get the page dimensions. ${e}`;
@@ -292,3 +292,19 @@ const flipPage = (isNext) => {
replaceHistory(newIdx); replaceHistory(newIdx);
saveProgress(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);
};
+1 -1
View File
@@ -1,5 +1,5 @@
name: mango name: mango
version: 0.15.0 version: 0.16.0
authors: authors:
- Alex Ling <hkalexling@gmail.com> - Alex Ling <hkalexling@gmail.com>
+8 -4
View File
@@ -118,8 +118,8 @@ class Entry
"width" => size.width, "width" => size.width,
"height" => size.height, "height" => size.height,
} }
rescue rescue e
Logger.warn "Failed to read page #{i} of entry #{@id}" Logger.warn "Failed to read page #{i} of entry #{zip_path}. #{e}"
sizes << {"width" => 1000_i32, "height" => 1000_i32} sizes << {"width" => 1000_i32, "height" => 1000_i32}
end end
end end
@@ -220,10 +220,14 @@ class Entry
thumbnail = ImageSize.resize img.data, height: 300 thumbnail = ImageSize.resize img.data, height: 300
end end
img.data = thumbnail 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 Storage.default.save_thumbnail @id, img
rescue e rescue e
Logger.warn "Failed to generate thumbnail for entry " \ Logger.warn "Failed to generate thumbnail for file #{@zip_path}. #{e}"
"#{@book.title}/#{@title}. #{e}"
end end
img img
+1 -1
View File
@@ -7,7 +7,7 @@ require "option_parser"
require "clim" require "clim"
require "./plugin/*" require "./plugin/*"
MANGO_VERSION = "0.15.0" MANGO_VERSION = "0.16.0"
# From http://www.network-science.de/ascii/ # From http://www.network-science.de/ascii/
BANNER = %{ BANNER = %{
+1 -1
View File
@@ -293,7 +293,7 @@ class Storage
Logger.info "#{trash_thumbnails_count} dangling thumbnails deleted" Logger.info "#{trash_thumbnails_count} dangling thumbnails deleted"
end end
end end
Logger.debug "DB optimization finished" Logger.info "DB optimization finished"
end end
end end
+2
View File
@@ -17,6 +17,8 @@
flipAnimation: null flipAnimation: null
}"> }">
<div @keydown.window.debounce="keyHandler($event)"></div>
<div class="uk-container uk-container-small"> <div class="uk-container uk-container-small">
<div id="alert"></div> <div id="alert"></div>
<div x-show="loading"> <div x-show="loading">