zeh/ffmpeg.app

Refactor command parsing

zeh opened this issue · 1 comments

zeh commented

Parsing of commands via CommandInput is a bit all over the place. We parse the data, but keep the command internally as a static piece of text. We have several different points around the code where we use that string and transform that into a proper command input model, so it can be processed for e.g. rendering.

We use some caching to memoize the parsing, but it shouldn't be necessary.

Instead, we should eagerly parse commands into the expected model, and reuse that. This way it's easier to process it.

We might still want to keep some sort of checksum around so we can reference them by an id (or use the slug by enforcing uniqueness?).

This will likely make it easier for us to move on to more complex fields, such as using classes for input types.

Requirements

  • Refactor CommandInput so it contains the final command model, with no need for re-parsing
  • Drop all uses of the command text, keeping business logic inside CommandInput
zeh commented

Implemented in 0e21c11.