diff --git a/hatenadir/ds/v2-xx/movie.py b/hatenadir/ds/v2-xx/movie.py
index 20901fc..3c551b1 100644
--- a/hatenadir/ds/v2-xx/movie.py
+++ b/hatenadir/ds/v2-xx/movie.py
@@ -82,8 +82,12 @@ class CreatorIDFileResource(resource.Resource):
return self.GenerateDetailsPage(creator, ".".join(file.split(".")[:-1])).encode("UTF-8")
elif filetype == "star":
path = "/".join(request.path.split("/")[3:])
+ try:
+ color = request.args.get('starcolor')[0] #colour of the star. can be green, red, blue, or purple.
+ except:
+ color = "yellow" #if starcolor arg doesn't exist, then its yellow. there's probably a better way to handle this, but I'm not fluent with python ;-;
headers = request.getAllHeaders()
-
+
#bad formatting
if "x-hatena-star-count" not in headers:
ServerLog.write("%s got 403 when requesting %s without a X-Hatena-Star-Count header" % (request.getClientIP(), path), Silent)
@@ -97,14 +101,14 @@ class CreatorIDFileResource(resource.Resource):
request.setResponseCode(403)
return "403 - Denied access\nRequest has an invalid X-Hatena-Star-Count http header"
- if not Database.AddStar(creator, file[:-5], amount):
+ if not Database.AddStar(creator, file[:-5], amount, color):
#error
ServerLog.write("%s got 500 when requesting %s" % (request.getClientIP(), path), Silent)
request.setResponseCode(500)
return "500 - Internal server error\nAdding the stars seem to have failed."
#report success
- ServerLog.write("%s added %i stars to %s/%s.ppm" % (request.getClientIP(), amount, creator, file[:-5]), Silent)
+ ServerLog.write("%s added %i %s stars to %s/%s.ppm" % (request.getClientIP(), amount, color, creator, file[:-5]), Silent)
return "Success"
elif filetype == "dl":
path = "/".join(request.path.split("/")[3:])
@@ -149,7 +153,10 @@ class CreatorIDFileResource(resource.Resource):
#Stars:
name = "Stars"
content = u'\u2605 %s' % (CreatorID, filename, flipnote[2])#yellow stars
- #todo: add other stars
+ content += u'
\u2605 %s' % (CreatorID, filename, flipnote[3])#green stars
+ content += u'
\u2605 %s' % (CreatorID, filename, flipnote[4])#red stars
+ content += u'
\u2605 %s' % (CreatorID, filename, flipnote[5])#blue stars
+ content += u'
\u2605 %s' % (CreatorID, filename, flipnote[6])#purple stars
Entries.append(PageEntryTemplate.replace("%%Name%%", name).replace("%%Content%%", content))
#Views:
@@ -182,6 +189,10 @@ DetailsPageTemplate = """