Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Support Chapters that are not in a comic book file #215

Closed
Luro02 opened this issue Aug 15, 2021 · 9 comments · Fixed by #322
Closed

[Feature Request] Support Chapters that are not in a comic book file #215

Luro02 opened this issue Aug 15, 2021 · 9 comments · Fixed by #322
Labels
enhancement New feature or request

Comments

@Luro02
Copy link

Luro02 commented Aug 15, 2021

Is your feature request related to a problem? Please describe.

I am running Mango on a VPS that has a limited amount of storage, but I have 1TB OneDrive, so I mounted it with rclone and changed the docker-compose.yml:

version: '3'

services:
  mango:
    image: hkalexling/mango
    container_name: mango
    ports:
      - 9005:9000
    volumes:
      - ./mango:/root/mango
      - ./config/mango:/root/.config/mango
+     - /mnt/onedrive/manga:/root/mango/library

After I did this, the website became really slow and scanning a single manga with 2 Chapters (few MBs) took 27300ms to scan, which seems to be caused by #118.

It seems like rclone is downloading the entire library for mango, which is quite expensive and kinda defeats the purpose of storing them in the cloud.

Describe the solution you'd like
Currently, Mango only supports libraries that look like this:

library
├── Manga Name
│  ├── Chapter1.cbz
│  ├── Chapter2.cbz
│  └── ....
└── ....

Instead of having the chapters in zip files, one should be able to store them in directories:

library
├── Manga Name
│  ├── Chapter1
│  │  ├── 001.png
│  │  └── ....
│  └── ....
└── ....

This should prevent rclone from downloading every single zip in the library, just to generate the preview images.

It might be good to abstract away the zip under an interface, so directories and comic book files are treated in the same way.
This would have the benefit that comic book files that contain the chapters as directories would be supported as well.

@Luro02 Luro02 added the enhancement New feature or request label Aug 15, 2021
@hkalexling
Copy link
Member

Thanks for the suggestion! This looks like a nice workaround for #118 as a proper fix would likely take longer. Will work on this when I have the time.

@tr7zw
Copy link
Contributor

tr7zw commented Sep 20, 2021

Supporting directories as chapters sounds really neat to make Mango more compatible with other technologies. One thing of note would be that it needs to check subdirectories rather they contain deeper structures(zips/folders)(current behaviour), or supported image files(added new behaviour). So it can't just assume that any folder on the 2nd level is a chapter.

library
├── Some parent folder(Artist/download src/whatever)
│  ├── Manga Name
│  │  ├── Chapter1
│  │  │  ├── 001.png
│  │  └── Chapter2.zip
│  └── SomeOtherFile.zip
└── ....

@Leeingnyo
Copy link
Member

I think we can treat a directory that has images and another entries and titles together as both a title and an entry of its parent title for going easy implementation. Then, we don't need to check if a directory has only images when scanning. (the responsibility of configuring a library is up to the library owners)

root
├ P
│ ├ Target
│ │ ├ 001.png
│ │ ├ 002.png
│ │ ├ C01.zip
│ │ └ Book
│ │   ├ C03.zip
│ │   └ C03.zip
│ └ Foo
├ ...
...

For example with above tree:

  • In a title P, we have 2 titles and one entry (a title Target, a title Foo and an entry Target).
  • In the title Target, we have a title and an entry (a title Book and an entry C01).

What do you think?

By the way, we would have to define an interface for general entry, since current Entry is for zipped files

@hkalexling
Copy link
Member

hkalexling commented Sep 25, 2021

@Leeingnyo yes I was thinking about this as well and I agree this would be the most elegant solution. For the Entry class, I was planning to update it to support both types of entries, but then I think your proposal makes more sense as it makes the code cleaner 👍 The library classes Library, Title and Entry are already bloated and I really don't want to make it worse.

@tr7zw
Copy link
Contributor

tr7zw commented Jun 16, 2022

I'm not 100% sure that it's an issue from the pr, or an issue in general, but when the folder changes over time(for example, I stream new pages into the folder), mango only seems to consider the pages it found the first scan.
So adding another 10 pages and triggering a "Scan Library Files" will still show the old page count, and the new pages won't show up in the reader. So far the only solution I've found was temporarily renaming the folder so mango correctly rescans it.

@Leeingnyo
Copy link
Member

@tr7zw thank you for reporting! If there are files added, the signature of directory should be changed. I'll check it soon!

@tr7zw
Copy link
Contributor

tr7zw commented Jun 16, 2022

Now, a few hours later I can confirm that it doesn't seem to fix itself, but after creating a copy of the folder it seems to have fixed all folders. Maybe the logic to recalculate this data is not called during a "Scan Library Files", or it's some caching issue?

@Leeingnyo
Copy link
Member

@tr7zw that was a bug that the mango didn't notice that the directory had more image files (it detected archive files only). I fixed it in an above PR. Thank you

@mango-assistant
Copy link

Hi there! The feature has been added in v0.27.0. Thanks for the feature request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants