Commit 03501d8d authored by Jonathan Schaeffer's avatar Jonathan Schaeffer
Browse files

Séparation de channel et qualité

parent 64e05d1c
......@@ -54,7 +54,8 @@ def scan_volume(path):
if len(path) == 4:
logger.debug(f"path : {path}")
logger.debug(f"size : {size}")
data.append({'year': path[0], 'network': path[1], 'station': path[2], 'channel': path[3], 'size': size})
(channel, quality) = path[3].split('.')
data.append({'year': path[0], 'network': path[1], 'station': path[2], 'channel': channel, 'quality': quality, 'size': size})
return data
......@@ -165,9 +166,9 @@ def cli(configfile):
conn = psycopg2.connect(dbname=cfg['postgres']['database'], user=cfg['postgres']['user'], host=cfg['postgres']['host'], password=cfg['postgres']['password'], port=cfg['postgres']['port'])
cur = conn.cursor()
execute_values(cur,
"""INSERT INTO datastats (network, year, station, channel, type, size, is_permanent, date) VALUES %s""",
"""INSERT INTO datastats (network, year, station, channel, quality, type, size, is_permanent, date) VALUES %s""",
statistics,
"(%(network)s, %(year)s, %(station)s, %(channel)s, %(type)s, %(size)s, %(is_permanent)s, %(date)s)")
"(%(network)s, %(year)s, %(station)s, %(channel)s, %(quality)s, %(type)s, %(size)s, %(is_permanent)s, %(date)s)")
conn.commit()
if 'influxdb' in cfg:
......@@ -183,6 +184,7 @@ def cli(configfile):
"network": stat['network'],
"station": stat['station'],
"channel": stat['channel'],
"quality": stat['quality'],
"permanent": bool(stat['is_permanent']),
"type": stat['type'],
"date": stat['date']
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment