manyfold icon indicating copy to clipboard operation
manyfold copied to clipboard

Model path template with / before {modelId} not auto populating metadata

Open gavinmcfall opened this issue 1 year ago • 9 comments

Tested on Version 0.81.0

Expected behavior: When scanning for new files. The application should interpret the folder structure and Automatically create new Creators/Collections etc based on the paths and then automatically assign those to the models

Actual Behavior: The models are imported with no collection or creator, the new creators and collections are not established

Images of my instance of Manyfold showing its configuration and the outcome of a new model that was scanned it image image image image image image image

gavinmcfall avatar Oct 08 '24 19:10 gavinmcfall

So, in this case, "Yanahri" should be the creator, and the collection should be "Genshin Impact"?

I'm not sure this is related, but try changing {modelName}/{modelId} to {modelName}{modelId} - the extra folder level there might be confusing things.

The code has tests which are passing, so it's working on some level, but perhaps you've hit an edge case somewhere. I'll keep digging into it.

Floppy avatar Oct 13 '24 21:10 Floppy

Ah! That is it! I've tested the situation with the folder separator between the name and ID, and it fails the tests! You can remove the / for an immediate fix and move on, or wait for me to include a proper fix.

Floppy avatar Oct 14 '24 13:10 Floppy

I'm not really sure how to resolve this; you've told it that the bottom-level folder is an ID, then a model name, then other stuff, and so it's failing the regexp match there. The ID is optional and is discarded, we just use it to throw away existing IDs when they're present on the file system; the problem is that the final / in the string isn't optional.

I've got this replicated in a test case now, but I'm not currently sure how to change things to get the right outcome for all situations.

I'd definitely recommend removing that last / for now; it might take me a while to redo the path parsing to handle the situation you've found here. I need to think on it. Maybe the parser should handle it, or maybe Manyfold should forbid IDs from being used that way in the template.

Floppy avatar Oct 14 '24 13:10 Floppy

I've also wondered if {modelId} should always be added, not be part of the template.

Floppy avatar Oct 14 '24 14:10 Floppy

I removed the / so its just {creator}/{collection}/{modelName}{modelId} and deleted the library and scanned again and it got inconsistent results image

You can see here that some are missing Creator and Collection whist others have it, its not even a case of not creating them, because I have a NieR Automata collection already, it just didnt assign it

gavinmcfall avatar Oct 14 '24 16:10 gavinmcfall

OK, that's an improvement at least; The problem is that if the regex doesn't match in some part of the path, it won't parse anything, hence you get all of it or nothing. Can you post some paths that didn't parse properly so I can test them against the regex and see what's going wrong?

Floppy avatar Oct 15 '24 08:10 Floppy

Actually I'm surprised you've got some there with collection but not creator. I would have expected all or nothing, as I said in the last comment. 🤔

Floppy avatar Oct 15 '24 08:10 Floppy

Thats what I would have assumed as well, I am not sure why its being inconsistent. Not sure if I am doing something wrong with my folders? I don't believe so

My Folder structure looks like this

Library
	3DModels
		Busts
		Diorama
		Chibi
			NomNom Figures
				Pokemon
					Pikachu
						pikachu.stl
						pikachu-presupported.zip
						pikachu01.jpeg
		Statue

In Manyfold I have the NAS mounted:

    persistence:
      media:
        type: nfs
        server: 10.90.1.69
        path: /mnt/storage0/media
        globalMounts:
          - path: /media

Then the Libaries are configured: /media/Library/3DModels/Chibi

So in this example {creator}/{collection}/{modelName}{modelId}

Chibi
	NomNom Figures {creator}
		Pokemon {collection}
			Pikachu {mopdelName}{modelId}
				pikachu.stl
				pikachu-presupported.zip
				pikachu01.jpeg

gavinmcfall avatar Oct 15 '24 18:10 gavinmcfall

That structure looks fine; can you post the specific paths of models that didn't fill the metadata properly? Like that "Chibi Ankha" model in your screenshot that only has a collection, no creator? Or "Chibi 2b & 9s"? It's possible that there are characters in there that I'm not letting through the regex check, or something.

Floppy avatar Oct 16 '24 10:10 Floppy

Hey, sorry for the delay, work has been nuts!

media\Library\3DModels\Chibi\EllaArt\NieR Automata\Chibi 2B & 9S

  • Missing Creator :x:
  • Missing Collection :x:

media\Library\3DModels\Chibi\NomNom Figures\Star Wars\Chibi Ahsoka Tano

  • Creator :x:
  • Collection :white_check_mark:

media\Library\3DModels\Chibi\Bulkamancer\Baldurs Gate 3\Chibi Astarion

  • Creator :white_check_mark:
  • Collection :white_check_mark:

Those are just 3 of the examples

gavinmcfall avatar Oct 21 '24 18:10 gavinmcfall