Suwayomi / Suwayomi-Server

A rewrite of Tachiyomi for the Desktop
Mozilla Public License 2.0
3.73k stars 196 forks source link

[Bug] [Critical] Selecting existing Directory as Download Folder deletes existing data #891

Open radry opened 4 months ago

radry commented 4 months ago

Device information

Steps to reproduce

  1. Launch Server .bat
  2. Set an existing Directory as Download Folder in Launcher
  3. Start Server with WebUI
  4. Download a Manga (to be sure it writes into the set directory, maybe this caused the deletion of all existing content)

Expected behavior

Existing Data is not deleted

Actual behavior

Everything in the existing Directory is deleted without warning and no way to recover it

Other details

This is a critical bug! Data was lost!

TyrantRC commented 4 months ago

I'm not a dev but I also noticed something funky when I was trying to set custom folders in the "Suwayomi-Server Launcher". If I manually input the name of a new folder in the "path box", every time I type a new character, the launcher will create a new folder with the name of the existing value at that moment.

eg: If I want to change my download folder from "E:\Images\Manga\.Suwayomi" to "E:\Images\Manga\.Suwayomi\abcd", the launcher will create 4 folders like this:

and it leaves the original folder alone. This happens to the "Root Directory" as well.

So I might suggest checking thoroughly if your original folder is not hidden in an alternative path route, and also deleting cache for the suwayomi webclient (ctrl+f5 in your browser while in the suwayomi tab should suffice).

Even then, this is something that should be dealt with, because last time I also had to manually remove like 20 folders because I was messing with directories from that launcher. For next time, I suggest backing up your folders and using the server.conf file instead of the java launcher to set new routes for directories. Copying the exact path into the box also seems to work, if you deviate it brings out these problems it seems.

radry commented 4 months ago

If I manually input the name of a new folder in the "path box", every time I type a new character, the launcher will create a new folder with the name of the existing value at that moment.

You are right. That happened to me too, but it's not critical, just annoying.

The issue however is that the existing content was delete for me. I already had a directory G:\Manga with existing folders and files inside. I set this directory in the Launcher and then all the existing content was gone. I don't know if it happened when it launched or when it downloaded a manga for the first time.