From e65c3ec74865e377c215dacf142864fa7f36cec3 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Wed, 9 Dec 2020 00:17:05 +0000 Subject: [PATCH] planet: link to latest torrent in header --- cookbooks/planet/files/default/cgi/HEADER.cgi | 3 ++- cookbooks/planet/files/default/history_cgi/HEADER.cgi | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cookbooks/planet/files/default/cgi/HEADER.cgi b/cookbooks/planet/files/default/cgi/HEADER.cgi index 874c9c28d..157c103f0 100644 --- a/cookbooks/planet/files/default/cgi/HEADER.cgi +++ b/cookbooks/planet/files/default/cgi/HEADER.cgi @@ -44,11 +44,12 @@ def nice_time(time): return '%d months' % (time / 2592000.) def file_info(file, name): + torrent_file = file + '.torrent' size = nice_size(file) hash = search(r'\w{32}', open(file+'.md5', 'r').read()).group(0) date = nice_time(time() - stat(file).st_mtime) - return '%(name)s
%(size)s, created %(date)s ago.
md5: %(hash)s.' % locals() + return '%(name)s (torrent)
%(size)s, created %(date)s ago.
md5: %(hash)s.' % locals() planet_link = file_info('planet/planet-latest.osm.bz2', 'Latest Weekly Planet XML File') changesets_link = file_info('planet/changesets-latest.osm.bz2', 'Latest Weekly Changesets') diff --git a/cookbooks/planet/files/default/history_cgi/HEADER.cgi b/cookbooks/planet/files/default/history_cgi/HEADER.cgi index 460acd319..b713338cb 100755 --- a/cookbooks/planet/files/default/history_cgi/HEADER.cgi +++ b/cookbooks/planet/files/default/history_cgi/HEADER.cgi @@ -44,11 +44,12 @@ def nice_time(time): return '%d months' % (time / 2592000.) def file_info(file, name): + torrent_file = file + '.torrent' size = nice_size(file) hash = search(r'\w{32}', open(file+'.md5', 'r').read()).group(0) date = nice_time(time() - stat(file).st_mtime) - return '%(name)s
%(size)s, created %(date)s ago.
md5: %(hash)s.' % locals() + return '%(name)s (torrent)
%(size)s, created %(date)s ago.
md5: %(hash)s.' % locals() planet_link = file_info('history-latest.osm.bz2', 'Latest Full History Planet XML File') planet_pbf_link = file_info('../../pbf/full-history/history-latest.osm.pbf', 'Latest Full History Planet PBF File') -- 2.39.5