Parcourir la source

Fix background URL generation

master
Ben Kurtovic il y a 2 ans
Parent
révision
23663afbe2
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. +2
    -1
      copyvios/background.py

+ 2
- 1
copyvios/background.py Voir le fichier

@@ -4,6 +4,7 @@ from datetime import datetime, timedelta
from json import loads
import random
import re
import urllib

from earwigbot import exceptions
from flask import g
@@ -52,7 +53,7 @@ def _build_url(screen, filename, url, imgwidth, imgheight):
if width >= imgwidth:
return url
url = url.replace("/commons/", "/commons/thumb/")
return url + "/" + str(width) + "px-" + filename
return "%s/%dpx-%s" % (url, width, urllib.quote(filename))

_BACKGROUNDS = {
"potd": _get_fresh_potd,


Chargement…
Annuler
Enregistrer