Video dashboard: curated watchlist count + clear the wishlist for now
The dashboard still read the old monitored-based views: watchlist from v_watchlist (every monitored show) and wishlist from v_wishlist (every missing movie/episode, since monitored defaults to 1). Repoint both: - watchlist -> the curated watchlist_counts() total (follows + airing default). - wishlist -> 0 for now. The auto-everything v_wishlist isn't the intended curated wishlist; zero it (no live-DB mutation) until 'add to wishlist' population lands, then repoint at the real source. Test updated to the new semantics (airing show counts; wishlist cleared).
This commit is contained in:
parent
ffaa36105b
commit
248e2c32f2
2 changed files with 12 additions and 4 deletions
|
|
@ -733,8 +733,14 @@ class VideoDatabase:
|
|||
"SELECT COALESCE(SUM(download_speed_bps), 0) FROM downloads "
|
||||
"WHERE status = 'downloading'"),
|
||||
},
|
||||
"watchlist": scalar("SELECT COUNT(*) FROM v_watchlist"),
|
||||
"wishlist": scalar("SELECT COUNT(*) FROM v_wishlist"),
|
||||
# Curated watchlist (explicit follows + actively-airing library
|
||||
# shows), NOT the old monitored-based v_watchlist view.
|
||||
"watchlist": self.watchlist_counts(server_source=server_source)["total"],
|
||||
# Wishlist is intentionally 0 for now: the old v_wishlist view
|
||||
# auto-listed EVERY missing movie/episode (monitored defaults to
|
||||
# 1), which isn't the intended curated wishlist. Repoint this at
|
||||
# the curated source once "add to wishlist" population lands.
|
||||
"wishlist": 0,
|
||||
}
|
||||
finally:
|
||||
conn.close()
|
||||
|
|
|
|||
|
|
@ -149,7 +149,8 @@ def test_dashboard_stats_empty_is_all_zero(db):
|
|||
def test_dashboard_stats_counts_content_and_downloads(db):
|
||||
with db.connect() as conn:
|
||||
conn.execute("INSERT INTO movies(id,title,monitored,has_file) VALUES (1,'M',1,0)")
|
||||
conn.execute("INSERT INTO shows(id,title,monitored) VALUES (1,'S',1)")
|
||||
# airing library show → on the curated watchlist by default
|
||||
conn.execute("INSERT INTO shows(id,title,monitored,tmdb_id,status) VALUES (1,'S',1,555,'continuing')")
|
||||
conn.execute("INSERT INTO seasons(id,show_id,season_number) VALUES (1,1,1)")
|
||||
conn.execute("INSERT INTO episodes(id,show_id,season_id,season_number,episode_number) "
|
||||
"VALUES (1,1,1,1,1)")
|
||||
|
|
@ -160,7 +161,8 @@ def test_dashboard_stats_counts_content_and_downloads(db):
|
|||
s = db.dashboard_stats()
|
||||
assert s["library"] == {"movies": 1, "shows": 1, "episodes": 1, "size_bytes": 1000}
|
||||
assert s["downloads"]["active"] == 1 and s["downloads"]["speed_bps"] == 500
|
||||
assert s["watchlist"] == 1 and s["wishlist"] == 1
|
||||
# watchlist = the airing show (curated default); wishlist is cleared for now
|
||||
assert s["watchlist"] == 1 and s["wishlist"] == 0
|
||||
|
||||
|
||||
def test_library_selection_roundtrip(db):
|
||||
|
|
|
|||
Loading…
Reference in a new issue