core/stats: enable processing input files, report first and last filename
can be useful for quick investigation/testing setup
This commit is contained in:
parent
150d48c80c
commit
3a736f45b9
2 changed files with 26 additions and 20 deletions
|
@ -474,15 +474,19 @@ def _stat_iterable(it: Iterable[C], quick: bool = False) -> Any:
|
|||
if errors > 0:
|
||||
res['errors'] = errors
|
||||
|
||||
if first_item is not None:
|
||||
dt = guess_datetime(first_item)
|
||||
if dt is not None:
|
||||
res['first'] = dt
|
||||
def stat_item(item):
|
||||
if item is None:
|
||||
return None
|
||||
if isinstance(item, Path):
|
||||
return str(item)
|
||||
return guess_datetime(item)
|
||||
|
||||
if (stat_first := stat_item(first_item)) is not None:
|
||||
res['first'] = stat_first
|
||||
|
||||
if (stat_last := stat_item(last_item)) is not None:
|
||||
res['last'] = stat_last
|
||||
|
||||
if last_item is not None:
|
||||
dt = guess_datetime(last_item)
|
||||
if dt is not None:
|
||||
res['last'] = dt
|
||||
return res
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue