GithubHelp home page GithubHelp logo

Comments (8)

crobibero avatar crobibero commented on August 17, 2024

As of right now I don’t believe the server has any way to handle this

from jellyfin-plugin-opensubtitles.

opensubtitles avatar opensubtitles commented on August 17, 2024

we are sending in reset time in /login and will be also later in /download - so you know what is cooldown time until downloader counter is reset

from jellyfin-plugin-opensubtitles.

MBR-0001 avatar MBR-0001 commented on August 17, 2024

The plugin already uses that to keep track of limits, the issue is that the jellyfin server (which tells the plugin to download subtitles) can't handle that so it attempts to download even after the quota is used up (but the plugin just throws an error)

It currently gets the reset time from /infos/user and /download (from the "Your quota will be renewed in 20 hours and 52 minutes (2021-08-24 12:02:10 UTC) " string, don't know if you remember but I asked if that could be added a couple of months ago πŸ˜†)
It would certainly be nice to have a reset_time_utc in /download since the current implementation isn't very "nice"

from jellyfin-plugin-opensubtitles.

develroo avatar develroo commented on August 17, 2024

I am somewhat confused about the server not having some sort of signalling that can tell it a plugin has crashed or got stuck in a loop? That seems positively weird to me.

If there is some sort of signalling from the plugins to the server, even a keep alive signal, then it should be trivial either for the plugin to send "Terminate now" or the server to say "Have not heard for X plugin for 5 minutes terminate it"

So which is it? Is this really so hard to do ?

from jellyfin-plugin-opensubtitles.

MBR-0001 avatar MBR-0001 commented on August 17, 2024

There's no signalling really, when the "download missing subtitles" task is ran the server goes through all libraries and for each episode/movie that is missing a subtitle "tells" the plugin to download it, it doesn't really care if the plugin succeeded or failed, it just keeps going

This can be changed but the server code is quite complex, I should be able to look into it once .NET 6 is fully released

from jellyfin-plugin-opensubtitles.

develroo avatar develroo commented on August 17, 2024

Well is is planned in the new factoring? For sure as a programmer and sysadmin the idea of a plugin addon crashing or getting into an infinite loop is a serious oversight and it would be pragmatic and practical to not let plugins gobble up resource (or spam the log).

Let me know if this is a thing because atm the logs are a mess when you have thousands of titles timing out.

from jellyfin-plugin-opensubtitles.

oddstr13 avatar oddstr13 commented on August 17, 2024

Well is is planned in the new factoring? For sure as a programmer and sysadmin the idea of a plugin addon crashing or getting into an infinite loop is a serious oversight and it would be pragmatic and practical to not let plugins gobble up resource (or spam the log).

Let me know if this is a thing because atm the logs are a mess when you have thousands of titles timing out.

function download_missing_subtitles_task()
  for movie in library do
    if movie.missing_subtitles then
      -- Prints an error to the log if we can't download the subs right now
      opensubtitles.try_download_subtitle(movie)
    end
  end
end

No crashes nor infinite loops, just a scary [ERR] in the logs cause we can't right now.
One per attempted and failed subtitle download.

Nothing serious, just noisy in the logs.


That aside, would blocking in the opensubtitles plugin until we get a refill be feasible? I'm assuming it runs in it's own async land, and won't actually block anything else by doing this (worst case blocks other subtitle providers?).

from jellyfin-plugin-opensubtitles.

MBR-0001 avatar MBR-0001 commented on August 17, 2024

Well is is planned in the new factoring?

I don't know really, there isn't a public "to-do" list since jellyfin is an open source project and everyone contributes as much as they can, I personally hope I get it done before 10.8 is released (if nobody else does)

That aside, would blocking in the opensubtitles plugin until we get a refill be feasible? I'm assuming it runs in it's own async land, and won't actually block anything else by doing this (worst case blocks other subtitle providers?).

That's an interesting solution, it can be done that way I guess, I originally wanted to somehow add a way for a provider to let the core know subtitles can't be downloaded right now (so it cancels the automated task if there aren't any other providers? That sounds complicated now when I think about it)

from jellyfin-plugin-opensubtitles.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.