Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
hkalexling committed Nov 24, 2020
2 parents e602a35 + b2dc44a commit 2645e8c
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.1
Mango - Manga Server and Web Reader. Version 0.16.0
Usage:
Expand Down
16 changes: 16 additions & 0 deletions public/js/reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: mango
version: 0.15.1
version: 0.16.0

authors:
- Alex Ling <hkalexling@gmail.com>
Expand Down
7 changes: 3 additions & 4 deletions src/library/entry.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -227,8 +227,7 @@ class Entry
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
Expand Down
2 changes: 1 addition & 1 deletion src/mango.cr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require "option_parser"
require "clim"
require "./plugin/*"

MANGO_VERSION = "0.15.1"
MANGO_VERSION = "0.16.0"

# From http://www.network-science.de/ascii/
BANNER = %{
Expand Down
2 changes: 1 addition & 1 deletion src/storage.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions src/views/reader.html.ecr
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down

0 comments on commit 2645e8c

Please sign in to comment.