zipstream-ng icon indicating copy to clipboard operation
zipstream-ng copied to clipboard

Set the timestamp for each file when adding data from a stream

Open josteinl opened this issue 4 months ago • 1 comments

Thank you for a very nice package.

I am missing the ability to set the last modified timestamp for each file when adding them from a stream.

I tried this, but the zs.add() does not take a date_time parameter:

zs.add(
    data=file_data,
    arcname=file_name,
    date_time=file.updated_at.timetuple()
    if file.updated_at and file.updated_at.year >= 1980
    else datetime.now().timetuple(),
)

Maybe it's possible to do it in another way, but I did not find it.

josteinl avatar Aug 27 '25 08:08 josteinl

Yes, currently the only way to add a datetime is for you to add a file and have it automatically pull the datetime from the file metadata itself.

I've been working on a bit of a refactor of how data is queued up for streaming that would enable this on the refactor/queue branch but it's not done yet.

pR0Ps avatar Aug 28 '25 12:08 pR0Ps