Commit ecf5694e authored by Jonathan Schaeffer's avatar Jonathan Schaeffer
Browse files

Hack pour vérifier qu'on est dans un path valide

parent aebaf0cc
......@@ -39,7 +39,11 @@ def scan_volume(path):
# Ne pas considérer le seul chemin de niveau 1
if len(path) == 4:
logger.debug("path: %s, size: %s", path, size)
(channel, quality) = path[3].split('.')
try:
(channel, quality) = path[3].split('.')
except ValueError as e:
logger.warning("Probably not a normal path. Skip it")
next
if re.match('[2-9][0-9]{3}', path[0]):
data.append({'year': path[0], 'network': path[1], 'station': path[2],
'channel': channel, 'quality': quality, 'size': size})
......
Markdown is supported
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