Cover quick import fix.
authorRadek Czajka <rczajka@rczajka.pl>
Fri, 23 Sep 2022 13:41:53 +0000 (15:41 +0200)
committerRadek Czajka <rczajka@rczajka.pl>
Fri, 23 Sep 2022 13:41:53 +0000 (15:41 +0200)
src/cover/views.py

index 638f1c0..25663a0 100644 (file)
@@ -158,7 +158,7 @@ def quick_import(request, pk):
     if url.startswith('%s://%s/' % (
             request.scheme,
             request.get_host())):
-        cover_id = url.rsplit('/', 1)[-1]
+        cover_id = url.rstrip('/').rsplit('/', 1)[-1]
         cover = Image.objects.get(pk=cover_id)
     else:
         data = get_import_data(url)