mirror of
https://github.com/hkalexling/Mango.git
synced 2026-01-24 00:03:14 -05:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa147602fc | ||
|
|
d58c83fbd8 | ||
|
|
1a0c3d81ce | ||
|
|
33c61fd8c1 | ||
|
|
6eba3fe351 | ||
|
|
da2708abe5 | ||
|
|
febf344d33 | ||
|
|
ae15398b6c | ||
|
|
b28f6046dd | ||
|
|
91b823450c | ||
|
|
085fba611c | ||
|
|
f8d633c751 |
3
.github/FUNDING.yml
vendored
Normal file
3
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
patreon: hkalexling
|
||||
24
.github/workflows/build.yml
vendored
Normal file
24
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master, dev ]
|
||||
pull_request:
|
||||
branches: [ master, dev ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
container:
|
||||
image: crystallang/crystal:0.32.1-alpine
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install dependencies
|
||||
run: apk add --no-cache yarn yaml sqlite-static
|
||||
- name: Build
|
||||
run: make
|
||||
- name: Run tests
|
||||
run: make test
|
||||
20
Dockerfile
20
Dockerfile
@@ -1,18 +1,16 @@
|
||||
FROM crystallang/crystal:0.32.0
|
||||
|
||||
RUN apt-get update && apt-get install -y curl
|
||||
|
||||
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
|
||||
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
|
||||
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
|
||||
|
||||
RUN apt-get update && apt-get install -y nodejs yarn libsqlite3-dev
|
||||
FROM crystallang/crystal:0.32.1-alpine AS builder
|
||||
|
||||
WORKDIR /Mango
|
||||
|
||||
COPY . .
|
||||
COPY package*.json .
|
||||
RUN apk add --no-cache yarn yaml sqlite-static \
|
||||
&& make static
|
||||
|
||||
RUN make && make install
|
||||
FROM library/alpine
|
||||
|
||||
CMD ["mango"]
|
||||
WORKDIR /
|
||||
|
||||
COPY --from=builder /Mango/mango .
|
||||
|
||||
CMD ["./mango"]
|
||||
|
||||
21
README.md
21
README.md
@@ -5,7 +5,7 @@
|
||||
|
||||
# Mango
|
||||
|
||||
[](https://gitter.im/mango-cr/mango?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
||||
[](https://www.patreon.com/hkalexling)  [](https://gitter.im/mango-cr/mango?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
||||
|
||||
Mango is a self-hosted manga server and reader. Its features include
|
||||
|
||||
@@ -75,6 +75,25 @@ mangadex:
|
||||
- `scan_interval_minutes` can be any non-negative integer. Setting it to `0` disables the periodic scan
|
||||
- `log_level` can be `debug`, `info`, `warn`, `error`, `fatal` or `off`. Setting it to `off` disables the logging
|
||||
|
||||
### Library Structure
|
||||
|
||||
You can organize your `.cbz/.zip` files in nested folders in the library directory. Here's an example:
|
||||
|
||||
```
|
||||
.
|
||||
├── Manga 1
|
||||
│  ├── Volume 1.cbz
|
||||
│  ├── Volume 2.cbz
|
||||
│  ├── Volume 3.cbz
|
||||
│  └── Volume 4.zip
|
||||
└── Manga 2
|
||||
  └── Vol. 1
|
||||
  └── Ch.1 - Ch.3
|
||||
  ├── 1.zip
|
||||
  ├── 2.zip
|
||||
  └── 3.zip
|
||||
```
|
||||
|
||||
### Initial Login
|
||||
|
||||
On the first run, Mango would log the default username and a randomly generated password to STDOUT. You are advised to immediately change the password.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: mango
|
||||
version: 0.2.1
|
||||
version: 0.2.3
|
||||
|
||||
authors:
|
||||
- Alex Ling <hkalexling@gmail.com>
|
||||
|
||||
@@ -25,4 +25,12 @@ describe "compare_alphanumerically" do
|
||||
compare_alphanumerically a, b
|
||||
}.should eq ary
|
||||
end
|
||||
|
||||
# https://github.com/hkalexling/Mango/issues/22
|
||||
it "handles numbers larger than Int32" do
|
||||
ary = ["14410155591588.jpg", "21410155591588.png", "104410155591588.jpg"]
|
||||
ary.reverse.sort {|a, b|
|
||||
compare_alphanumerically a, b
|
||||
}.should eq ary
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3,7 +3,7 @@ require "./context"
|
||||
require "./mangadex/*"
|
||||
require "option_parser"
|
||||
|
||||
VERSION = "0.2.1"
|
||||
VERSION = "0.2.3"
|
||||
|
||||
config_path = nil
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
require "big"
|
||||
|
||||
IMGS_PER_PAGE = 5
|
||||
|
||||
macro layout(name)
|
||||
@@ -56,7 +58,7 @@ def compare_alphanumerically(c, d)
|
||||
return -1 if a.nil?
|
||||
return 1 if b.nil?
|
||||
if is_numeric(a) && is_numeric(b)
|
||||
compare = a.to_i <=> b.to_i
|
||||
compare = a.to_big_i <=> b.to_big_i
|
||||
return compare if compare != 0
|
||||
else
|
||||
compare = a <=> b
|
||||
|
||||
Reference in New Issue
Block a user