Open marcusfey opened 4 years ago
To be honest, yes, that's too geekish.
I already implemented parts of the new query "language" in the v2 branch: https://github.com/mediathekview/mediathekviewweb/tree/v2/common/search-string-parser (parsers/range.ts
, parsers/date.ts
).
For v2 I have following in mind:
datum:01.01.2020
datum:<01.01
(automatically use current year)datum:>=01-01-2020
datum:01.12.2019-15.01.2020
so the syntax would be datum:[<|>[=]]<day>[.<month>[.<year>]][-<day>[.<month>[.<year>]]]
.
Required regular expressions:
^(?:(>=|<=|<|>|=|)(?:([^-"<>=]+)|"(.+?)")|(?:([^-"<>=]+)|"(.+?)")-(?:([^-"<>=]+)|"(.+?)"))$
^(\d{1,2})[.-/]?(?:[.-/](\d{1,2})[.-/]?(?:[.-/](\d{2}|\d{4}))?)?$
Keep in mind that you would also have to adjust the query analyzer (or segmentizer, what I called it in v2) to allow the new syntax.
To be honest²: Neither do I want to introduce syntax which won't work in v2 anymore, nor do I want to backport v2 to v1. Instead you could help me implement stuff in v2 or give suggestions.
Ah, so this feature is going to get implemented, nice.
From what I see in v2 backporting this feature completely to v1 would really ... not be sensible.
I'll have a look at v2 - and try to get it up and running which took me some time for v1. Can't promise anything! To be honest I never fell in love with JS really.
When do you plan to release it? Anything in particular that needs attention?
I can help you to get it running, if you want. You basically need mongodb and elasticsearch (/docker/dev
-> docker-compose up
), npm ci
both in server and client, npm run build
followed by npm start
in server, and just npm start
in client -> http://localhost:4200. But be warned: The client is at it's beginnings, so there's not much to see yet.
I don't like plain JS either, but TypeScript configured strict is awesome!
I wanted to release it like 2 years ago. Then I stopped multiple times (for whatever reasons), and when I came back.. the code smelled (really) bad, because I learned extremely much in the last months and years, so I restarted multiple times. But now I'm in a state, where I could just swap modules instead of a complete rewrite, if I really want to.
It would be nice to be able to filter the broadcast date.
I'm currently about to finish this feature.
Would it be too geekish to have to enter the dates as
[23.12.2010,12.1.2020]
?Both from and to would be optional, spaces allowed, comma as separator.
That's the actual regex I would be using:
/\[\s*((\d{1,2})\.(\d{1,2})\.(\d{2,4})?)?\s*,\s*((\d{1,2})\.(\d{1,2})\.(\d{2,4}))?\s*/