ShokoAnime / ShokoServer

Repository for Shoko Server.
http://shokoanime.com/shoko-server/
MIT License
390 stars 75 forks source link

API Discussion (Levels and Groups) #569

Closed da3dsoul closed 7 years ago

da3dsoul commented 7 years ago

@japanesemediamanager/api Okay. Currently, a directory from a filter with level 1 and nocast looks like this:

{
  "type": "filter",
  "url": "http://127.0.0.1:8111/api/filter?id=4551",
  "groups": [
    {
      "series": [

      ],
      "type": "group",
      "id": 7710,
      "name": "Sousei no Onmyouji",
      "titles": null,
      "summary": null,
      "added": "2016-12-14T18:54:43",
      "edited": "2016-12-14T18:54:43",
      "year": null,
      "air": null,
      "size": 42,
      "localsize": 0,
      "viewed": 0,
      "rating": "3.6",
      "userrating": null,
      "roles": null,
      "tags": [

      ],
      "art": {
        "banner": [
          {
            "url": "http://127.0.0.1:8111/api/image/4/1033",
            "index": 0
          }
        ],
        "fanart": [
          {
            "url": "http://127.0.0.1:8111/api/image/7/2523",
            "index": 0
          }
        ],
        "thumb": [
          {
            "url": "http://127.0.0.1:8111/api/thumb/1/11785/0.6667",
            "index": 0
          }
        ]
      }
    },
    {
      "series": [

      ],
      "type": "group",
      "id": 7864,
      "name": "Akiba`s Trip The Animation",
      "titles": null,
      "summary": null,
      "added": "2017-01-05T03:19:26",
      "edited": "2017-01-05T03:19:26",
      "year": null,
      "air": null,
      "size": 5,
      "localsize": 0,
      "viewed": 0,
      "rating": "3.4",
      "userrating": null,
      "roles": null,
      "tags": [

      ],
      "art": {
        "banner": [
          {
            "url": "http://127.0.0.1:8111/api/image/4/2185",
            "index": 0
          }
        ],
        "fanart": [
          {
            "url": "http://127.0.0.1:8111/api/image/7/13867",
            "index": 0
          }
        ],
        "thumb": [
          {
            "url": "http://127.0.0.1:8111/api/thumb/1/12411/0.6667",
            "index": 0
          }
        ]
      }
    },
    {
      "series": [

      ],
      "type": "group",
      "id": 7564,
      "name": "Kidou Senshi Gundam: Tekketsu no Orphans",
      "titles": null,
      "summary": null,
      "added": "2016-12-14T18:54:43",
      "edited": "2016-12-14T18:54:43",
      "year": null,
      "air": null,
      "size": 2,
      "localsize": 0,
      "viewed": 0,
      "rating": "7.3",
      "userrating": null,
      "roles": null,
      "tags": [

      ],
      "art": {
        "banner": [
          {
            "url": "http://127.0.0.1:8111/api/image/4/544",
            "index": 0
          }
        ],
        "fanart": [
          {
            "url": "http://127.0.0.1:8111/api/image/7/1358",
            "index": 0
          }
        ],
        "thumb": [
          {
            "url": "http://127.0.0.1:8111/api/thumb/1/11372/0.6667",
            "index": 0
          }
        ]
      }
    },
    {
      "series": [

      ],
      "type": "group",
      "id": 7869,
      "name": "Chain Chronicle: Haecceitas no Hikari",
      "titles": null,
      "summary": null,
      "added": "2017-01-10T03:48:46",
      "edited": "2017-01-10T03:48:46",
      "year": null,
      "air": null,
      "size": 4,
      "localsize": 0,
      "viewed": 0,
      "rating": "4.5",
      "userrating": null,
      "roles": null,
      "tags": [

      ],
      "art": {
        "banner": [
          {
            "url": "http://127.0.0.1:8111/api/image/4/3200",
            "index": 0
          }
        ],
        "fanart": [
          {
            "url": "http://127.0.0.1:8111/api/image/7/16006",
            "index": 0
          }
        ],
        "thumb": [
          {
            "url": "http://127.0.0.1:8111/api/thumb/1/10971/0.6667",
            "index": 0
          }
        ]
      }
    },
    {
      "series": [

      ],
      "type": "group",
      "id": 7823,
      "name": "Naruto",
      "titles": null,
      "summary": null,
      "added": "2016-12-14T18:54:43",
      "edited": "2016-12-14T18:54:43",
      "year": null,
      "air": null,
      "size": 2,
      "localsize": 0,
      "viewed": 0,
      "rating": "6.6",
      "userrating": null,
      "roles": null,
      "tags": [

      ],
      "art": {
        "banner": [
          {
            "url": "http://127.0.0.1:8111/api/image/4/1698",
            "index": 0
          }
        ],
        "fanart": [
          {
            "url": "http://127.0.0.1:8111/api/image/7/8509",
            "index": 0
          }
        ],
        "thumb": [
          {
            "url": "http://127.0.0.1:8111/api/thumb/1/239/0.6667",
            "index": 0
          }
        ]
      }
    },
    {
      "series": [

      ],
      "type": "group",
      "id": 7877,
      "name": "Kobayashi-san Chi no Maid Dragon",
      "titles": null,
      "summary": null,
      "added": "2017-01-11T17:53:51",
      "edited": "2017-01-11T17:53:51",
      "year": null,
      "air": null,
      "size": 4,
      "localsize": 0,
      "viewed": 0,
      "rating": "6.4",
      "userrating": null,
      "roles": null,
      "tags": [

      ],
      "art": {
        "banner": [
          {
            "url": "http://127.0.0.1:8111/api/image/4/3204",
            "index": 0
          }
        ],
        "fanart": [
          {
            "url": "http://127.0.0.1:8111/api/image/7/16043",
            "index": 0
          }
        ],
        "thumb": [
          {
            "url": "http://127.0.0.1:8111/api/thumb/1/12091/0.6667",
            "index": 0
          }
        ]
      }
    }
  ],
  "id": 4551,
  "name": "New Episodes",
  "titles": null,
  "summary": null,
  "added": "0001-01-01T00:00:00",
  "edited": "0001-01-01T00:00:00",
  "year": null,
  "air": null,
  "size": 6,
  "localsize": 0,
  "viewed": 0,
  "rating": null,
  "userrating": null,
  "roles": null,
  "tags": null,
  "art": {
    "banner": [
      {
        "url": "http://127.0.0.1:8111/api/image/4/544",
        "index": 0
      }
    ],
    "fanart": [
      {
        "url": "http://127.0.0.1:8111/api/image/7/1358",
        "index": 0
      }
    ],
    "thumb": [
      {
        "url": "http://127.0.0.1:8111/api/thumb/1/11372/0.6667",
        "index": 0
      }
    ]
  }
}
bigretromike commented 7 years ago

ad1. groups are the same as the one in shoko. You use it but still claim they are useless. Remember that you show is result for filter, which contains groups which contains series etc. (filter is the main root with exception of filters (all filter list) but in object concept filter is as root, and rawfile are the leafs. filter > group > serie > episode > rawfile. ad2. I understand but from client point of view he will have to first 'if' if the parameter exist, but sure - go for it ad3. groups are list of group, series are list of serie, filters are list of filter - that is the concept ad4. Level are intended to be the thing you wrote.

That's my 2cents in the manner.

also if you call /api/something you get as result object something as filter , group, serie and I didn't heard that groups are going to be replaced.

edit: also as you inherits from basedirectory the group it have a lot of nulls as they are as stated sub-filters and not series.

da3dsoul commented 7 years ago

I didn't say groups are useless, I said the info that is (not) populated is useless. It's missing almost everything. The response should be context sensitive. If you ask for a series, you should get just the series info