Fix bug with long folder templates
This commit is contained in:
parent
452ceef285
commit
fca946bf15
@ -103,7 +103,7 @@ namespace LibationAvalonia.Dialogs
|
|||||||
get => _userTemplateText;
|
get => _userTemplateText;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_userTemplateText = value;
|
this.RaiseAndSetIfChanged(ref _userTemplateText, value);
|
||||||
templateTb_TextChanged();
|
templateTb_TextChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -165,7 +165,13 @@ namespace LibationAvalonia.Dialogs
|
|||||||
var books = config.Books;
|
var books = config.Books;
|
||||||
var folder = Templates.Folder.GetPortionFilename(
|
var folder = Templates.Folder.GetPortionFilename(
|
||||||
libraryBookDto,
|
libraryBookDto,
|
||||||
isFolder ? workingTemplateText : config.FolderTemplate);
|
//Path must be rooted for windows to allow long file paths. This is
|
||||||
|
//only necessary for folder templates because they may contain several
|
||||||
|
//subdirectories. Without rooting, we won't be allowed to create a
|
||||||
|
//relative path longer than MAX_PATH
|
||||||
|
Path.Combine(books, isFolder ? workingTemplateText : config.FolderTemplate));
|
||||||
|
|
||||||
|
folder = Path.GetRelativePath(books, folder);
|
||||||
|
|
||||||
var file
|
var file
|
||||||
= Template == Templates.ChapterFile
|
= Template == Templates.ChapterFile
|
||||||
|
|||||||
@ -98,11 +98,17 @@ namespace LibationWinForms.Dialogs
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var books = config.Books;
|
var books = config.Books;
|
||||||
var folder = Templates.Folder.GetPortionFilename(
|
var folder = Templates.Folder.GetPortionFilename(
|
||||||
libraryBookDto,
|
libraryBookDto,
|
||||||
isFolder ? workingTemplateText : config.FolderTemplate);
|
//Path must be rooted for windows to allow long file paths. This is
|
||||||
|
//only necessary for folder templates because they may contain several
|
||||||
|
//subdirectories. Without rooting, we won't be allowed to create a
|
||||||
|
//relative path longer than MAX_PATH
|
||||||
|
Path.Combine(books, isFolder ? workingTemplateText : config.FolderTemplate));
|
||||||
|
|
||||||
|
folder = Path.GetRelativePath(books, folder);
|
||||||
|
|
||||||
var file
|
var file
|
||||||
= template == Templates.ChapterFile
|
= template == Templates.ChapterFile
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user