Giter Club home page Giter Club logo

Comments (3)

null-dev avatar null-dev commented on June 8, 2024

The v3 endpoint should be fixed now.

I think the reason v2 was behaving strangely for you is because all of the v2 endpoints actually expect batch operations. E.g. take a look at the API response produced in your example above when you this this endpoint: http://localhost:4567/api/v2/categories/4/name. Notice how the data field in the response is actually an array. This is because you can actually query for the names of multiple categories at the same time by doing something like this: GET http://localhost:4567/api/v2/categories/4,5/name.

This is actually the whole reason I started to move away from v2. The every endpoint supports batch operations was cool but had several critical flaws:

  • Most calls to the API only ever touch one object. So even though every endpoint had batch support, it was very rarely used.
  • Implementing an API where every endpoint must support batch operations is really hard and messy.
  • The server must talk to the Tachiyomi code which usually doesn't support batch operations (even though the database does). The server architecture looks like this: TachiWeb <---> Tachiyomi <---> Database. So what often happened was when the server received a batch operation, it would actually just perform the operations one-by-one instead. You might think this wouldn't be a problem but performing hundreds of database queries instead of one big query is actually really, really slow and ended up killing performance.

So yeah, that's why I dropped v2 lol.

from tachiweb-server.

Ligerx avatar Ligerx commented on June 8, 2024

@null-dev
Would it be possible to add an API call or enhance the existing list all categories API?
It would be nice to get a list of mangaIds that aren't in any category (default) instead of manually figuring it out the front end.

from tachiweb-server.

null-dev avatar null-dev commented on June 8, 2024

@Ligerx Sure, I'll make /api/v3/categories (getCategories) return all the categories + a dummy category that:

  • has an ID of -1
  • has an order of -1 (the "default" category should always be displayed prior to all other categories)
  • has a name of Default
  • contains all the manga that are not in categories

Note that the "default" category will be just a dummy category. It doesn't actually exist so you won't be able to reorder/rename it using the API.

from tachiweb-server.

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.