summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gemfeed.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/gemfeed.py b/gemfeed.py
index dcdd7a8..1ad320d 100644
--- a/gemfeed.py
+++ b/gemfeed.py
@@ -109,14 +109,12 @@ def main():
# Add one entry per .gmi file
files = find_files(args.n)
- latest_update = datetime.datetime.fromtimestamp(0, tz=datetime.timezone.utc)
- for filename in files:
+ for n, filename in enumerate(files):
entry = feed.add_entry()
populate_entry_from_file(filename, args.base_url, entry)
print("Adding {} with title '{}'...".format(filename, entry.title()))
- if entry.updated() > latest_update:
- latest_update = entry.updated()
- feed.updated(latest_update)
+ if n == 0:
+ feed.updated(entry.updated())
# Write file
feed.atom_file(args.output, pretty=True)