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

Empty volume folders when downloading cbz files #183

Open
Johndirr opened this issue Aug 6, 2023 · 1 comment
Open

Empty volume folders when downloading cbz files #183

Johndirr opened this issue Aug 6, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@Johndirr
Copy link

Johndirr commented Aug 6, 2023

Describe the bug

When downloading with MANGAL_FORMATS_USE = cbz and MANGAL_DOWNLOADER_CREATE_VOLUME_DIR = true, an empty folder for each volume will be created in the mangal directory:
grafik
The cbz files are still created chapter-wise and are correctly placed in the folder of the manga.

Reproduction steps

  1. Set MANGAL_FORMATS_USE = cbz and MANGAL_DOWNLOADER_CREATE_VOLUME_DIR = true
  2. Download a Manga with information about their volumes (e.g. from Mangadex)

Expected behavior

For each volume a cbz gets created.

Additional context

Using mangal_4.0.6_Windows_x86_64

Operating System

Windows

@shinji257
Copy link

shinji257 commented Jan 18, 2024

I have not been able to get it to create any directories. Just for the heck of it I did add the volume template tag to the filenames and it does have something there so I don't know why it isn't making them at all. Currently running latest git code but I don't think it was working at all for the last release version either.

EDIT: Nevermind. They are created. It is that they are being created in the current running directory and not where you set downloader.path to.

EDIT: These are suspect lines but I don't know how to get what is in err or if there is even anything there. If error != nil then it defaults the download location to . for some reason.

mangal/where/where.go

Lines 66 to 77 in 165f7ca

func Downloads() string {
path, err := filepath.Abs(viper.GetString(key.DownloaderPath))
if err != nil {
path, err = os.Getwd()
if err != nil {
path = "."
}
}
return mkdir(path)
}

The volume name is then appended here and created for the download. However I think it is actually getting back . from the Downloads function as it makes sense given that right now it seems to be doing effectively ./{volume} for folder creation.

mangal/source/manga.go

Lines 103 to 111 in 165f7ca

func (m *Manga) peekPath() string {
path := where.Downloads()
if viper.GetBool(key.DownloaderCreateMangaDir) {
path = filepath.Join(path, m.Dirname())
}
return path
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants