diff --git a/nyaa/models.py b/nyaa/models.py
index e05bc78..780378d 100644
--- a/nyaa/models.py
+++ b/nyaa/models.py
@@ -501,13 +501,17 @@ class User(db.Model):
def gravatar_url(self):
# from http://en.gravatar.com/site/implement/images/python/
- size = 120
+ params = {
+ # Image size (https://en.gravatar.com/site/implement/images/#size)
+ 's': 120,
+ # Default image (https://en.gravatar.com/site/implement/images/#default-image)
+ 'd': flask.url_for('static', filename='img/avatar/default.png', _external=True),
+ # Image rating (https://en.gravatar.com/site/implement/images/#rating)
+ 'r': 'pg' if app.SITE_FLAVOR['nyaa'] else 'x', # Nyaa: PG-rated, Sukebei: X-rated
+ }
# construct the url
- default_avatar = flask.url_for('static', filename='img/avatar/default.png', _external=True)
- gravatar_url = 'https://www.gravatar.com/avatar/{}?{}'.format(
- md5(self.email.encode('utf-8').lower()).hexdigest(),
- urlencode({'d': default_avatar, 's': str(size)}))
- return gravatar_url
+ return 'https://www.gravatar.com/avatar/{}?{}'.format(
+ md5(self.email.encode('utf-8').lower()).hexdigest(), urlencode(params))
@property
def userlevel_str(self):
diff --git a/nyaa/templates/help.html b/nyaa/templates/help.html
index 9b4061f..7af1255 100644
--- a/nyaa/templates/help.html
+++ b/nyaa/templates/help.html
@@ -81,6 +81,12 @@
to have an image embedded in your comment or description. Note the !
exclamation mark at the beginning, denoting that this link is an image.
+
+{{ linkable_header("Changing Your User's Avatar", "avatar") }}
+
Help
The search engine is located at the top right, and it allows users to search through the torrent titles available on the site. Results matching either word A or B can be included by typing a vertical bar between them (|). Results matching a certain word can be excluded by prefixing that word with a hyphen-minus (-). Phrases can be matched by surrounding them with double-quotes (). Search results can be filtered by category, remake, trusted, and/or A+ status, and then narrowed down further by age and size ranges as well as excluding specific users. Sorting can be done in ascending or descending order by date, amount of seeders/leechers/downloads, size, or name. The search engine adapts to the current view and makes it possible to search for specific torrents in a specific subcategory from a specific user.