mediathekviewweb icon indicating copy to clipboard operation
mediathekviewweb copied to clipboard

API Enhancement Requests

Open MrFly72 opened this issue 3 years ago • 7 comments

Hi,

the rest API is really cool! Thank you for that. During my development of a script in powershell, I figured thatsome additional API Functions would be great:

  1. Query possibility to exclude specific entries: doing this currently with powershell to omit the entries with audiodescriptions. Would help to be able to filter the output of the rest-api already instead of filtering the full output
  2. Filter the output by date to have an approach like: give me all entries since my last request. Could be filtered either by "timestamp' of the sending date or by the filmliste-date
  3. Multiple title/topic in one query: could enhance to find airings that are of same kind.
  4. Filter by Length of the title like it can be done in th web-edition.

anyhow my powershell script makes heavy usage of the API and works great. It reads the entries from the Mediathek, has some configuration settings around it (eg. Destination folder, rename scheme and autorename options). It will present the user with a currently very simple output screen (out-gridview with passthru) and will then start the downloads on the Synology, wait for the jobs to finish and then rename them to the pattern given (something like [date][topic][title].mp4 or similar, depends on the airing.

MrFly72 avatar Dec 27 '20 08:12 MrFly72

I believe #3 was not clearly stated. What I mean is eg: Title=Ein Fall für zwei Title=Der Staatsanwalt Title=Die Chefin

All in one query. I believe that currently the two query you mean in the request do extend each other and will be combined with "and". I was thinking about an "or"

MrFly72 avatar Feb 23 '21 20:02 MrFly72

It's an AND for different fields, but an or for different fields.

following will work (here is an working example: https://s3.mediathekviewweb.de/public/or-query.html)

[
    {
      "fields": [
        "title"
      ],
      "query": "Ein Fall für zwei"
    },
    {
      "fields": [
        "title"
      ],
      "query": "Der Staatsanwalt"
    },
    {
      "fields": [
        "title"
      ],
      "query": "Die Chefin"
    }
  ]

bagbag avatar Feb 24 '21 09:02 bagbag

Ok, but I think I was looking more for a way to submit more than one full query (my example was maybe misleading). So basically an array of full queries, which can contain any combination of title, topic, channel and which will then be merged into one output. As said, I am fine at the moment, I am doing a couple of queries after each other and join them myself in powershell.

MrFly72 avatar Feb 28 '21 17:02 MrFly72

It's an AND for different fields, but an or for different fields.

following will work (here is an working example: https://s3.mediathekviewweb.de/public/or-query.html)

One question, is there a main page for these documentations about the api? I was sending my requests so far without making fields an array. so basically only sometimes sending fields : "topic" and a query. The example above only works if fields is an array. single "topic" does not work. So i wonder, does the API always expect an array and I should cast a single value to an array for all entries?

MrFly72 avatar Nov 27 '21 18:11 MrFly72

@bagbag Any chance for an additional query option like date_from? Would be great to limit by date, as currently I can only download xx entries, then check for date and only use the ones inside the date range. Would be best To filter it in the request directly

MrFly72 avatar Nov 28 '21 18:11 MrFly72

@MrFly72 yes, it wants an array. You can create a Pull request for a date filter if you want.

bagbag avatar Dec 07 '21 21:12 bagbag