fix sound path query bugs

This commit is contained in:
bkfox
2022-10-10 19:08:51 +02:00
parent 05a3b9c95d
commit 1fed61f47f
3 changed files with 9 additions and 7 deletions

View File

@ -98,8 +98,8 @@ class Program(Page):
Return a Program from the given path. We assume the path has been
given in a previous time by this model (Program.path getter).
"""
if path.startswith(settings.AIRCOX_PROGRAMS_DIR):
path = path.replace(settings.AIRCOX_PROGRAMS_DIR + '/', '')
if path.startswith(settings.AIRCOX_PROGRAMS_DIR_ABS):
path = path.replace(settings.AIRCOX_PROGRAMS_DIR_ABS, '')
while path[0] == '/':
path = path[1:]
path = path[:path.index('/')]