Skip to content

Get a single tankoubon API endpoint return wrong total value #1155

Closed

Description

@junpet

LRR Version and OS
LANraragi 0.9.3 - Law (Earthlings on Fire)
Debian GNU/Linux bookworm 12.8 x86_64
Docker version 27.4.1, build b9d17ea

Bug Details
Get a single tankoubon API endpoint (GET http://lrr.tvc-16.science/api/tankoubons/:id) returns wrong total value. It always returns 2 more for total. For example a tankoubon without any archive:

{
  "filtered": 0,
  "result": {
    "archives": [],
    "full_data": [],
    "id": "TANK_1735970910",
    "name": "test",
    "summary": "",
    "tags": ""
  },
  "total": 2
}

but it should be

{
  "filtered": 0,
  "result": {
    "archives": [],
    "full_data": [],
    "id": "TANK_1735970910",
    "name": "test",
    "summary": "",
    "tags": ""
  },
  "total": 0
}

Another example a tankoubon with 1 archive:

{
  "filtered": 1,
  "result": {
    "archives": [
      "a1103063870b4fe1a0490ecb33baf29b3d8ae10b"
    ],
    "full_data": [
      {
        "arcid": "a1103063870b4fe1a0490ecb33baf29b3d8ae10b",
        "extension": "rar",
        "filename": "Berserk - Prototype [Evil_Genius]",
        "isnew": "true",
        "lastreadtime": 0,
        "pagecount": 47,
        "progress": 0,
        "size": 8979261,
        "summary": "",
        "tags": "date_added:1725717069",
        "title": "Berserk - Prototype [Evil_Genius]"
      }
    ],
    "id": "TANK_1735998934",
    "name": "test2",
    "summary": "",
    "tags": ""
  },
  "total": 3
}

but it should be

{
  "filtered": 1,
  "result": {
    "archives": [
      "a1103063870b4fe1a0490ecb33baf29b3d8ae10b"
    ],
    "full_data": [
      {
        "arcid": "a1103063870b4fe1a0490ecb33baf29b3d8ae10b",
        "extension": "rar",
        "filename": "Berserk - Prototype [Evil_Genius]",
        "isnew": "true",
        "lastreadtime": 0,
        "pagecount": 47,
        "progress": 0,
        "size": 8979261,
        "summary": "",
        "tags": "date_added:1725717069",
        "title": "Berserk - Prototype [Evil_Genius]"
      }
    ],
    "id": "TANK_1735998934",
    "name": "test2",
    "summary": "",
    "tags": ""
  },
  "total": 1
}

Activity

  1. EfronC commented on Jan 6, 2025

    @EfronC
    Contributor

    There is an error in the count, yes, apparently the way I count the number of files got affected by the extra fields, will rework that part.

  2. added a commit that references this issue on Jan 6, 2025
    ec57312
  3. junpet commented on Jan 7, 2025

    @junpet
    Author

    Sorry for the late answer. Depending on this answer, the filtered does not work properly either, because it reports the number of archives on the given page, and total reports the total number of archives associated with the tankoubon. Or the filtered and total have different meanings here? It would be nice, if these meanings would be consistent across the API calls, or documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions