neonrust / epm

Command-line TV episode calendar/manager/scheduler/tracker (EPisode Manager)
MIT License
0 stars 0 forks source link

Store the series data in separate files #44

Closed neonrust closed 7 months ago

neonrust commented 7 months ago

Leaving the "meta" data in the current database file. That is, the database file merely contains entries that reference (by TMDb ID) the series it is regarding.

The series data are instead stored in separate files, e.g. in a directory series (have to rename the database file in that case).

This has a few benefit:

  1. Only the necessary series needs to be loaded, lazily. Some of the search properties might still need to be stored in the database, for search purposes, e.g. title.
  2. When refreshing a series, only that file needs to be written.
  3. Does not need to be backed up/versioned. Either they exist or don't (which is dictated by the main db file), and if they exist will always be the most recent version.
  4. Since they're "write once; read many", they could be compressed harder. Maybe even in parallel (if more than one is refreshed at the same time).

This replaces #42.

neonrust commented 7 months ago

As mentioned in point 1, some parts of the series needs to available in the main database, to avoid loading the data unnecessarily.

Some suggestions (apart from everything already stored in the epi:meta key):

Storing all the various properties needed for the matching algorithm is a bit too many (e.g. crew and cast).

Storing those above, means that an unseen listing will never need to load the external files (iirc).

neonrust commented 7 months ago

These "external" data files should be stored under ~/.cache (or $XDG_CACHE_HOME). Any missing (or corrupt) files should transparently be downloaded again.