refactor: store file in position, rename filename to file_name

Signed-off-by: Konstantin Fickel <mail@konstantinfickel.de>
This commit is contained in:
Konstantin Fickel 2026-01-31 17:21:55 +01:00
parent d5b1541436
commit 79095bad4a
Signed by: kfickel
GPG key ID: A793722F9933C1A5
8 changed files with 27 additions and 24 deletions

View file

@ -51,12 +51,14 @@ def localize_shard(
def localize_stream_file(
stream_file: StreamFile, config: RepositoryConfiguration
) -> LocalizedShard | None:
shard_date = extract_datetime_from_file_name(stream_file.filename)
shard_date = extract_datetime_from_file_name(stream_file.file_name)
if not shard_date or not stream_file.shard:
raise ValueError("Could not extract date")
return localize_shard(stream_file.shard, config, {}, shard_date)
return localize_shard(
stream_file.shard, config, {"file": stream_file.file_name}, shard_date
)
__all__ = ["localize_stream_file"]