gallery.py: Fix is_video to use VIDEO_EXTENSIONS
authorW. Trevor King <wking@tremily.us>
Sat, 21 Feb 2015 19:55:57 +0000 (11:55 -0800)
committerW. Trevor King <wking@tremily.us>
Sat, 21 Feb 2015 19:59:50 +0000 (11:59 -0800)
Avoid:

  HTML page URLs must end with a slash

when the script doesn't recognize a video URL as a cacheable page.  It
looks like this bug snuck in way back in ebd0292d (Allow gallery.py to
serve original images, 2012-08-25).

posts/gallery/gallery.py

index 36346900fd375dafdc912f9bd379a2f4eb684a38..8ea08d8367e9d315273b5d535e8cfa4036a8da53 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
 #!/usr/bin/env python
 #
-# Copyright (C) 2010-2013 W. Trevor King <wking@tremily.us>
+# Copyright (C) 2010-2015 W. Trevor King <wking@tremily.us>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -142,7 +142,7 @@ def is_image(filename):
     return False
 
 def is_video(filename):
     return False
 
 def is_video(filename):
-    for extension in IMAGE_EXTENSIONS:
+    for extension in VIDEO_EXTENSIONS:
         if filename.lower().endswith(extension):
             return True
     return False
         if filename.lower().endswith(extension):
             return True
     return False