瀏覽代碼

Fix background URL generation

multi-sources
Ben Kurtovic 2 年之前
父節點
當前提交
23663afbe2
共有 1 個檔案被更改,包括 2 行新增1 行删除
  1. +2
    -1
      copyvios/background.py

+ 2
- 1
copyvios/background.py 查看文件

@@ -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,


Loading…
取消
儲存