jellyfin / jellyfin-plugin-opensubtitles

https://jellyfin.org
GNU General Public License v3.0
121 stars 26 forks source link

Log path on IOException for media hashing #49

Closed Nothing4You closed 3 years ago

Nothing4You commented 3 years ago

Describe the isue Sometimes the plugin attempts to hash movies and fails due to IO errors. It would be great if the path for these failures could be logged for further investigation.

System:

To Reproduce

  1. Have a media item referencing a path which results in in an IO error when accessed
  2. Run the Download missing subtitles task

Expected behavior Log should contain the path that was attempted to be accessed.

Logs

[2021-04-24 19:52:45.984 +00:00] [ERR] [80] MediaBrowser.Providers.Subtitles.SubtitleManager: Error downloading subtitles from "Open Subtitles"
System.IO.IOException: Input/output error
   at System.IO.FileStream.CheckFileCall(Int64 result, Boolean ignoreNotSupported)
   at System.IO.FileStream.ReadNative(Span`1 buffer)
   at System.IO.FileStream.ReadSpan(Span`1 destination)
   at System.IO.FileStream.Read(Byte[] array, Int32 offset, Int32 count)
   at OpenSubtitlesHandler.MovieHasher.ComputeMovieHash(Stream input)
   at OpenSubtitlesHandler.Utilities.ComputeHash(Stream stream)
   at Jellyfin.Plugin.OpenSubtitles.OpenSubtitleDownloader.Search(SubtitleSearchRequest request, CancellationToken cancellationToken)
   at MediaBrowser.Providers.Subtitles.SubtitleManager.SearchSubtitles(SubtitleSearchRequest request, CancellationToken cancellationToken)