Closed MBR-0001 closed 3 years ago
I know this is still a draft, but mind me asking if you have any particular need to rename the OpenSubtitlesHandler
instead of only updating the code within it to use the new OpenSubtitles REST API?
well I kinda just made the new REST handler and then deleted the old one, I didn't modify it, I could rename it if needed though
also, I've been working on login info validation
It works by doing a request to the API from inside the browser, is this a problem? (should it maybe be done on the server side?)
Hey @MBR-0001,
Thank you for your response! the validation looks slick, however if you could move it to the server instead of the web client that would be ideal. After all, its the server that needs to connect to opensubtitles.com
not the client in the end, so it should be validated that it can actually connect.
Regarding the naming, personally I am in favour of renaming it back to not include REST.
Other than that, thank you for your contribution so far and feel free to give me or the rest of the plugin team a shout if there is anything you are uncertain about or once you are done :wink:
@h1dden-da3m0n it looks like it is not possible to do config validation on the server, it can only respond with http response 204, I could make it just not save the config if the info is bad but then user wouldn't know about it
You could always add an endpoint to do the testing.
I've also made a pull request on your fork with some improvements in search and I removed some helped functions which weren't needed. I've tested it on my server with about ~200 movies and ~400 episodes and it works great, however the initial version you provided had some issues. See https://github.com/MBR-0001/jellyfin-plugin-opensubtitles/pull/3
wow I don't know how I didn't notice the PR, I'll check it out, thanks
In case you didn't know, marking a PR from Draft -> Ready for review doesn't notify us. So this doesn't get forgotten, please just ping me when it's ready for review!
@crobibero ready for review
I've tested it on my jellyfin instance and I get this error (and no subtitle):
[23:10:15] [ERR] Error downloading subtitles
System.Net.Http.HttpRequestException: Subtitle with Id 3711500 could not be downloaded: InternalServerError
at Jellyfin.Plugin.OpenSubtitles.OpenSubtitleDownloader.GetSubtitlesInternal(String id, CancellationToken cancellationToken) in /home/gabriel/git/jellyfin-plugin-opensubtitles/Jellyfin.Plugin.OpenSubtitles/OpenSubtitleDownloader.cs:line 264
at MediaBrowser.Providers.Subtitles.SubtitleManager.DownloadSubtitles(Video video, LibraryOptions libraryOptions, String subtitleId, CancellationToken cancellationToken)
at Jellyfin.Api.Controllers.SubtitleController.DownloadRemoteSubtitles(Guid itemId, String subtitleId)
InternalServerError
This means that OpenSubtitles returned a 500 - InternalServerError
, nothing we can do to fix it.
Weird, i can download the same subtitle from the website without any problem
This PR replaces the old XML API handler with a new one that uses the new OpenSubtitles REST API and also adds login info validation
Instructions for those who decide to use/test this:
Fixes #59, fixes #58, fixes #53, fixes #46, fixes #41, fixes #28, fixes #25, fixes #22, closes #24, closes #49