This commit is contained in:
parent
7b04de665c
commit
07587f2c90
1 changed files with 9 additions and 3 deletions
12
main.py
12
main.py
|
@ -81,6 +81,14 @@ class PodcastGenerator:
|
|||
|
||||
log.debug("Adding episode %s to feed", str(file.name))
|
||||
|
||||
try:
|
||||
file_date = file.stat().st_birthtime
|
||||
except AttributeError:
|
||||
try:
|
||||
file_date = file.stat().st_ctime
|
||||
except AttributeError:
|
||||
file_date = datetime.now().timestamp()
|
||||
|
||||
episode = Episode(
|
||||
title=file.stem,
|
||||
media=Media(
|
||||
|
@ -90,9 +98,7 @@ class PodcastGenerator:
|
|||
),
|
||||
file.stat().st_size,
|
||||
),
|
||||
publication_date=datetime.fromtimestamp(
|
||||
file.stat().st_birthtime, timezone.utc
|
||||
),
|
||||
publication_date=datetime.fromtimestamp(file_date, timezone.utc),
|
||||
)
|
||||
|
||||
description_filename = (
|
||||
|
|
Loading…
Reference in a new issue