 
 ; {:tag :a, :attrs {:href update.php?user=toxicfrog&gameid=4160408}
 (defn- gamebox-to-game [gamebox]
-  (let [progress-map { "(M)" "mastered" "(C)" "complete" "(B)" "beaten" "(U)" "unfinished" "(u)" "unplayed" "(-)" "null" }
+  (let [progress-map { "(M)" "mastered" "(C)" "completed" "(B)" "beaten" "(U)" "unfinished" "(u)" "unplayed" "(-)" "null" }
         bold (->> gamebox (tag-seq :b) (map :content) (map #(apply str %)) (map clojure.string/trim))
         id (-> (tag-seq :a gamebox) first :attrs :href (split #"gameid=") last)
         name (first bold)

  ({"unplayed" "1"
    "unfinished" "1"
    "beaten" "2"
    "complete" "3"
    "mastered" "4"
    "null" "5"}
   desc))


; function bl:details(game)
;     assert(type(game) == "number", 'invalid argument to bl:details')

;     game = assert(self:games()[game], 'no game with id '..game)

;     if game._details then return game end

;     local body = assert(request(self, { user = self.user, gameid = game.id }, "GET", "http://backloggery.com/update.php"))

;     local function set(key, value)
;         if not game[key] then
;             game[key] = value
;         end
;     end

;     -- name, console, complete, note, wishlist, and playing were already
;     -- filled in by the initial loading of the game list
;     -- FIXME own should be as well

;     -- this leaves: comp, orig_console, region
;     -- achieve1, achieve2, online
;     -- rating, comments

;     set("comp", body:Find("input", "name", "comp").value)

;     set("orig_console", body:Find("select", "name", "orig_console"):Find("option", "selected", true).value)
;     set("_orig_console_str", bl.platforms[game.orig_console])

;     set("region", tonumber(body:Find("select", "name", "region"):Find("option", "selected", true).value))
;     set("_region_str", bl.regions[game.region])

;     set("achieve1", tonumber(body:Find("input", "name", "achieve1").value) or "")
;     set("achieve2", tonumber(body:Find("input", "name", "achieve2").value) or "")

;     set("online", body:Find("input", "name", "online").value)
;     set("comments", body:Find("textarea", "name", "comments"):Content())

;     -- set the "details" flag on this game, recording that all fields are filled in
;     set("_details", true)

;     return game
; end

; -- upload the changes we've made to a game structure to the server
; function bl:editgame(game)
;     assert(type(game) == "number", 'invalid argument to bl:editgame')

;     game = assert(self:games()[game], 'no game with id '..game)

;     -- fill in any missing fields
;     self:details(game.id)

;     -- the _ derived fields override the original ones
;     game.console = bl.rplatforms[game._console_str]
;     game.orig_console = bl.rplatforms[game._orig_console_str]
