Only trim file name if folder name is shorter

This commit is contained in:
crobibero 2020-11-22 14:17:42 -07:00
parent 3442dbbaf9
commit 2aefe9ed5a

View File

@ -226,8 +226,11 @@ namespace Emby.Naming.Video
{ {
testFilename = cleanName.ToString(); testFilename = cleanName.ToString();
} }
else if (folderName.Length <= testFilename.Length)
{
testFilename = testFilename.Substring(folderName.Length).Trim();
}
testFilename = testFilename.Substring(folderName.Length).Trim();
return string.IsNullOrEmpty(testFilename) return string.IsNullOrEmpty(testFilename)
|| testFilename[0].Equals('-') || testFilename[0].Equals('-')
|| testFilename[0].Equals('_') || testFilename[0].Equals('_')