That is good start
In (big-)data area the idea of data versioning is flying around for decades.
As a current consensus for now is to treat information about your files, which is effectively a data, as a metadata.
Said this while trying to create your own solution is always good, maybe you could look at another solutions, like Apache Iceberg (free and open source).
In particular they have concept of Catalog
While from documentation it may look like to adopt Iceberg you need a lot of other moving part, in reality you can start from docker compose [2] and then manage your data using plain old sql syntax.
It may look lake overkill for your specific needs, still good source to steal some ideas.
P.S. there are plenty of such systems in various form-factor
[1] https://iceberg.apache.org/
[2] https://iceberg.apache.org/spark-quickstart/