mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
#1189 - Auto-Organize: Fix PathTooLongException due to long EpisodeTitle
This commit is contained in:
parent
1cf65f1a2e
commit
5637142100
@ -439,6 +439,17 @@ namespace MediaBrowser.Server.Implementations.FileOrganization
|
|||||||
|
|
||||||
newPath = Path.Combine(newPath, episodeFileName);
|
newPath = Path.Combine(newPath, episodeFileName);
|
||||||
|
|
||||||
|
// Try to account for windows limitations by removing the episode title
|
||||||
|
if (newPath.Length > 255)
|
||||||
|
{
|
||||||
|
var extension = Path.GetExtension(episodeFileName);
|
||||||
|
var fileName = Path.GetFileNameWithoutExtension(episodeFileName);
|
||||||
|
fileName = fileName.Replace(episode.Name, string.Empty, StringComparison.OrdinalIgnoreCase);
|
||||||
|
episodeFileName = Path.ChangeExtension(fileName, extension);
|
||||||
|
|
||||||
|
newPath = Path.Combine(newPath, episodeFileName);
|
||||||
|
}
|
||||||
|
|
||||||
return newPath;
|
return newPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user