Config versions count only the columns each config saves

A Repo's fetch (head_sha, last_fetch), a Channel's refresh (video_count,
info_json), a Collection's counts, and a Download attempt (attempts, error)
counted as config changes, so the next import of that config saved instead of
importing: a hand edit to repos.yaml was overwritten after any fetch.  Each
model now registers only the columns its config saves.

domains.yaml saves its domains' Downloads, which now count for it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Roland 2026-10-24 14:49:30 -06:00
parent 74e9ca7799
commit d303cab06c
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
5 changed files with 77 additions and 9 deletions

View file

@ -1562,7 +1562,9 @@ class ReposConfig(ConfigFile):
repos_config = ReposConfig()
register_ownership(ReposConfig.file_name, Repository)
# Only the columns repos.yaml saves (not a fetch's commit, size, ...); its Collection saves the rest.
register_ownership(ReposConfig.file_name, Repository,
columns={'url', 'mode', 'branch', 'submodules', 'clone_token', 'collection_id'})
def get_repos_config() -> ReposConfig:

View file

@ -530,7 +530,10 @@ class ChannelsConfig(ConfigFile):
CHANNELS_CONFIG: ChannelsConfig = ChannelsConfig()
register_ownership(ChannelsConfig.file_name, Channel)
# Only the columns channels.yaml saves (not a refresh's counts, info_json, ...); its Collection saves the rest.
register_ownership(ChannelsConfig.file_name, Channel,
columns={'url', 'source_id', 'generate_posters', 'calculate_duration', 'download_missing_data',
'collection_id'})
TEST_CHANNELS_CONFIG: ChannelsConfig = None