The Mopidy v4.0 development versions have removed the `mopidy.models.serialize` module, which causes a `ModuleNotFoundError` in Iris on startup.
This commit introduces a check to detect the Mopidy version. It conditionally uses the new Pydantic `.model_dump()` method for serialization on v4 while falling back to the legacy `ModelJSONEncoder` for older versions. This makes Iris compatible with both Mopidy v3 and the new v4 pre-releases.