diff --git a/pandora/mobile/views.py b/pandora/mobile/views.py index 31920d6d..fbc0f44c 100644 --- a/pandora/mobile/views.py +++ b/pandora/mobile/views.py @@ -5,7 +5,7 @@ import ox def index(request, fragment): - from item.models import Item, Annotation + from item.models import Item from edit.models import Edit from document.models import Document context = {} @@ -52,26 +52,19 @@ def index(request, fragment): type = 'item' id = parts[0] item = Item.objects.filter(public_id=id).first() - if item and item.access(request.user): + if item and item.accessible(request.user): link = request.build_absolute_uri(item.get_absolute_url()) if len(parts) > 1 and parts[1] in ('editor', 'player'): parts = [parts[0]] + parts[2:] if len(parts) > 1: - aid = '%s/%s' % (id, parts[1]) - annotation = Annotation.objects.filter(public_id=aid).first() - if annotation: - inout = [annotation.start, annotation.end] + inout = parts[1] + if '-' in inout: + inout = inout.split('-') else: - inout = parts[1] - if '-' in inout: - inout = inout.split('-') - else: - inout = inout.split(',') - print(inout) - if len(inout) == 3: - inout.pop(1) - if len(inout) == 2: - inout = [ox.parse_timecode(p) for p in inout] + inout = inout.split(',') + inout = [ox.parse_timecode(p) for p in inout] + if len(inout) == 3: + inout.pop(1) context['preview'] = link + '/480p%s.jpg' % inout[0] else: context['preview'] = link + '/480p.jpg' diff --git a/update.py b/update.py index e4c2a644..5cf0dfca 100755 --- a/update.py +++ b/update.py @@ -303,7 +303,7 @@ if __name__ == "__main__": run('./bin/pip', 'install', 'yt-dlp>=2022.3.8.2') if old < 6465: run('./bin/pip', 'install', '-r', 'requirements.txt') - if old < 6506: + if old < 6507: run('./bin/pip', 'install', '-r', 'requirements.txt') else: if len(sys.argv) == 1: