mirror of
https://github.com/tomasriveral/ReSSPublica.git
synced 2026-08-11 18:28:38 +02:00
fix: inconsistent ids
This commit is contained in:
@@ -138,7 +138,7 @@ def generateBernAsianHornetFeed(ASSETS, CACHE):
|
||||
for start, end in weeklyRangesFrom(arbitraryStartDate): # arbitrary start date
|
||||
weeklyEntry = {}
|
||||
|
||||
weeklyEntry["id"] = datetime.combine(start, time(12, 0)).timestamp() # we use epoch time as the id
|
||||
weeklyEntry["id"] = f"asian-hornets-bern-{start.isoformat()}-{end.isoformat()}" # we use epoch time as the id EDIT: NO THIS BROKE MULTIPLE TIMES MAKING SOME ID CHANGES. WE CHANGE THAT
|
||||
weeklyEntry["creationDate"] = end.isoformat()
|
||||
weeklyEntry["date"] = end.isoformat() # there is no point of updating it later, as (I think) data isn't retroactively put
|
||||
weeklyEntry["source"] = "opendata.swiss"
|
||||
|
||||
@@ -271,7 +271,7 @@ def generateBernReligionMap(ASSETS, CACHE):
|
||||
}
|
||||
for start, end in trimesterRangesFrom(arbitraryStartDate):
|
||||
trimestrialEntry = {}
|
||||
trimestrialEntry["id"] = datetime.combine(start, time(12, 0)).timestamp() # we use timestamp as ids
|
||||
trimestrialEntry["id"] = f"religion-map-bern-{start.isoformat()}-{end.isoformat()}" # timestamps from epoch are unreliable
|
||||
trimestrialEntry["creationDate"] = start.isoformat()
|
||||
trimestrialEntry["date"] = start.isoformat() # there is no point have them different. On other feeds it's used for update date
|
||||
trimestrialEntry["source"] = "opendata.swiss"
|
||||
|
||||
Reference in New Issue
Block a user