manyfold icon indicating copy to clipboard operation
manyfold copied to clipboard

When organizing files some do not get moved.

Open BRAYDIN72 opened this issue 1 year ago • 2 comments

Describe the bug Using bulk edit and clicking organize files will cause some files to no move to the new location. This causes the system to see some of the files and folders as not existing. . Click Bulk Edit Click select all slide organize files to on click Update Selected Files

After scanning is complete usually 1 or 2 models will have some of their files not move. There will be a red X at the top stating danger. This time 2 models failed.

OrganizeModelJob | 18 minutes | Validation failed: Path already exists OrganizeModelJob | 19 minutes | Validation failed: Path already exists

Sidekiq will show :

Errno::ENOENT: No such file or directory @ dir_s_rmdir - /libraries/toys/ttrpg/terrain/floor/dungeon Processor: 11bceb7245b9:138

Errno::EPERM: Operation not permitted @ apply2files - /libraries/toys/ttrpg/shared-accessories/Adaptatable#735/12_leg_dwarf (repaired).stl.stl Processor: 11bceb7245b9:138

Sorting this out can be a bit of an issue as the model itself exists in 1 location but the database points to another that doesn't exist. example: ttrpg/terrain/floor/dungeon/Dungeon Floor Simple B#338 is what the database shows for that file, but the path to the actual file is ttrpg\terrain\dxt\floor\dungeon\Dungeon Floor Simple B#338 and the file is there. That is the correct location for where the file should be and ttrpg/terrain/floor doesn't even exist anymore. It moved the files but failed to update the database and any attempts to correct that with in the program will not work. Such as clicking organize again. Gets you this pop up:

The folder and files that make up this model will be moved from: ttrpg/terrain/floor/dungeon/Dungeon Floor Simple B#338 to ttrpg/terrain/dxt/floor/dungeon/Dungeon Floor Simple B#338

Are you sure you want to do this? Clicking Move the files refreshes the screen but nothing changes. The expected location remains ttrpg/terrain/floor/dungeon/Dungeon Floor Simple B#338

Sidekiq entry for the attempt to organize after the error:

  | OrganizeModelJob | less than a minute | Validation failed: Path already exists   | OrganizeModelJob | 1 minute | Validation failed: Path already exists

Expected behavior Organize files in the bulk edit page should properly update to the new location.

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: Chrome
  • Version Version 129.0.6668.90 (Official Build) (64-bit)

Server is on Unraid running as a docker using the :latest version

BRAYDIN72 avatar Oct 16 '24 19:10 BRAYDIN72

Thanks, that's interesting; I'll chase it down. Do the models tend to be similarly tagged and named? Or is it with any arbitrary selection in bulk edit?

Floppy avatar Oct 16 '24 20:10 Floppy

I can't see a pattern in tagging or naming. It has hit all sorts of models. They do always have multiple files, and its usually only 1 or 2 that catch this bug out of a single bull edit update. I haven't seen it when doing 1 at a time by clicking organize files in the model screen. To clean this back up this what I generally have to do is re-create the path to the model, move the files back to the old path, scan library, then delete the duplicate entry that doesn't have the metadata from the original entry. Any other method of trying to clean this up seems to have me running in circles.

BRAYDIN72 avatar Oct 18 '24 12:10 BRAYDIN72

What I discovered on some models that failed to organize. In my cases it was always the case, that the name of the displayed picture was the same as the folder, f.e.: folder: .../scylla picture: scylla.jpg

I don't know if it's a strange coincidence, but it happend a handful times now.

Grecco-O avatar Jun 23 '25 00:06 Grecco-O

Ooh, that is interesting.

Floppy avatar Jun 23 '25 06:06 Floppy

I wanted to chime in with what I've discovered so far -

My current file path is Collection/Creator/Model-ModelID

I don't see a pattern with models with this problem, they range from different creators, and collections, internal folder structures are not consistent with each other, its seemingly random

When the organization fails I've had 2 things happen

  1. Nothing moves, and now I have an empty "model-123" folder
  2. Everything EXCEPT the datapackage moves.

I found a workaround for my situation

  1. Go into file structure and move everything back to original model folder (if applicable) then remove the new model-123 folder
  2. within Manyfold change the model's collection or creator press apply
  3. DO NOT PRESS ORGANIZE - I was doing this for awhile but realized it didn't matter.
  4. Within Manyfold, change the model's collection or creator back to what it should be and press apply
  5. now press organize

So far that has worked for me

Warrennoa avatar Jul 08 '25 17:07 Warrennoa