Add rough design document

This commit is contained in:
Reinout Meliesie 2025-03-14 17:54:14 +01:00
commit 43688aa8ed
Signed by: zedfrigg
GPG key ID: 3AFCC06481308BC6

37
documentation/design.md Normal file
View file

@ -0,0 +1,37 @@
# Design
- There will be two SQLite databases that complement each other.
- `$XDG_DATA_HOME/zoodex/shared.sqlite` will be downloaded over HTTP from `kernelmaft.com` and contain information about the films and series themselves, their bittorrent magnet links, and what files and tracks within each torrent to use.
- `$XDG_DATA_HOME/zoodex/local.sqlite` will be created locally and contain information about what films and series the user has watched.
This can be extended to allow the user to create a personal collection, i.e. a subset of all media available of their own choosing.
- Posters and additional subtitles will be distributed in torrents provided and seeded by Zoödex.
There will be one torrent with all posters and one with all subtitles at a given time.
A new torrent will be made when this data is changed or expanded with new entries.
The bittorrent magnet links for the latest versions will be provided in the shared database.
- Some way to recognise which poster and subtitles files do not need to be redownloaded will need to be devised.
- The poster data will be stored with the following schema: `$XDG_DATA_HOME/zoodex/posters/<uuid>`.
The UUID here can be either a film UUID or a series UUID.
- A piece of media is identified fully by its media UUID, which refers to either a film UUID or an episode UUID.
- An additional subtitle file for a piece of media will only be provided if none of the ones in the media torrent were deemed acceptable.
- The additional subtitle data will be stored with the following schema: `$XDG_DATA_HOME/zoodex/subtitles/<uuid>`.
The UUID here can be either a film UUID or an episode UUID.
- The file that will be played for a piece of media is `$XDG_DATA_HOME/zoodex/media/<bittorrent-hash>/<file-path>`.
The bittorrent hash here is provided by `sources.bittorrent_hash` in the shared database.
The file path here is provided by `sources.file_path` in the shared database.
- The video track that will be played for a piece of media will be within this file, but otherwise determined by LibMPV.
- The audio track that will be played for a piece of media will be within this file, and its track number is given by `sources.audio_track` in the shared database.
- The subtitle track that will be played for a piece of media can be within this file, or if present an additional subtitle file.
Its track number is given by `sources.subtitle_track` in the shared database.
We rely on the assumption that when we provide LibMPV with a file and an additional subtitle file, all the combined subtitle tracks will always have the same track numbers.