stash icon indicating copy to clipboard operation
stash copied to clipboard

[Bug Report] Metadata export fails for non-alphanumeric and duplicate object names

Open bayured opened this issue 1 year ago • 0 comments

Describe the bug Metadata export does not work correctly for any Movie/Group, Performer, Studio and Tag where the name has no alphanumeric characters. The other exports fall back to their filename/hash and are not effected.

On Windows, a ".json" file is created with the contents of the last exported object with no alphanumeric characters in the name. Sometimes the JSON produced is mangled: { "name": "测试", "created_at": "2024-07-01T14:31:02+03:00", "updated_at": "2024-07-01T14:35:50+03:00" }_at": "2024-07-01T14:36:25+03:00" }

On Linux, nothing is exported.

Additionally, if you have multiple of these objects with same name, e.g. multiple Movies with the name "Test", a single json "Test.json" is created with data from the last one exported.

To Reproduce Steps to reproduce the behavior:

  1. Create two or more Movies/Groups, Performers, Studios or Tags where the name has no alphanumeric characters, e.g. Chinese, Korean or Japanese like テスト or 시험
  2. In Tasks, run a Full Export in the Metadata section
  3. In the metadata folder configured, there is either no json file created for them or a single ".json" on Windows

Expected behavior Metadata from Full Export is complete and does not miss anything.

Stash Version: (from Settings -> About): v0.26.2-36-g70250c93

Desktop (please complete the following information):

  • OS: Windows 10/11/Linux

Additional context Happy to try fixing this if someone can suggest the best way for a Go novice - I think relaxing SanitiseBasename to allow non-alphanumeric would be the simplest but would still allow any objects where the name isn't unique to overwrite each other. Using the internal ID as part of the file name would be the surest I can think of to fix that.

bayured avatar Jul 01 '24 14:07 bayured