2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-22 07:11:52 +00:00

fix expofiles photos not appearing

This commit is contained in:
Philip Sargent 2024-07-20 16:22:07 +02:00
parent 78bc7323e9
commit c25a4b47de

View File

@ -233,17 +233,23 @@ def tidy_trip_cave(place):
def tidy_trip_image_urls(text, date): def tidy_trip_image_urls(text, date):
y = str(date)[:4] y = str(date)[:4]
text = text.replace(' src="', f' src="/years/{y}/') text = text.replace(' src="', f' src="/years/{y}/')
text = text.replace(" src='", f" src='/years/{y}/") text = text.replace(" src='", f" src='/years/{y}/")
text = text.replace(f' src="/years/{y}//years/{y}/', f' src="/years/{y}/') text = text.replace(f' src="/years/{y}//years/{y}/', f' src="/years/{y}/')
text = text.replace(f" src='/years/{y}//years/{y}/", f" src='/years/{y}/") text = text.replace(f" src='/years/{y}//years/{y}/", f" src='/years/{y}/")
text = text.replace(f' src="/years/{y}/expofiles/', f' src="/expofiles/') text = text.replace(f' src="/years/{y}//expofiles/', f' src="/expofiles/')
text = text.replace(f" src='/years/{y}/expofiles/", f" src='/expofiles/") text = text.replace(f" src='/years/{y}//expofiles/", f" src='/expofiles/")
text = text.replace("\t", "") text = text.replace("\t", "")
text = text.replace("\n\n\n", "\n\n") text = text.replace("\n\n\n", "\n\n")
lines = text.splitlines()
for line in lines:
if "expofiles" in line:
print(f"tidy_trip_image_urls() - {y}\n {line}")
return text return text
def tidy_tid(tid, title): def tidy_tid(tid, title):