linuxgaming

This is my own Linux gaming aggregate web app I built for personal use.
git clone git://git.beardyjay.co.uk/linuxgaming
Log | Files | Refs | README

commit ef5b9aa018f6aeaf3ddb4d4470e4cb572d97dfdf
parent 106f6eea59d36d8e7b8b36eb2927e45ba85b6e34
Author: Jay Scott <jay@beardyjay.co.uk>
Date:   Wed, 18 Jul 2018 14:47:22 +0100

updating gog type and UI changes

Diffstat:
MCHANGELOG | 1+
Ahb | 77+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mlinuxgaming/search.py | 4+++-
Mlinuxgaming/templates/base.html | 7++-----
Mlinuxgaming/templates/macros/items.html | 13++++++++-----
Mlinuxgaming/update.py | 2+-
6 files changed, 92 insertions(+), 12 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG @@ -7,6 +7,7 @@ Wed 18 Jul - Added new source "Xpenguin" - RSS description check added. - Refactored search page. + - Changed gog to type game. Tue 17 Jul diff --git a/hb b/hb @@ -0,0 +1,77 @@ +https://www.humblebundle.com/store/api/search?sort=newest&filter=all&search=&platform=linux&request=6&page_size=1 + +{ + "num_results":2150, + "page_index":0, + "request":6, + "num_pages":2150, + "results":[ + { + "featured_image_small":"https://humblebundle.imgix.net/misc/files/hashed/94bf921f2dccd45985817de2ce1f65134690d6e0.jpeg?auto=format&fit=crop&h=189&w=304&s=0f4fe0d8c23336d569082ad3faebea03", + "standard_carousel_image":"https://humblebundle.imgix.net/misc/files/hashed/94bf921f2dccd45985817de2ce1f65134690d6e0.jpeg?auto=compress,format&fit=crop&h=206&w=360&s=607ccc3646ecfdcddc0c86aeaa700820", + "delivery_methods":[ + "download", + "steam" + ], + "machine_name":"chickenassassin_reloaded_storefront", + "featured_image_large":"https://humblebundle.imgix.net/misc/files/hashed/94bf921f2dccd45985817de2ce1f65134690d6e0.jpeg?auto=format&fit=crop&h=392&w=622&s=dbc235825244c5a51c521a26ae579ba0", + "featured_image_recommendation":"https://humblebundle.imgix.net/misc/files/hashed/94bf921f2dccd45985817de2ce1f65134690d6e0.jpeg?auto=compress,format&fit=crop&h=154&w=270&s=856fd170dbf00aa3c1bea4d9e92baa36", + "xray_traits_thumbnail":"https://humblebundle.imgix.net/misc/files/hashed/94bf921f2dccd45985817de2ce1f65134690d6e0.jpeg?auto=compress,format&fit=crop&h=84&w=135&s=e503bee77a07ee40cbbef855ea214eb2", + "content_types":[ + "game" + ], + "human_url":"chicken-assassin-reloaded", + "platforms":[ + "mac", + "linux", + "windows" + ], + "icon_dict":{ + "download":{ + "available":[ + "windows", + "mac", + "linux" + ], + "unavailable":[ + + ] + }, + "steam":{ + "available":[ + "windows", + "mac", + "linux" + ], + "unavailable":[ + + ] + } + }, + "featured_image_medium":"https://humblebundle.imgix.net/misc/files/hashed/94bf921f2dccd45985817de2ce1f65134690d6e0.jpeg?auto=format&fit=crop&h=292&w=463&s=ddc4284c974de91aae13463c57b0d1bf", + "large_capsule":"https://humblebundle.imgix.net/misc/files/hashed/94bf921f2dccd45985817de2ce1f65134690d6e0.jpeg?auto=compress,format&fit=crop&h=353&w=616&s=a10b8af0e0d1aa90e9e86cc275a77ac4", + "human_name":"Chicken Assassin: Reloaded", + "product_background_image":null, + "type":"product", + "icon":"https://humblebundle.imgix.net/misc/files/hashed/94bf921f2dccd45985817de2ce1f65134690d6e0.jpeg?auto=format&fit=crop&h=64&w=103&s=65886bedcdbeaa10b1e2cc191746078f", + "non_cyoc_charity_split":0.0, + "cyoc_split":0.050000000000000003, + "non_cyoc_charity_names":[ + + ], + "full_price":[ + 3.9900000000000002, + "GBP" + ], + "keep_split":0.050000000000000003, + "current_price":[ + 3.9900000000000002, + "GBP" + ], + "cta_badge":"new", + "rating_for_current_region":"pegi" + } + ] +} + + diff --git a/linuxgaming/search.py b/linuxgaming/search.py @@ -12,10 +12,11 @@ bp = Blueprint('search', __name__, url_prefix='/search') @bp.route("/<path:path>", methods=('GET', 'POST')) def test(path): - pages = ['gog', 'twitch', 'youtube', 'article', 'podcast', 'allthethings'] + pages = ['game', 'twitch', 'youtube', 'article', 'podcast'] if any(x in path for x in pages): result = current_app.mongo.db.items.find( {"type": path}).sort('date', -1) + return render_template( 'pages/search.html', entries=result, @@ -23,4 +24,5 @@ def test(path): else: flash('1337 Hacks in progress...') current_app.logger.info('Manual search probe %s', path) + return redirect(url_for('home')) diff --git a/linuxgaming/templates/base.html b/linuxgaming/templates/base.html @@ -36,14 +36,11 @@ <a class="item" href="/search/podcast" data-content="Filter by Podcasts"> <i class="soundcloud blue large icon"></i> </a> - <a class="item" href="/search/gog" data-content="Filter all GoG Games"> - <img class="ui mini bordered image" alt="GoG Logo" src="{{ url_for('static', filename='images/icons/gog.png')}}"> + <a class="item" href="/search/game" data-content="Filter all games"> + <i class="game blue large icon"></i> </a> <div class="right item"> - <a class="item" href="/search/allthethings" data-title="Show EVERYTHING!" data-content="Good luck rendering this..."> - <i class="exclamation red large icon" ></i> - </a> <div class="item"> <i class="ellipsis vertical disabled icon"></i> </div> diff --git a/linuxgaming/templates/macros/items.html b/linuxgaming/templates/macros/items.html @@ -5,20 +5,23 @@ <i text='twitch' class="twitch inverted purple bordered icon"></i> {% elif "youtube" in item.type %} <i class="youtube red bordered inverted icon"></i> - {% elif "gog" in item.type %} + {% elif "game" in item.type %} <i class="game blue bordered inverted icon"></i> {% elif "article" in item.type %} <i class="rss orange bordered inverted icon"></i> - {% elif "gog" in item.type %} - <i class="game grey bordered inverted icon"></i> {% else %} <i class="soundcloud blue bordered inverted icon"></i> {% endif %} </td> <td> - <a href="/details/{{ item.name }}"> - <img alt="{{ item.name }} icon" src="{{ url_for('static', filename='images/icons/')}}{{ item.icon }} "> + {% if not "gog" in item.name %} + <a href="/details/{{ item.name }}"> + <img alt="{{ item.name }} icon" src="{{ url_for('static', filename='images/icons/')}}{{ item.icon }} "> </a> + {% else %} + <img alt="{{ item.name }} icon" src="{{ url_for('static', filename='images/icons/')}}{{ item.icon }} "> + {% endif %} + </td> <td> {{ item.title }} diff --git a/linuxgaming/update.py b/linuxgaming/update.py @@ -213,7 +213,7 @@ def gog_update(): data = { "name": "gog", "icon": "gog.png", - "type": "gog", + "type": "game", "title": search_result['title'], "image": "https:" + search_result['image'] + ".png", "publisher": search_result['publisher'],