ribbons / RadioDownloader

An easy to use application for managing podcast subscriptions and downloads.
https://nerdoftheherd.com/tools/radiodld/
GNU General Public License v3.0
15 stars 11 forks source link

Fixed download failures on Windows with long generated episode filenames #239

Closed ribbons closed 4 years ago

ribbons commented 4 years ago

If an episode is assigned a path and filename longer than 260 characters, the download fails under Windows when attempting to move the file to the final destination with the following exception:

The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

System.IO.PathTooLongException
   at System.IO.Path.SafeSetStackPointerValue(Char* buffer, Int32 index, Char value)
   at System.IO.Path.NormalizePathFast(String path, Boolean fullCheck)
   at System.IO.Path.GetFullPathInternal(String path)
   at System.IO.File.Move(String sourceFileName, String destFileName)
   at PodcastProvider.PodcastProvider.DownloadProgramme(String progExtId, String episodeExtId, ProgrammeInfo progInfo, EpisodeInfo epInfo, String finalName) in C:\projects\radiodownloader\Providers\PodcastProvider\Classes\PodcastProvider.cs:line 443
   at RadioDld.DownloadHandler.DownloadProgThread() in C:\projects\radiodownloader\Classes\DownloadHandler.cs:line 221

This is most likely to be caused by a very long podcast episode name, but could also be hit using unusual episode name templates or a long root save folder path.