Git Product home page Git Product logo

Comments (4)

macluxHD avatar macluxHD commented on July 16, 2024

Actually looking at the documentation again for this query, my previous statement saying that the whole list is returned with the proposed query is not true. The limit is just a lot bigger, it returns 500 entries per chunk. So to retrieve the whole list we would still need to go through these chunks, the updated query would then look like this:

query ($status: MediaListStatus, $userId: Int, $chunk: Int, $chunkSize: Int) {
  MediaListCollection(userId: $userId, status: $status, chunk: $chunk, perChunk: $chunkSize, type: ANIME) {
    hasNextChunk
    lists {
      entries {
        media {
          siteUrl
        }
        completedAt {
          day
          month
          year
        }
        progress
      }
    }
  }
}

We would then use hasNextChunk to check if we have fetched every chunk. While incrementing the chunk value like the current page value.

Although slower than previously thought it would still speed the process of retrieving the anime list up and result in less queries.

from jellyfin-ani-sync.

vosmiic avatar vosmiic commented on July 16, 2024

Great, thanks for investigating this. I'll make the change and see how I get on, I'll probably also increase the thread sleep time to 2 seconds since this is supposed to work in the background and it shouldn't matter how long it takes.

I'll also look into adding some re-attempt logic. If we get back a 429 we can attempt the call again after a certain amount of time.

from jellyfin-ani-sync.

vosmiic avatar vosmiic commented on July 16, 2024

I have created a PR for the fixes related to this, are you able to test it locally? I have tested it and all seems to be working fine but it always helps to get a second input.
The 429 handling isn't included in the PR because I didn't think it was directly related to this issue, but I am planning on working on it separately.

You can either build it using docker or simply build it manually by pulling it down. I can also build it for you and send a binary if it helps. Thanks.

from jellyfin-ani-sync.

vosmiic avatar vosmiic commented on July 16, 2024

That PR has been merged now, if you wanted to run the latest version of the plugin you will want to either build it yourself or docker can build it for you. These fixes will be included in the next version of the plugin but I'm not sure when that will be released, there are a few other changes I want to add before creating a new release.

from jellyfin-ani-sync.

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.