Skip to content

Commit d00a1ab

Browse files
committed
v0.1.26-pre: rename Approve->Add book; Authors-you-might-like card row (suggested authors only) -> author grid + add-all; drop unused imports
1 parent ccf89ec commit d00a1ab

4 files changed

Lines changed: 26 additions & 6 deletions

File tree

‎stackarr/config.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Pre-public-release. The -pre suffix signals "not yet tested for public use";
66
# bump to 1.0.0 only after real-world testing.
7-
VERSION = "0.1.25-pre"
7+
VERSION = "0.1.26-pre"
88
RELEASE_STAGE = "pre-release · untested"
99

1010

‎stackarr/routes.py‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
session, url_for)
77

88
from . import (absclient, audible, audnexus, auth, chaptarr, config, db,
9-
discover, notify, recommend)
9+
discover, notify)
1010

1111
log = logging.getLogger("stackarr.routes")
1212
bp = Blueprint("main", __name__)
@@ -74,6 +74,17 @@ def suggestions_page():
7474
lane_order = ["series", "author", "enjoyed", "discover_author", "narrator", "genre",
7575
"hidden", "awards", "short", "epic", "upcoming", "importlist", "foryou", "discover"]
7676
lanes = {k: lanes[k] for k in lane_order if k in lanes}
77+
# authors to feature as browse cards — only SUGGESTED authors (new discoveries /
78+
# readers-also-enjoyed), NOT the "authors you love" backlist lane.
79+
seen_a, rec_authors = set(), []
80+
for r in sorted(rows, key=lambda x: x["score"], reverse=True):
81+
if r["lane"] == "author":
82+
continue
83+
a = (r["author"] or "").split(",")[0].strip()
84+
if a and a.lower() not in seen_a:
85+
seen_a.add(a.lower())
86+
rec_authors.append(a)
87+
rec_authors = rec_authors[:14]
7788
from . import discover
7889
# dashboard rows (only render if content exists)
7990
try:
@@ -85,7 +96,8 @@ def suggestions_page():
8596
"SELECT title, author, cover, status, asin FROM requests WHERE user_id=? "
8697
"ORDER BY id DESC LIMIT 14", (u["id"],))]
8798
return render_template("suggestions.html", lanes=lanes, lane_titles=lane_titles,
88-
genres=discover.DEFAULT_GENRES, abs_base=absclient.abs_url(),
99+
genres=discover.DEFAULT_GENRES, rec_authors=rec_authors,
100+
abs_base=absclient.abs_url(),
89101
recently_added=recently_added, recent_requests=recent_requests)
90102

91103

@@ -174,7 +186,6 @@ def insights_page():
174186
@bp.route("/book/<asin>")
175187
@auth.login_required
176188
def book_page(asin):
177-
from . import audnexus
178189
b = audible.by_asin(asin) or {"asin": asin, "title": "Unknown", "author": ""}
179190
ax = audnexus.book(asin) or {}
180191
if ax.get("genres"):

‎stackarr/templates/lane.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<div class="ov-actions">
1717
{% if s.available %}<button class="btn" disabled>In library</button>
1818
{% elif lane == 'upcoming' %}<button class="btn" disabled>Coming soon</button>
19-
{% else %}<button class="btn" onclick="event.preventDefault();event.stopPropagation();Stackarr.decide({{ s.id }},'approve',this)">Approve</button>{% endif %}
19+
{% else %}<button class="btn" onclick="event.preventDefault();event.stopPropagation();Stackarr.decide({{ s.id }},'approve',this)">Add book</button>{% endif %}
2020
<button class="btn ghost" onclick="event.preventDefault();event.stopPropagation();Stackarr.decide({{ s.id }},'read',this)">Read it</button>
2121
<button class="btn ghost" onclick="event.preventDefault();event.stopPropagation();Stackarr.decide({{ s.id }},'reject',this)">Ignore</button>
2222
</div>

‎stackarr/templates/suggestions.html‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ <h2 class="page-title">Suggestions <span class="subtle">curated based on your li
7070
<div class="ov-actions">
7171
{% if s.available %}<button class="btn" disabled>In library</button>
7272
{% elif lane == 'upcoming' %}<button class="btn" disabled>Coming soon</button>
73-
{% else %}<button class="btn" onclick="event.preventDefault();event.stopPropagation();Stackarr.decide({{ s.id }},'approve',this)">Approve</button>{% endif %}
73+
{% else %}<button class="btn" onclick="event.preventDefault();event.stopPropagation();Stackarr.decide({{ s.id }},'approve',this)">Add book</button>{% endif %}
7474
<button class="btn ghost" onclick="event.preventDefault();event.stopPropagation();Stackarr.decide({{ s.id }},'read',this)">Read it</button>
7575
<button class="btn ghost" onclick="event.preventDefault();event.stopPropagation();Stackarr.decide({{ s.id }},'reject',this)">Ignore</button>
7676
</div>
@@ -89,6 +89,15 @@ <h2 class="page-title">Suggestions <span class="subtle">curated based on your li
8989
{% endfor %}
9090
{% endcall %}
9191
{% endif %}
92+
{% if loop.first and rec_authors %}
93+
{% call lane_row('authorbrowse', rec_authors, 'Authors you might like') %}
94+
{% for a in rec_authors %}
95+
<a class="media-card genre-card" href="{{ url_for('main.browse_page', author=a) }}">
96+
<div class="media-poster genre-poster"><span class="genre-card-label">{{ a }}</span></div>
97+
</a>
98+
{% endfor %}
99+
{% endcall %}
100+
{% endif %}
92101
{% endfor %}
93102

94103
<section class="section" id="home-discover-section">

0 commit comments

Comments
 (0)