mediathekview / mediathekviewweb

Eine Weboberfläche als Alternative zum Java-Client
https://mediathekviewweb.de/
GNU General Public License v3.0
887 stars 67 forks source link

API Enhancement Requests #194

Open MrFly72 opened 3 years ago

MrFly72 commented 3 years ago

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.

bagbag commented 3 years ago
  1. was always possible

https://gist.github.com/bagbag/a2888478d27de0e989cf777f81fb33de

MrFly72 commented 3 years ago

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"

bagbag commented 3 years ago

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"
    }
  ]
MrFly72 commented 3 years ago

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 commented 2 years ago

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 commented 2 years ago

@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

bagbag commented 2 years ago

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