Skip to content
Browse files

Don't list anyone without an Amazon URL

  • Loading branch information...
1 parent 50eb196 commit ff932d8f33fc940d48d638cab7787ec860c9b1ac @palfrey committed
Showing with 20 additions and 24 deletions.
  1. +1 −1 missing_albums.py
  2. +19 −23 template.html
View
2 missing_albums.py
@@ -370,7 +370,7 @@ def realNone(x):
for key in sorted(missing, reverse = True):
if key > localtime(): # ignore items not released yet
continue
- flattened.extend(missing[key])
+ flattened.extend([x for x in missing[key] if x["url"]!=None])
count = len(flattened)
perpage = 10
pages = int(math.ceil(count/(perpage*1.0)))
View
42 template.html
@@ -18,31 +18,27 @@
amazon_new = "£" + "%.2f"%(album["amazon_new"]/100.00)
else:
amazon_new = "Unknown"
- has_url = album["url"] != None
encoded_title = ("%s %s"%(album["artist"], album["title"])).replace(" ", "+")
%}
- {% if has_url %}
- <tr width="100%">
- <td>
- <a href="${ album["url"] }">${ album["artist"] } - ${ album["title"] }</a><br />
- Date: ${when} <br />
- Price: ${amazon_new}
- </td>
- <td>
- <a href="http://www.find-cd.co.uk/search.aspx?title=${encoded_title}&type=keywords">Find-cd</a><br />
- <a href="http://hmv.com/hmvweb/simpleMultiSearch.do?searchUID=&pGroupID=0&adultFlag=false&simpleSearchString=${encoded_title}&primaryID=0&btnSubmitSearch.x=0&btnSubmitSearch.y=0">HMV</a>
- </td>
- <td align="right">
- {% python hasImage = album["image"] != None %}
- {% if hasImage %}
- <a href="${ album["url"] }">
- <img src="${album["image"]}" width="100" />
- </a>
- {% end %}
- </td>
- </tr>
-
- {% end %}
+ <tr width="100%">
+ <td>
+ <a href="${ album["url"] }">${ album["artist"] } - ${ album["title"] }</a><br />
+ Date: ${when} <br />
+ Price: ${amazon_new}
+ </td>
+ <td>
+ <a href="http://www.find-cd.co.uk/search.aspx?title=${encoded_title}&type=keywords">Find-cd</a><br />
+ <a href="http://hmv.com/hmvweb/simpleMultiSearch.do?searchUID=&pGroupID=0&adultFlag=false&simpleSearchString=${encoded_title}&primaryID=0&btnSubmitSearch.x=0&btnSubmitSearch.y=0">HMV</a>
+ </td>
+ <td align="right">
+ {% python hasImage = album["image"] != None %}
+ {% if hasImage %}
+ <a href="${ album["url"] }">
+ <img src="${album["image"]}" width="100" />
+ </a>
+ {% end %}
+ </td>
+ </tr>
{% end %}
</table>
{% for link in links %}

0 comments on commit ff932d8

Please sign in to comment.
Something went wrong with that request. Please try again.