mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 08:26:00 +01:00
Fix export zip paths when exporting from Windows (#3022)
* Use correct zip path for export in windows * Fix recursive loop when importing tag hierarchy
This commit is contained in:
parent
7104bb67ca
commit
3acece2438
3 changed files with 6 additions and 3 deletions
|
|
@ -79,7 +79,7 @@ func performImport(ctx context.Context, i importer, duplicateBehaviour ImportDup
|
||||||
if duplicateBehaviour == ImportDuplicateEnumFail {
|
if duplicateBehaviour == ImportDuplicateEnumFail {
|
||||||
return fmt.Errorf("existing object with name '%s'", name)
|
return fmt.Errorf("existing object with name '%s'", name)
|
||||||
} else if duplicateBehaviour == ImportDuplicateEnumIgnore {
|
} else if duplicateBehaviour == ImportDuplicateEnumIgnore {
|
||||||
logger.Info("Skipping existing object")
|
logger.Infof("Skipping existing object %q", name)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -261,7 +261,10 @@ func (t *ExportTask) zipWalkFunc(outDir string, z *zip.Writer) filepath.WalkFunc
|
||||||
func (t *ExportTask) zipFile(fn, outDir string, z *zip.Writer) error {
|
func (t *ExportTask) zipFile(fn, outDir string, z *zip.Writer) error {
|
||||||
bn := filepath.Base(fn)
|
bn := filepath.Base(fn)
|
||||||
|
|
||||||
f, err := z.Create(filepath.Join(outDir, bn))
|
p := filepath.Join(outDir, bn)
|
||||||
|
p = filepath.ToSlash(p)
|
||||||
|
|
||||||
|
f, err := z.Create(p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error creating zip entry for %s: %s", fn, err.Error())
|
return fmt.Errorf("error creating zip entry for %s: %s", fn, err.Error())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -581,7 +581,7 @@ func (t *ImportTask) ImportTag(ctx context.Context, tagJSON *jsonschema.Tag, pen
|
||||||
if err := t.ImportTag(ctx, childTagJSON, pendingParent, fail, readerWriter); err != nil {
|
if err := t.ImportTag(ctx, childTagJSON, pendingParent, fail, readerWriter); err != nil {
|
||||||
var parentError tag.ParentTagNotExistError
|
var parentError tag.ParentTagNotExistError
|
||||||
if errors.As(err, &parentError) {
|
if errors.As(err, &parentError) {
|
||||||
pendingParent[parentError.MissingParent()] = append(pendingParent[parentError.MissingParent()], tagJSON)
|
pendingParent[parentError.MissingParent()] = append(pendingParent[parentError.MissingParent()], childTagJSON)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue