-**Official release · v1.5.0** — intended for **firmware 11.00 with ShadowMount+**. PS5 testing is still needed, including playback, sign-in, microphone, lighting and 4K/HDR performance.
+**Official release · v1.6.0** — intended for **firmware 11.00 with ShadowMount+**. PS5 testing is still needed, including playback, sign-in, microphone, lighting and 4K/HDR performance.
-**New in v1.5.0:** [Feed controls and playback rescue](docs/FEED_AND_PLAYBACK_HEALTH.md), smoother remote/bookmark controls, and [update notifications](docs/UPDATE_NOTIFICATIONS.md).
+**New in v1.6.0:** Continue Watching, catch-up queues, channel preferences, session recovery and Quick Switch. [Full changelog](docs/releases/01.006.000.md).
+
+**Viewing and maintenance:** [Everyday viewing](docs/EVERYDAY_VIEWING.md) and [recovery & maintenance](docs/RELIABILITY_AND_MAINTENANCE.md).
## How YouTube Max’d stands out
diff --git a/UPSTREAM.json b/UPSTREAM.json
index 9a2d3bb4..7e653aeb 100644
--- a/UPSTREAM.json
+++ b/UPSTREAM.json
@@ -1,7 +1,7 @@
{
"application": "YouTube Max’d",
- "version": "1.5.0",
- "content_version": "01.005.000",
+ "version": "1.6.0",
+ "content_version": "01.006.000",
"title_id": "PPSA99991",
"upstream": "https://github.com/blackbearreloaded/ProsperoTube",
"commit": "3446f364172c299a17cecf29a3efcf23c8463f68",
diff --git a/branding/brand.json b/branding/brand.json
index e9c811c6..8fcdeebf 100644
--- a/branding/brand.json
+++ b/branding/brand.json
@@ -1,7 +1,7 @@
{
"name": "YouTube Max’d",
"slug": "youtube-maxd",
- "version": "1.5.0",
+ "version": "1.6.0",
"palette": {
"red": "#FF304F",
"soft_red": "#FFA5AA",
diff --git a/companion/prosperotube/__init__.py b/companion/prosperotube/__init__.py
index 6e8ef4e4..aa42f944 100644
--- a/companion/prosperotube/__init__.py
+++ b/companion/prosperotube/__init__.py
@@ -1,2 +1,2 @@
"""ProsperoTube LAN companion. SPDX-License-Identifier: GPL-3.0-or-later."""
-__version__ = "1.005.000"
+__version__ = "1.006.000"
diff --git a/docs/EVERYDAY_VIEWING.md b/docs/EVERYDAY_VIEWING.md
new file mode 100644
index 00000000..f5643fa5
--- /dev/null
+++ b/docs/EVERYDAY_VIEWING.md
@@ -0,0 +1,37 @@
+# Everyday viewing improvements
+
+Included in v1.6.0. Physical PS5 and phone testing is still required.
+
+## Continue Watching
+
+The Classic main menu has a dedicated **Continue Watching** list. Afterglow's existing Home shelf now reads this list, so completed history entries cannot crowd unfinished videos off the first page. Entries show saved progress and resume through the existing player path. Finished/live videos are excluded, and each profile has its own positions. Existing incognito/history-off behavior and the setting for remembering short videos are respected. This is local PS5 history, not cross-device Google history sync.
+
+## Subscription catch-up
+
+Open **Settings → Subscription catch-up**, create a queue, and edit its rules. Choose up to eight channels from local follows and subscription video metadata already loaded on the PS5. With no explicit selection, all subscription channels are eligible. Follow or browse a channel first if it is missing from the picker.
+
+Rules start with unwatched videos, known Shorts hidden, live/upcoming videos excluded, and a 30-minute budget. Adjust the budget (15–120 minutes or no limit), Shorts option, and existing title/duration filters. **Open playlist** previews matches; **Append matching videos to queue** keeps existing entries and adds each new video once without starting playback. The budget covers newly selected matches, not time already in the play queue.
+
+This reuses the signed-in subscription feed. A Google/YouTube sign-in is needed for a real subscription feed. It examines at most eight pages and 128 matches; it does not promise to scan all uploads. Shorts filtering requires an explicit Shorts marker. Channel selections, rules and queued videos remain profile-owned, including while ordinary preferences are shared. Changing profile or rules during a scan cancels its result.
+
+## Phone keyboard
+
+The existing Phone remote now labels its search form **Phone keyboard**, offers the phone's search/submit key, and explains the send flow. Blank and oversized UTF-8 searches get useful feedback before being sent. Drafts survive failed requests and are cleared only when their search is accepted. Newer drafts remain intact. It uses the existing opt-in, paired LAN remote and does not expose account passwords or replace arbitrary PS5 system keyboard dialogs.
+
+## Sleep timer
+
+Use **Settings → Sleep timer** or the R2 playback options. Choose an elapsed-time timer (15/30/45/60/90/120 minutes) or **When this video ends**. Input does not restart the elapsed-time timer. Expiry pauses playback; end-of-video sleep suppresses repeat, autoplay and the next queued video once. Changing the video cancels an end-of-video timer. Changing profile or restarting the app clears session timers. Timers do not suspend or shut down the PS5.
+
+The existing inactivity timer remains available separately. Selecting one timer type cancels the other. **Turn sleep timer off** cancels both. The saved inactivity preference is turned off when selecting a session timer. Pausing rather than discarding playback preserves the current media and queue.
+
+## Playback presets
+
+**Settings → Playback presets** has Movies (up to 4K/30), Gaming (up to 1080p/60), and Listening (up to 720p/30) slots. **Save current preferences** stores quality ceiling, FPS ceiling, codec, speed, audio/caption languages, caption preferences and Auto Max. **Use this preset** applies those preferences to the next resolved video. Available formats still depend on the video; Listening is not an audio-only stream mode. Reset removes the saved override for that slot. Unsaved defaults retain current caption/language/Auto Max choices. Saved slots belong to the actual profile even with shared ordinary settings; applying a slot changes ordinary playback preferences under the existing sharing setting. The current video is not reopened automatically.
+
+## Accessibility
+
+**Settings → Accessibility** groups interface text size (100/115/120%), high contrast, reduced motion, caption backgrounds (transparent/translucent/opaque black) and the existing caption-size selector. Classic uses the existing scalable layout; Afterglow scales shaped text with consistent measurement, fitting and wrapping, capped at 120%. Its baked-font fallback retains its existing sizing if the text engine cannot start. Reduced motion disables Classic decorative CSS motion and uses Afterglow's existing reduced-motion path. Accessibility follows the existing separate/shared account-settings choice. Caption preferences remain adjustable independently.
+
+## Validation
+
+Provider regressions exercise actual progress, completion, profile isolation, preset persistence, stale actions, caption controls, subscription scanning, channel/Shorts/watched filters, bounded sessions, duplicate-free queue append and cancelled callbacks. Timer tests use a deterministic clock; phone tests execute the actual page script. Cross-compilation and package checks are separate from physical console acceptance.
diff --git a/docs/RELIABILITY_AND_MAINTENANCE.md b/docs/RELIABILITY_AND_MAINTENANCE.md
new file mode 100644
index 00000000..be2ebd23
--- /dev/null
+++ b/docs/RELIABILITY_AND_MAINTENANCE.md
@@ -0,0 +1,49 @@
+# Recovery, channel preferences and maintenance
+
+These additions extend the viewing features in [Everyday viewing](EVERYDAY_VIEWING.md). Included in v1.6.0. Open **Settings → Playback and maintenance** for the new controls. Family-profile PIN gates still apply.
+
+## Channel-specific preferences
+
+Open **Channel preferences**, then choose a channel already browsed or followed in this profile. Set its quality ceiling, playback speed, captions and volume leveling. Each choice starts at **Inherit**. Reset removes these overrides while keeping existing profile settings and legacy caption/speed memories.
+
+Overrides belong to the actual profile, including when ordinary settings are shared. They affect future video resolves. A channel ceiling can lower, but never raise, the profile ceiling. Explicit channel caption/speed choices take precedence over the existing caption/speed memories; Inherit returns to their ordinary behavior. Volume leveling uses YouTube's loudness metadata when available and does not alter the profile's stored volume preference. It does not analyze audio or boost quiet tracks.
+
+Up to 256 channel entries are retained. No Google/YouTube account settings are changed.
+
+## Interrupted-session and queue recovery
+
+The existing queue remains saved in its original order. Normal video progress now also records a profile-owned interruption checkpoint in the same atomic state file. A checkpoint left without a stop report creates a **Recover interrupted session** entry in the main menu and can be reviewed under **Interrupted session**.
+
+Review the remaining queue or choose **Resume interrupted video**, then select the saved video to play it. Resume resolves fresh streams; it does not reuse saved signed media URLs. There is no automatic playback. The offer remains available until playback starts or you dismiss it. Dismiss keeps the queue, history and bookmarks.
+
+Recovery uses the last successful save, ordinarily within the existing ten-second progress-save interval, with an immediate start checkpoint. Missing stop reports can result from a crash, forced close or restoring an active-session backup; the app does not claim to diagnose a crash. Normal stop reports clear the offer. History-disabled/incognito playback does not create checkpoints, and the existing short-video resume preference is respected. Live/DVR sessions are not offered as VOD resumes. Store failures are reported through the existing storage notices.
+
+## Playback diagnostics
+
+**Playback diagnostics** and **R2 → Playback health & rescue** show the last classified failure observed for the selected profile in the current app session: source/resolve request, video decoder, audio decoder, sustained buffering, or no supported resolved formats. The record is session-only and contains no displayed media URLs, credentials or raw resolver responses. Switching profiles does not show another profile's failure.
+
+Suggestions distinguish retrying a source, selecting a different audio track, trying a lower quality, and using an available AVC format up to 1080p30 SDR. Actual rescue still requires reviewing and confirming the existing one-video recovery action. A category is an observation, not proof of a particular network, ISP or URL-expiry cause. Available alternatives depend on the formats already resolved.
+
+## Quick Switch
+
+While browsing videos, **hold Touchpad for about 0.65 seconds** to open Quick Switch. Short Touchpad taps keep their existing actions. Recording, typing, sign-in, modal and playback input keep their existing ownership; this shortcut does not replace the player's Touchpad controls.
+
+Jump to Continue Watching, subscriptions, search, or the play queue. Afterglow opens its search screen. Classic opens recent searches; press Square there to enter a new query. Quick Switch is also available under Playback and maintenance. Family restrictions remain in force.
+
+## Storage and cache
+
+Storage shows the Afterglow thumbnail **RAM** footprint and ready-picture count. Clearing it releases that cache; visible artwork reloads on demand. This is not a disk thumbnail cache. It is unavailable before an Afterglow frame exists.
+
+The separate temporary-caption control shows the size of `active.srt` and can remove that one derived file only while playback and requests are idle. It does not sweep directories. Profiles, credentials, bookmarks, queue records, backups, fonts and the voice model are kept. No device-wide storage cleanup or cache deletion outside this app is performed.
+
+## Offline backup and restore preview
+
+The existing **Backup and restore** page creates a dated JSON copy under `/data/youtube-maxd/backup`. The copy includes local profile preferences, family configuration, bookmarks, queue/history records, channel overrides and playback presets. The restore review now displays counts of the stored preference sets, records, favorites, queue entries, bookmarks, channel rules and presets before you choose Restore.
+
+To move an exported backup, copy the complete dated JSON file from that folder using your normal file-transfer method. To import one, put the original, unchanged `youtube-YYYYMMDD-HHMMSS.json` file in the app's backup folder, reopen the list, review its preview, then select Restore. A safety copy of the replaced state is retained. Invalid, oversized or unsupported backups are rejected by the existing bounded parser. No upload or cloud service is involved.
+
+Standalone YouTube sign-ins are separate and are not exported; sign in on another console as needed. A companion-based installation's full state backup includes its pairing token. Keep full backups private. The preview shows counts, not credentials or account names.
+
+## Validation
+
+Tests exercise real provider resolution ceilings, speed/caption selection, effective volume gain, clean-stop/interruption behavior, profile isolation, no-autoplay recovery, saved queue order, history privacy, cache controls and backup previews. The shipping Quick Switch input block is compiled and executed with UI stubs in addition to gesture tests. Menu fixtures are exported from actual provider responses. Physical PS5/phone/live YouTube acceptance remains separate from automated and build verification.
diff --git a/docs/releases/01.006.000.md b/docs/releases/01.006.000.md
new file mode 100644
index 00000000..e9e41f7d
--- /dev/null
+++ b/docs/releases/01.006.000.md
@@ -0,0 +1,14 @@
+# YouTube Max’d 1.6.0
+
+- Continue Watching and subscription catch-up queues.
+- Better phone keyboard search, sleep timers, playback presets and accessibility options.
+- Per-channel quality, speed, captions and volume leveling.
+- Interrupted-session recovery with saved positions and queue review.
+- Playback diagnostics and hold-Touchpad Quick Switch.
+- Thumbnail RAM cleanup, temporary-caption cleanup and offline backup previews.
+
+Install `PPSA99991.zip`: close the app, extract it and replace the complete app folder. Keep the separate app data folder. Picture-in-picture remains off by default.
+
+Intended for firmware 11.00 with ShadowMount+. Automated tests and PS5 cross-compilation are separate from physical console testing, which remains pending. Channel leveling requires available loudness metadata; recovery does not autoplay. Google-linked profile import remains research.
+
+Based on ProsperoTube and EVO Player. Thanks to their contributors; credits, licenses and corresponding source are included.
diff --git a/native/afterglow/app/afterglow.h b/native/afterglow/app/afterglow.h
index 33e39738..bc9806c0 100644
--- a/native/afterglow/app/afterglow.h
+++ b/native/afterglow/app/afterglow.h
@@ -23,6 +23,8 @@ int tube_afterglow_enabled(void);
/* 1 = the interface drew the last frame of the provider screen: the pad is
* its, and the classic browser underneath must not act. */
int tube_afterglow_shown(void);
+int tube_afterglow_open_quick_switch(void);
+int tube_maxd_thumbnail_cache(unsigned long long *bytes,int *pictures,int clear);
/* The pad of this frame, in EVO's PadButtons bits. */
void tube_afterglow_keyboard_poll(int browser_active);
void tube_afterglow_keyboard_close(void);
diff --git a/native/afterglow/app/mount.cpp b/native/afterglow/app/mount.cpp
index d838177c..7c3786ca 100644
--- a/native/afterglow/app/mount.cpp
+++ b/native/afterglow/app/mount.cpp
@@ -266,6 +266,7 @@ bool mount_render(evo::hui_agc::AgcBatch &batch, const hui::ui::Fonts &fonts, fl
evo_boot_log("afterglow: the text engine did not start (%s); the kit's baked fonts draw", why.c_str());
FrameOptions options;
options.scheme = prefs != nullptr ? prefs->scheme : 0;
+ options.reduced_motion = prefs != nullptr && prefs->reduced_motion;
options.opening = g_cold;
g_cold = false;
m.scheme = options.scheme;
@@ -315,6 +316,7 @@ bool mount_render(evo::hui_agc::AgcBatch &batch, const hui::ui::Fonts &fonts, fl
m.scheme = prefs->scheme;
m.frame->set_scheme(m.scheme);
}
+ m.frame->set_reduced_motion(prefs != nullptr && prefs->reduced_motion);
// Back on screen after the player or another screen of the app had it.
const double now = monotonic_seconds();
if (tube_background_play_take_browser_resume() || (m.last_render != 0.0 && now - m.last_render > 1.0))
@@ -329,8 +331,10 @@ bool mount_render(evo::hui_agc::AgcBatch &batch, const hui::ui::Fonts &fonts, fl
const bool continuous_input = m.last_render != 0.0 && now - m.last_render < 0.5;
m.last_render = now;
- if (m.text)
+ if (m.text) {
+ m.text->set_text_scale(prefs != nullptr ? prefs->ui_scale / 100.0f : 1.0f);
m.text->begin_frame();
+ }
// What the snapshot cannot know by itself: the size drawn at, and the text engine's numbers.
m.frame->set_output(width, height);
if (m.text)
@@ -520,3 +524,14 @@ extern "C" void tube_afterglow_voice_status(int state)
g_mount->frame->set_voice_status(state == TUBE_VOICE_RECORDING ? "Listening: release L3 to search; Circle cancels" :
state == TUBE_VOICE_TRANSCRIBING ? "Recognizing your search; Circle cancels" : "");
}
+
+extern "C" int tube_afterglow_open_quick_switch(void) {
+ if(!g_mount || !g_mount->frame || !g_mount->frame->background_return_allowed())return 0;
+ g_mount->frame->open(afterglow::Route{afterglow::ScreenId::settings,"settings:quick-switch","Quick Switch"});return 1;
+}
+extern "C" int tube_maxd_thumbnail_cache(unsigned long long *bytes,int *pictures,int clear) {
+ if(!g_mount || !g_mount->frame)return 0;
+ auto &cache=g_mount->frame->image_cache();
+ if(clear)cache.clear();
+ if(bytes)*bytes=cache.bytes();if(pictures)*pictures=cache.ready();return 1;
+}
diff --git a/native/afterglow/data.cpp b/native/afterglow/data.cpp
index 020b04df..cd22c060 100644
--- a/native/afterglow/data.cpp
+++ b/native/afterglow/data.cpp
@@ -28,7 +28,7 @@ struct ShelfPlan
bool in_turn = false;
};
constexpr ShelfPlan kSignedIn[] = {
- {"continue", tr_mark("Continue watching"), "history", model::ShelfKind::videos, 12},
+ {"continue", tr_mark("Continue watching"), "continue-watching", model::ShelfKind::videos, 12},
{"recommended", tr_mark("Recommended for you"), "library:home", model::ShelfKind::videos, 16},
{"subscriptions", tr_mark("New from your subscriptions"), "library:subscriptions", model::ShelfKind::videos, 16},
{"live", tr_mark("Live now"), "home-topic:live", model::ShelfKind::videos, 16, true},
@@ -39,7 +39,7 @@ constexpr ShelfPlan kSignedIn[] = {
// there for when it answers. Every row is asked in its turn, so a row YouTube leaves empty costs
// one request and the rows further down none until the page reaches them.
constexpr ShelfPlan kGuest[] = {
- {"continue", tr_mark("Continue watching"), "history", model::ShelfKind::videos, 12, true},
+ {"continue", tr_mark("Continue watching"), "continue-watching", model::ShelfKind::videos, 12, true},
{"recommended", tr_mark("Recommended for you"), "library:home", model::ShelfKind::videos, 16, true},
{"music", tr_mark("Music"), "home-topic:music", model::ShelfKind::videos, 16, true},
{"gaming", tr_mark("Gaming"), "home-topic:gaming", model::ShelfKind::videos, 16, true},
@@ -332,7 +332,7 @@ const model::Home &Data::home()
for (const model::Video &video : source.page.videos)
{
// Continue watching holds what was started and not finished.
- if (shelf.id == "continue" && (video.watched || video.progress < 0.02f || video.progress > 0.97f))
+ if (shelf.id == "continue" && (video.watched || video.progress <= 0.0f || video.progress >= 0.97f))
continue;
if (shelf.id == "live" && !(video.badges & model::kBadgeLive))
continue;
diff --git a/native/afterglow/frame.hpp b/native/afterglow/frame.hpp
index 6c32831a..576c5ffb 100644
--- a/native/afterglow/frame.hpp
+++ b/native/afterglow/frame.hpp
@@ -72,6 +72,7 @@ class Frame final : private Nav
// One step: time, data, pictures, input, screens. dt is seconds since the
// previous call.
+ ImageCache &image_cache() { return images_; }
void update(const InputFrame &input, float dt, std::string_view typed = {});
// Builds the frame's two layers, back to front: world, then (after the
// renderer has made its blurred copy of world, where it can) ui. glass is
@@ -108,7 +109,9 @@ class Frame final : private Nav
void set_reduced_motion(bool reduced)
{
+ if (options_.reduced_motion == reduced) return;
options_.reduced_motion = reduced;
+ set_scheme(options_.scheme); // refresh dialog/toast component motion too
}
const Look &look() const
{
diff --git a/native/afterglow/screens/home.cpp b/native/afterglow/screens/home.cpp
index fc54ed6f..aa22da92 100644
--- a/native/afterglow/screens/home.cpp
+++ b/native/afterglow/screens/home.cpp
@@ -28,6 +28,7 @@ void Home::enter(const Route &route, UpdateContext &context, bool restored)
{
// Back from a video or a page: what was watched may have moved shelves.
context.services.data.forget("history");
+ context.services.data.forget("continue-watching");
return;
}
age_ = 0.0f;
diff --git a/native/afterglow/screens/home_input.cpp b/native/afterglow/screens/home_input.cpp
index e0d08e04..b9ebc0dd 100644
--- a/native/afterglow/screens/home_input.cpp
+++ b/native/afterglow/screens/home_input.cpp
@@ -128,6 +128,7 @@ void Home::handle(const InputFrame &input, UpdateContext &context)
context.nav.actions(video.id, video.title, [data, account]
{
data->forget("history");
+ data->forget("continue-watching");
if (!account)
return;
for (const char *catalog : {"library:home", "library:subscriptions", "section:trending", "library:watch_later"})
diff --git a/native/afterglow/screens/settings_model.cpp b/native/afterglow/screens/settings_model.cpp
index d6d35591..477832b9 100644
--- a/native/afterglow/screens/settings_model.cpp
+++ b/native/afterglow/screens/settings_model.cpp
@@ -58,6 +58,17 @@ constexpr Rule kRules[] = {
// ---- Player ----
{"settings:max-quality", "player", "Picture"},
{"settings:auto-max", "player", "Picture"},
+ {"settings:catchup", "content", "Subscription catch-up"},
+ {"settings:reliability", "player", "Playback and maintenance"},
+ {"settings:channel-prefs", "player", "Channel preferences"},
+ {"settings:session-recovery", "player", "Interrupted session"},
+ {"settings:playback-diagnostics", "player", "Playback diagnostics"},
+ {"settings:storage", "backup", "Storage and cache"},
+ {"settings:quick-switch", "player", "Quick Switch"},
+ {"account:notice:backup-preview", "backup", "Import preview"},
+ {"settings:presets", "player", "Playback presets"},
+ {"settings:accessibility", "interface", "Accessibility"},
+ {"settings:rest", "player", "Sleep timer"},
{"settings:smart", "content", "Smart playlists"},
{"settings:session", "content", "Viewing sessions"},
{"settings:family", "content", "Family profiles"},
diff --git a/native/afterglow/text_engine.cpp b/native/afterglow/text_engine.cpp
index 516282f4..7432d9ac 100644
--- a/native/afterglow/text_engine.cpp
+++ b/native/afterglow/text_engine.cpp
@@ -135,7 +135,7 @@ tube::text::Style TextEngine::style_of(const gfx::Font &font, float size, float
if (bound.font == &font)
style = bound.style;
}
- style.size = size;
+ style.size = size * text_scale_;
style.tracking = tracking;
return style;
}
diff --git a/native/afterglow/text_engine.hpp b/native/afterglow/text_engine.hpp
index 6087f57f..2d5249e7 100644
--- a/native/afterglow/text_engine.hpp
+++ b/native/afterglow/text_engine.hpp
@@ -75,6 +75,7 @@ class TextEngine final : public gfx::Font::Shaper
return missing_;
}
+ void set_text_scale(float scale) { text_scale_ = scale < 1.0f ? 1.0f : scale > 1.2f ? 1.2f : scale; }
bool knows(const gfx::Font &font) const override;
float measure(const gfx::Font &font, std::string_view text, float size, float tracking) override;
std::string fit(const gfx::Font &font, std::string_view text, float size, float max_width, float tracking) override;
@@ -84,6 +85,7 @@ class TextEngine final : public gfx::Font::Shaper
bool has_glyph(const gfx::Font &font, std::uint32_t codepoint) override;
private:
+ float text_scale_ = 1.0f;
TextEngine(Platform &platform, std::unique_ptr context);
tube::text::Style style_of(const gfx::Font &font, float size, float tracking) const;
void ensure_pages();
diff --git a/native/maxd/brand.h b/native/maxd/brand.h
index 2a9d368e..9ce0f18a 100644
--- a/native/maxd/brand.h
+++ b/native/maxd/brand.h
@@ -2,7 +2,7 @@
#ifndef YOUTUBE_MAXD_BRAND_H
#define YOUTUBE_MAXD_BRAND_H
#define YM_APP_NAME "YouTube Max’d"
-#define YM_VERSION "1.5.0"
+#define YM_VERSION "1.6.0"
#define YM_RED_RGB 255, 48, 79
#define YM_SOFT_RED_RGB 255, 165, 170
#define YM_WHITE_RGB 255, 255, 255
diff --git a/native/maxd/phone_remote_page.h b/native/maxd/phone_remote_page.h
index dd3b815e..ecf071a9 100644
--- a/native/maxd/phone_remote_page.h
+++ b/native/maxd/phone_remote_page.h
@@ -7,8 +7,8 @@ static const char maxd_phone_remote_page[]=
"\n"
"
YouTube Max\u2019d
Phone remote \u00b7 runs on your PS5
Connecting\u2026
\n"
"\n"
-"
Search on the TV
Type here, then browse results on the TV with the controls below.
\n"
-"\n"
+"
Phone keyboard
Type a search on your phone and send it to the PS5. Your draft stays here until it is accepted; browse results with the TV controls below.
\n"
+"\n"
"
Playback
No video playing
\n"
"
TV navigation
\n"
"
Play queue
Play next moves a video to the front of the upcoming queue. Select it on the TV to start it now.
\n"
@@ -113,7 +113,7 @@ static const char maxd_phone_remote_page[]=
" }catch(e){failed(e,sent&&!e.status);return false;}finally{working=false;syncButtons();restoreControlFocus(focus);}\n"
"}\n"
"$('reconnect').onclick=()=>refresh();\n"
-"$('search').onsubmit=e=>{e.preventDefault();const text=$('query').value.trim();if(text)command('search',text);};\n"
+"$('search').onsubmit=e=>{e.preventDefault();const text=$('query').value.trim();if(!text){message('Type a search before sending it to the PS5.',true);$('query').focus();return;}if(new TextEncoder().encode(text).length>800){message('This search is too long. Keep it within 800 UTF-8 bytes.',true);return;}command('search',text);};\n"
"$('add').onsubmit=e=>{e.preventDefault();const id=idFrom($('video').value);if(!id){message('Enter a YouTube video link or an 11-character video ID.',true);return;}command('add',id);};\n"
"for(const b of document.querySelectorAll('[data-action]'))b.onclick=()=>command(b.dataset.action);\n"
"for(const b of document.querySelectorAll('[data-key]'))b.onclick=()=>command('key',b.dataset.key);\n"
diff --git a/native/maxd/phone_remote_page.html b/native/maxd/phone_remote_page.html
index afcfa4d9..64108288 100644
--- a/native/maxd/phone_remote_page.html
+++ b/native/maxd/phone_remote_page.html
@@ -5,8 +5,8 @@
YouTube Max’d
Phone remote · runs on your PS5
Connecting…
-
Search on the TV
Type here, then browse results on the TV with the controls below.
-
+
Phone keyboard
Type a search on your phone and send it to the PS5. Your draft stays here until it is accepted; browse results with the TV controls below.
+
Playback
No video playing
TV navigation
Play queue
Play next moves a video to the front of the upcoming queue. Select it on the TV to start it now.
@@ -111,7 +111,7 @@
Bug-report export
Capture technical playback details. Reports exclude
}catch(e){failed(e,sent&&!e.status);return false;}finally{working=false;syncButtons();restoreControlFocus(focus);}
}
$('reconnect').onclick=()=>refresh();
-$('search').onsubmit=e=>{e.preventDefault();const text=$('query').value.trim();if(text)command('search',text);};
+$('search').onsubmit=e=>{e.preventDefault();const text=$('query').value.trim();if(!text){message('Type a search before sending it to the PS5.',true);$('query').focus();return;}if(new TextEncoder().encode(text).length>800){message('This search is too long. Keep it within 800 UTF-8 bytes.',true);return;}command('search',text);};
$('add').onsubmit=e=>{e.preventDefault();const id=idFrom($('video').value);if(!id){message('Enter a YouTube video link or an 11-character video ID.',true);return;}command('add',id);};
for(const b of document.querySelectorAll('[data-action]'))b.onclick=()=>command(b.dataset.action);
for(const b of document.querySelectorAll('[data-key]'))b.onclick=()=>command('key',b.dataset.key);
diff --git a/native/maxd/picker_tools.cpp.inc b/native/maxd/picker_tools.cpp.inc
index 327bb369..f703c6a9 100644
--- a/native/maxd/picker_tools.cpp.inc
+++ b/native/maxd/picker_tools.cpp.inc
@@ -34,6 +34,7 @@ void AudioTrackPickerScreen::maxdHealth() {
Entry e;e.kind=KindTubeNotice;
char status[256];tube_maxd_health_summary(status,sizeof status);
e.label=status;e.detail=tube_maxd_health_action();m_tracks.push_back(e);
+ e.label="Playback diagnostics";e.detail=tube_maxd_playback_diagnosis();m_tracks.push_back(e);
if(!m_maxdOwner || m_maxdOwner!=tube_phone_selection()) {
e.label="This video is no longer active";e.detail="Return to the current video before opening playback health";m_tracks.push_back(e);return;
}
diff --git a/native/maxd/quick_switch.h b/native/maxd/quick_switch.h
new file mode 100644
index 00000000..a3f44b89
--- /dev/null
+++ b/native/maxd/quick_switch.h
@@ -0,0 +1,16 @@
+/* A long Touchpad hold preserves short taps and fires once per hold.
+ * SPDX-License-Identifier: GPL-3.0-or-later */
+#ifndef MAXD_QUICK_SWITCH_H
+#define MAXD_QUICK_SWITCH_H
+#include
+typedef struct { int tracking,opened; int64_t since; } MaxdQuickSwitch;
+enum { MAXD_QUICK_NONE,MAXD_QUICK_OPEN,MAXD_QUICK_TAP,MAXD_QUICK_WAIT };
+static inline int maxd_quick_switch(MaxdQuickSwitch *s,int pressed,int held,int released,int cancel,int64_t now) {
+ if(cancel || now<0 || (s->tracking && nowsince)){s->tracking=s->opened=0;return MAXD_QUICK_NONE;}
+ if(pressed&&!s->tracking){s->tracking=1;s->opened=0;s->since=now;}
+ if(!s->tracking)return MAXD_QUICK_NONE;
+ if(released||!held){int tap=!s->opened;s->tracking=s->opened=0;return tap?MAXD_QUICK_TAP:MAXD_QUICK_NONE;}
+ if(!s->opened && now-s->since>=650){s->opened=1;return MAXD_QUICK_OPEN;}
+ return MAXD_QUICK_WAIT;
+}
+#endif
diff --git a/native/maxd/reliability_catalog.h b/native/maxd/reliability_catalog.h
new file mode 100644
index 00000000..f2362208
--- /dev/null
+++ b/native/maxd/reliability_catalog.h
@@ -0,0 +1,128 @@
+/* Reliability controls, using the provider's existing save and playback paths.
+ * SPDX-License-Identifier: GPL-3.0-or-later */
+int tube_maxd_channel_leveling(void) {
+ if(!g_maxd_playing)return -1;
+ const Record *r=record_for(g_active_id,g_active_profile,0);
+ const MaxdChannelPref *p=r?maxd_channel_pref(&g_maxd_reliability,g_active_profile,r->item.parent_id,0):NULL;
+ return p?p->leveling:-1;
+}
+const char *tube_maxd_playback_diagnosis(void) {
+ if(!g_maxd_failure.count || strcmp(g_maxd_failure.profile,g_library_profile))return "No playback failure has been recorded in this profile's current session.";
+ switch(g_maxd_failure.code) {
+ case 1:return "A source or resolve request failed. Retry to refresh the stream; the error alone does not identify a network or URL-expiry cause.";
+ case 2:return "The video decoder reported an error. Try an available AVC format at up to 1080p30 SDR in Playback health & rescue.";
+ case 3:return "The audio decoder reported an error. Try another audio track or resolve the video again.";
+ case 4:return "Sustained buffering was observed. Try a lower quality in Playback health & rescue.";
+ case 5:return "The resolver returned no supported playback formats. Retry with Auto codec or review this channel's quality ceiling.";
+ default:return "No classified playback failure was recorded.";
+ }
+}
+static int maxd_reliability_catalog(const char *parent,int page,evo_provider_items_cb cb,void *ud) {
+ if(!parent)return 0;
+ const char *base=!strcmp(parent,"settings:reliability")?"settings:reliability":!strncmp(parent,"settings:channel-prefs",22)?"settings:channel-prefs":
+ !strncmp(parent,"settings:session-recovery",25)?"settings:session-recovery":
+ !strncmp(parent,"settings:storage",16)?"settings:storage":
+ !strcmp(parent,"settings:playback-diagnostics")?"settings:playback-diagnostics":
+ !strcmp(parent,"settings:quick-switch")?"settings:quick-switch":NULL;
+ if(!base)return 0;
+ evo_provider_item_t out[32];int n=0;const char *action="";
+ if(strcmp(parent,base) && !maxd_viewing_owner(parent,base,&action)){tube_set_error("Reopen this page for the current profile.");cb(0,NULL,0,0,ud);return 1;}
+ if(page && strcmp(base,"settings:channel-prefs")){cb(1,NULL,0,0,ud);return 1;}
+ char id[160],detail[256];
+#define MAXD_RELIABLE_ROW(key,title,help,kind) do { \
+ snprintf(id,sizeof id,"%s:%s:%s",base,g_library_profile,key);CATALOG_FOLDER(id,title,help);maxd_smart_fact(id,kind,title,""); \
+} while(0)
+ if(!strcmp(base,"settings:reliability")) {
+ const char *ids[]={"settings:channel-prefs","settings:session-recovery","settings:playback-diagnostics","settings:quick-switch","settings:storage","settings:backup"};
+ const char *names[]={"Channel preferences","Interrupted session","Playback diagnostics","Quick Switch","Storage and cache","Offline backup and restore"};
+ for(int i=0;i<6;++i){CATALOG_FOLDER(ids[i],names[i],"Open these controls");maxd_smart_fact(ids[i],"page",names[i],"");}
+ } else if(!strcmp(base,"settings:quick-switch")) {
+ const char *ids[]={"continue-watching","library:subscriptions","search-history","queue"};
+ const char *names[]={"Continue Watching","Subscriptions","Search","Play queue"};
+ for(int i=0;i<4;++i){CATALOG_FOLDER(ids[i],names[i],i==2?"Square starts a new search; recent queries remain available":"Jump to this page");maxd_smart_fact(ids[i],"link",names[i],"");tube_row_fact(ids[i],"screen",i==2?"search":"grid");tube_row_fact(ids[i],"argument",i==2?"":ids[i]);}
+ } else if(!strcmp(base,"settings:playback-diagnostics")) {
+ CATALOG_FOLDER("account:notice","Last observed playback failure",tube_maxd_playback_diagnosis());
+ CATALOG_FOLDER("account:notice:diagnostics","Recovery options","During playback, press R2 and select Playback health & rescue to review lower-quality and compatible AVC alternatives. Alternatives depend on the formats already resolved.");
+ CATALOG_FOLDER("settings:codec","Default codec","Select Auto or another supported codec for future resolves");
+ } else if(!strcmp(base,"settings:session-recovery")) {
+ MaxdCheckpoint *p=maxd_checkpoint(&g_maxd_reliability,g_library_profile,0);
+ if(!p || !p->pending){CATALOG_FOLDER("account:notice","No interrupted session","Normal exits keep your queue and positions without an interruption offer");}
+ else if(!strcmp(action,"dismiss")){p->pending=p->active=0;save();CATALOG_FOLDER("queue","Open play queue","The queue and saved video history were kept");}
+ else if(!strcmp(action,"resume")) {
+ Record *r=record(p->video,0);
+ if(!r || r->item.is_live || blocked_identity(r->item.parent_id,r->item.subtitle)>=0){tube_set_error("This saved video is no longer available in this profile.");cb(0,NULL,0,0,ud);return 1;}
+ r->item.resume_pos_sec=p->position;r->item.played=0;out[n++]=r->item;out[0].is_folder=0;out[0].playback_playlist[0]=0;out[0].playback_scope=0;
+ } else if(*action){cb(0,NULL,0,0,ud);return 1;}
+ else {
+ snprintf(detail,sizeof detail,"Saved position %lld:%02lld; queue order is retained. Playback starts only if you select Resume.",(long long)p->position/60,(long long)p->position%60);
+ MAXD_RELIABLE_ROW("resume","Resume interrupted video",detail,"link");
+ tube_row_fact(id,"screen","grid");tube_row_fact(id,"argument",id);
+ CATALOG_FOLDER("queue","Review remaining play queue","Review or reorder saved entries before resuming");maxd_smart_fact("queue","link","Review remaining play queue","");tube_row_fact("queue","screen","grid");tube_row_fact("queue","argument","queue");
+ MAXD_RELIABLE_ROW("dismiss","Dismiss interruption offer","Keep the queue, bookmarks and saved history","action");
+ }
+ } else if(!strcmp(base,"settings:storage")) {
+ unsigned long long bytes=0;int pictures=0;
+ int available=tube_maxd_thumbnail_cache?tube_maxd_thumbnail_cache(&bytes,&pictures,0):0;
+ if(!strcmp(action,"thumbnails")) {
+ if(!available || !tube_maxd_thumbnail_cache(&bytes,&pictures,1)){tube_set_error("The Afterglow thumbnail cache is not active. Open Afterglow first.");cb(0,NULL,0,0,ud);return 1;}
+ bytes=0;pictures=0;
+ } else if(!strcmp(action,"captions")) {
+ int busy=g_maxd_playing || (tube_phone_owns_media && tube_phone_owns_media());for(int i=0;iheight==values[i])next=(i+1)%6;p->height=values[next];save();}
+ else if(!strcmp(operation,"speed")){const int values[]={0,50,75,100,125,150,200};int next=0;for(int i=0;i<7;++i)if(p->speed==values[i])next=(i+1)%7;p->speed=values[next];save();}
+ else if(!strcmp(operation,"captions")){p->captions=p->captions==1?-1:p->captions+1;save();}
+ else if(!strcmp(operation,"leveling")){p->leveling=p->leveling==1?-1:p->leveling+1;save();}
+ else if(!strcmp(operation,"reset") && p){int at=(int)(p-g_maxd_reliability.channels);memmove(p,p+1,(size_t)(--g_maxd_reliability.count-at)*sizeof *p);p=NULL;save();}
+ else if(*operation && strcmp(operation,"reset")){cb(0,NULL,0,0,ud);return 1;}
+ char key[64];
+#define MAXD_CHANNEL_ROW(verb,title,help) do {snprintf(key,sizeof key,"%s:%s",channel,verb);MAXD_RELIABLE_ROW(key,title,help,"action");}while(0)
+ if(p && p->height)snprintf(detail,sizeof detail,"Up to %dp; still respects the profile ceiling",p->height);else copy(detail,sizeof detail,"Inherit profile quality ceiling");
+ MAXD_CHANNEL_ROW("quality","Quality ceiling",detail);
+ if(p && p->speed)snprintf(detail,sizeof detail,"%.2gx for future videos",p->speed/100.0);else copy(detail,sizeof detail,"Use existing profile/video/channel speed memory");
+ MAXD_CHANNEL_ROW("speed","Playback speed",detail);
+ MAXD_CHANNEL_ROW("captions","Captions",!p||p->captions<0?"Inherit existing caption preferences":p->captions?"On for this channel":"Off for this channel");
+ MAXD_CHANNEL_ROW("leveling","Volume leveling",!p||p->leveling<0?"Inherit profile; requires loudness metadata":p->leveling?"On when loudness metadata is available":"Off for this channel");
+ MAXD_CHANNEL_ROW("reset","Reset channel overrides","Keep the existing profile settings and legacy caption/speed memories");
+#undef MAXD_CHANNEL_ROW
+ }
+#undef MAXD_RELIABLE_ROW
+ cb(1,out,n,0,ud);return 1;
+}
diff --git a/native/maxd/reliability_store.h b/native/maxd/reliability_store.h
new file mode 100644
index 00000000..e57dffa6
--- /dev/null
+++ b/native/maxd/reliability_store.h
@@ -0,0 +1,61 @@
+/* Channel overrides and interruption checkpoints. No account credentials.
+ * SPDX-License-Identifier: GPL-3.0-or-later */
+#ifndef MAXD_RELIABILITY_STORE_H
+#define MAXD_RELIABILITY_STORE_H
+#include "smart_rules.h"
+#define MAXD_CHANNEL_PREFS 256
+#define MAXD_CHECKPOINTS 128
+typedef struct { char profile[33],channel[25]; int height,speed,captions,leveling; } MaxdChannelPref;
+typedef struct { char profile[33],video[12]; int64_t position,duration; int active,pending; } MaxdCheckpoint;
+typedef struct { MaxdChannelPref channels[MAXD_CHANNEL_PREFS]; int count; MaxdCheckpoint sessions[MAXD_CHECKPOINTS]; int sessions_count; } MaxdReliabilityStore;
+static inline int maxd_reliability_id(const char *s,size_t length) {
+ if(!s || strlen(s)!=length)return 0;
+ for(size_t i=0;i='A'&&c<='Z')||(c>='a'&&c<='z')||(c>='0'&&c<='9')||c=='_'||c=='-'))return 0;}
+ return 1;
+}
+static inline MaxdChannelPref *maxd_channel_pref(MaxdReliabilityStore *s,const char *profile,const char *channel,int create) {
+ if(!profile || !channel)return NULL;
+ for(int i=0;icount;++i)if(!strcmp(s->channels[i].profile,profile)&&!strcmp(s->channels[i].channel,channel))return &s->channels[i];
+ if(!create || s->count>=MAXD_CHANNEL_PREFS || !maxd_smart_text(profile,32,0) || !maxd_reliability_id(channel,24) || strncmp(channel,"UC",2))return NULL;
+ MaxdChannelPref *p=&s->channels[s->count++];memset(p,0,sizeof *p);p->captions=p->leveling=-1;
+ snprintf(p->profile,sizeof p->profile,"%s",profile);snprintf(p->channel,sizeof p->channel,"%s",channel);return p;
+}
+static inline MaxdCheckpoint *maxd_checkpoint(MaxdReliabilityStore *s,const char *profile,int create) {
+ for(int i=0;isessions_count;++i)if(!strcmp(s->sessions[i].profile,profile))return &s->sessions[i];
+ if(!create || s->sessions_count>=MAXD_CHECKPOINTS || !maxd_smart_text(profile,32,0))return NULL;
+ MaxdCheckpoint *p=&s->sessions[s->sessions_count++];memset(p,0,sizeof *p);snprintf(p->profile,sizeof p->profile,"%s",profile);return p;
+}
+static inline void maxd_reliability_forget(MaxdReliabilityStore *s,const char *profile) {
+ for(int i=s->count-1;i>=0;--i)if(!strcmp(s->channels[i].profile,profile)){memmove(s->channels+i,s->channels+i+1,(size_t)(s->count-i-1)*sizeof s->channels[0]);--s->count;}
+ for(int i=s->sessions_count-1;i>=0;--i)if(!strcmp(s->sessions[i].profile,profile)){memmove(s->sessions+i,s->sessions+i+1,(size_t)(s->sessions_count-i-1)*sizeof s->sessions[0]);--s->sessions_count;}
+}
+static inline void maxd_reliability_write(const MaxdReliabilityStore *s,cJSON *root) {
+ cJSON *channels=cJSON_AddArrayToObject(root,"maxd_channel_preferences"),*sessions=cJSON_AddArrayToObject(root,"maxd_checkpoints");
+ for(int i=0;icount;++i){const MaxdChannelPref *p=&s->channels[i];cJSON *o=cJSON_CreateObject();
+ cJSON_AddStringToObject(o,"profile",p->profile);cJSON_AddStringToObject(o,"channel",p->channel);
+ cJSON_AddNumberToObject(o,"height",p->height);cJSON_AddNumberToObject(o,"speed",p->speed);cJSON_AddNumberToObject(o,"captions",p->captions);cJSON_AddNumberToObject(o,"leveling",p->leveling);cJSON_AddItemToArray(channels,o);}
+ for(int i=0;isessions_count;++i){const MaxdCheckpoint *p=&s->sessions[i];cJSON *o=cJSON_CreateObject();
+ cJSON_AddStringToObject(o,"profile",p->profile);cJSON_AddStringToObject(o,"video",p->video);cJSON_AddNumberToObject(o,"position",(double)p->position);
+ cJSON_AddNumberToObject(o,"duration",(double)p->duration);cJSON_AddBoolToObject(o,"active",p->active);cJSON_AddItemToArray(sessions,o);}
+}
+static inline int maxd_override(const cJSON *o,const char *key) {
+ const cJSON *v=cJSON_GetObjectItemCaseSensitive(o,key);return cJSON_IsNumber(v) && (v->valuedouble==0 || v->valuedouble==1)?v->valueint:-1;
+}
+static inline void maxd_reliability_read(MaxdReliabilityStore *s,const cJSON *root) {
+ memset(s,0,sizeof *s);const cJSON *o,*rows=cJSON_GetObjectItemCaseSensitive(root,"maxd_channel_preferences");
+ if(cJSON_IsArray(rows))cJSON_ArrayForEach(o,rows){const char *owner=maxd_smart_string(o,"profile"),*channel=maxd_smart_string(o,"channel");
+ if(maxd_channel_pref(s,owner,channel,0))continue;
+ MaxdChannelPref *p=maxd_channel_pref(s,owner,channel,1);if(!p)continue;
+ int height=(int)maxd_smart_integer(o,"height",2160,0);const int heights[]={144,240,360,480,720,1080,1440,2160};
+ for(int j=0;j<8;++j)if(height==heights[j])p->height=height;
+ p->speed=(int)maxd_smart_integer(o,"speed",400,0);if(p->speed && p->speed!=50 && p->speed!=75 && p->speed!=100 && p->speed!=125 && p->speed!=150 && p->speed!=200)p->speed=0;
+ p->captions=maxd_override(o,"captions");p->leveling=maxd_override(o,"leveling");}
+ rows=cJSON_GetObjectItemCaseSensitive(root,"maxd_checkpoints");
+ if(cJSON_IsArray(rows))cJSON_ArrayForEach(o,rows){const char *owner=maxd_smart_string(o,"profile"),*video=maxd_smart_string(o,"video");
+ if(!maxd_reliability_id(video,11) || maxd_checkpoint(s,owner,0))continue;
+ int64_t position=maxd_smart_integer(o,"position",1000000,-1),duration=maxd_smart_integer(o,"duration",1000000,-1);
+ if(position<0 || duration<1 || position>=duration)continue;
+ MaxdCheckpoint *p=maxd_checkpoint(s,owner,1);if(!p)continue;
+ snprintf(p->video,sizeof p->video,"%s",video);p->position=position;p->duration=duration;p->active=p->pending=cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(o,"active"));}
+}
+#endif
diff --git a/native/maxd/smart_catalog.h b/native/maxd/smart_catalog.h
index 7b0abc40..df360a8e 100644
--- a/native/maxd/smart_catalog.h
+++ b/native/maxd/smart_catalog.h
@@ -69,6 +69,12 @@ static void maxd_smart_scanned(int ok,const evo_provider_item_t *items,int count
for(int i=0;icountis_folder || !valid_id(item->id) || blocked_identity(item->parent_id,item->subtitle)>=0)continue;
+ if(rule->catchup) {
+ if(rule->hide_shorts && !strcmp(tube_row_fact_get(item->id,"is_short"),"1"))continue;
+ int allowed=!rule->channel_count;
+ for(int j=0;jchannel_count;++j)allowed|=!strcmp(rule->channels[j],item->parent_id);
+ if(!allowed)continue;
+ }
int played=item->played;const Record *known=record(item->id,0);if(known && known->item.played)played=1;
if(!maxd_smart_matches(rule,item->title,item->subtitle,item->duration_sec,played,item->is_live,
!strcmp(tube_row_fact_get(item->id,"is_upcoming"),"1")))continue;
@@ -187,10 +193,47 @@ static void maxd_smart_fact(const char *id,const char *kind,const char *label,co
tube_row_fact(id,"kind",kind);tube_row_fact(id,"label",label);tube_row_fact(id,"value",value);
if(!strcmp(kind,"text"))tube_row_fact(id,"text",value);
}
+typedef struct { uint32_t rule; unsigned scope; char profile[33]; evo_provider_items_cb callback; void *data; } MaxdCatchupEnqueue;
+static void maxd_catchup_enqueued(int ok,const evo_provider_item_t *items,int count,int more,void *data) {
+ (void)items;(void)count;(void)more;MaxdCatchupEnqueue *request=data;
+ evo_provider_item_t out[2];memset(out,0,sizeof out);int added=0;
+ MaxdSmartCache *cache=NULL;
+ if(ok && request->scope==g_playlist_scope && !strcmp(request->profile,g_library_profile))
+ for(int i=0;irule && g_maxd_smart_cache[i].scope==request->scope &&
+ !strcmp(g_maxd_smart_cache[i].profile,request->profile) && (!cache || cache->serialcallback(0,NULL,0,0,request->data);free(request);return;}
+ for(int i=0;icount;++i) {
+ const evo_provider_item_t *item=&cache->items[i];
+ Record *r=record(item->id,1);if(!r || r->queued || blocked_identity(item->parent_id,item->subtitle)>=0 || g_queue_order==INT64_MAX)continue;
+ if(!*r->item.title)r->item=*item;
+ r->item.playback_playlist[0]=0;r->item.playback_scope=0;r->item.playback_index=0;
+ r->queued=1;r->queued_music=0;r->queue_order=++g_queue_order;++added;
+ }
+ save();out[0].is_folder=out[1].is_folder=1;
+ copy(out[0].id,sizeof out[0].id,"account:notice");snprintf(out[0].title,sizeof out[0].title,"Added %d videos to your queue",added);
+ copy(out[0].subtitle,sizeof out[0].subtitle,g_storage_notice?"Queue changed for this session only; check storage":cache->limited?"Scan limit reached; preview and narrow your filters for other uploads":"Existing queue entries were kept; no playback started");
+ copy(out[1].id,sizeof out[1].id,"queue");copy(out[1].title,sizeof out[1].title,"Open play queue");
+ request->callback(1,out,2,0,request->data);free(request);
+}
static int maxd_smart_catalog(const char *parent,int page,evo_provider_items_cb cb,void *ud) {
- if(!parent || (strncmp(parent,"settings:smart",14) && strncmp(parent,"settings:session",16)))return 0;
+ if(!parent || (strncmp(parent,"settings:smart",14) && strncmp(parent,"settings:session",16) && strncmp(parent,"settings:catchup",16)))return 0;
evo_provider_item_t out[32];int n=0;
- if(page) { cb(1,NULL,0,0,ud);return 1; }
+ if(page && !strstr(parent,":channels")) { cb(1,NULL,0,0,ud);return 1; }
+ if(!strcmp(parent,"settings:catchup") || !strncmp(parent,"settings:catchup:new:",21)) {
+ if(strncmp(parent,"settings:catchup:new:",21)==0) {
+ if(strcmp(parent+21,g_library_profile)){cb(0,NULL,0,0,ud);return 1;}
+ MaxdSmartRule *created=maxd_smart_create(&g_maxd_smart_store,g_library_profile,"Subscription catch-up");
+ if(!created){tube_set_error("Smart playlist storage is full. Remove a saved rule first.");cb(0,NULL,0,0,ud);return 1;}
+ created->source=1;created->catchup=created->hide_shorts=1;created->session_minutes=30;save();
+ }
+ char id[100];snprintf(id,sizeof id,"settings:catchup:new:%s",g_library_profile);
+ CATALOG_FOLDER(id,"Create catch-up queue","Subscriptions, unwatched uploads, chosen channels and a time budget");maxd_smart_fact(id,"action","Create catch-up queue","");
+ for(int i=0;icatchup || strcmp(r->profile,g_library_profile))continue;
+ snprintf(id,sizeof id,"settings:smart:%u",r->id);CATALOG_FOLDER(id,r->name,"Edit filters, preview matching videos or append them to your play queue");maxd_smart_fact(id,"page",r->name,"");
+ }
+ cb(1,out,n,0,ud);return 1;
+ }
if(!strcmp(parent,"settings:session")) {
CATALOG_FOLDER("settings:session:new","Create viewing session","Choose a time budget and source; builds an unwatched queue");
maxd_smart_fact(out[n-1].id,"text","Create viewing session","");
@@ -226,6 +269,13 @@ static int maxd_smart_catalog(const char *parent,int page,evo_provider_items_cb
CATALOG_FOLDER("account:notice","Enter your playlist rule","No YouTube account changes are made");cb(1,out,n,0,ud);return 1;
}
if(!r){tube_set_error("Reopen Smart playlists for this profile.");cb(0,NULL,0,0,ud);return 1;}
+ if(r->catchup && !strcmp(action,"enqueue")) {
+ MaxdCatchupEnqueue *request=calloc(1,sizeof *request);
+ if(!request){cb(0,NULL,0,0,ud);return 1;}
+ request->rule=id;request->scope=g_playlist_scope;request->callback=cb;request->data=ud;
+ copy(request->profile,sizeof request->profile,g_library_profile);
+ maxd_smart_run(id,0,maxd_catchup_enqueued,request);return 1;
+ }
if(!strcmp(action,"delete")) {
char row[80];snprintf(row,sizeof row,"settings:smart:%u:delete-confirm",id);
CATALOG_FOLDER(row,"Delete this smart playlist","Cross confirms local deletion; Circle keeps it");
@@ -236,13 +286,43 @@ static int maxd_smart_catalog(const char *parent,int page,evo_provider_items_cb
memmove(r,r+1,(size_t)(g_maxd_smart_store.count-at-1)*sizeof *r);--g_maxd_smart_store.count;save();
return maxd_smart_catalog("settings:smart",0,cb,ud);
}
+ if(r->catchup && (!strcmp(action,"channels") || !strncmp(action,"channel:",8))) {
+ if(!strncmp(action,"channel:",8)) {
+ const char *channel=action+8;
+ if(!valid_channel(channel)){cb(0,NULL,0,0,ud);return 1;}
+ int at=-1;for(int i=0;ichannel_count;++i)if(!strcmp(r->channels[i],channel))at=i;
+ if(at>=0){memmove(r->channels+at,r->channels+at+1,(size_t)(--r->channel_count-at)*sizeof r->channels[0]);}
+ else if(r->channel_count<8)copy(r->channels[r->channel_count++],25,channel);
+ else {tube_set_error("Choose up to eight channels; deselect one first.");cb(0,NULL,0,0,ud);return 1;}
+ save();
+ }
+ char channels[128][25];int count=0;
+ for(int i=0;ichannel_count;++i)copy(channels[count++],25,r->channels[i]);
+ for(int i=0;ichannel_count;++j)selected|=!strcmp(channels[i],r->channels[j]);
+ const char *name=channels[i];for(int j=0;jsession_minutes) {
- const int choices[]={15,30,45,60,90,120};int next=0;
- for(int i=0;i<6;++i)if(r->session_minutes==choices[i])next=(i+1)%6;
+ if(!strcmp(action,"budget") && (r->session_minutes || r->catchup)) {
+ const int choices[]={0,15,30,45,60,90,120};int next=r->catchup?0:1;
+ for(int i=0;i<7;++i)if(r->session_minutes==choices[i])next=(i+1)%7;
+ if(!r->catchup && !next)next=1;
r->session_minutes=choices[next];changed=1;
}
- else if(!strcmp(action,"source")){r->source=(r->source+1)%4;changed=1;}
+ else if(!strcmp(action,"shorts") && r->catchup){r->hide_shorts=!r->hide_shorts;changed=1;}
+ else if(!strcmp(action,"source") && !r->catchup){r->source=(r->source+1)%4;changed=1;}
else if(!strcmp(action,"unwatched")){r->unwatched=!r->unwatched;changed=1;}
else if(!strcmp(action,"live")){r->hide_live=!r->hide_live;changed=1;}
else if(!strcmp(action,"duration")) {
@@ -257,12 +337,17 @@ static int maxd_smart_catalog(const char *parent,int page,evo_provider_items_cb
#define MAXD_SMART_ROW(key,title,detail,kind,shown) do { \
snprintf(row,sizeof row,"settings:smart:%u:%s",id,key);CATALOG_FOLDER(row,title,detail);maxd_smart_fact(row,kind,title,shown); \
} while(0)
- if(r->session_minutes) {
- snprintf(value,sizeof value,"Up to %d minutes",r->session_minutes);
+ if(r->session_minutes || r->catchup) {
+ if(r->session_minutes)snprintf(value,sizeof value,"Up to %d minutes",r->session_minutes);else copy(value,sizeof value,"No time limit");
MAXD_SMART_ROW("budget","Time budget",value,"cycle",value);
}
MAXD_SMART_ROW("name","Name",r->name,"text",r->name);
- MAXD_SMART_ROW("source","Source feed",maxd_smart_source_names[r->source],"cycle",maxd_smart_source_names[r->source]);
+ if(!r->catchup)MAXD_SMART_ROW("source","Source feed",maxd_smart_source_names[r->source],"cycle",maxd_smart_source_names[r->source]);
+ if(r->catchup) {
+ MAXD_SMART_ROW("channels","Choose channels","None selected includes all subscription channels; up to eight explicit channels","page","");
+ MAXD_SMART_ROW("shorts","Hide Shorts",r->hide_shorts?"On":"Off","cycle",r->hide_shorts?"On":"Off");
+ MAXD_SMART_ROW("enqueue","Append matching videos to queue","Keeps existing entries; avoids duplicates; scans at most eight pages","action","");
+ }
MAXD_SMART_ROW("keyword","Title contains",*r->keyword?r->keyword:"Any title","text",r->keyword);
MAXD_SMART_ROW("creator","Creator contains",*r->creator?r->creator:"Any creator","text",r->creator);
if(!r->minimum&&!r->maximum)copy(value,sizeof value,"Any duration");
diff --git a/native/maxd/smart_rules.h b/native/maxd/smart_rules.h
index a423d0ef..fd43a85c 100644
--- a/native/maxd/smart_rules.h
+++ b/native/maxd/smart_rules.h
@@ -13,6 +13,7 @@ typedef struct {
uint32_t id;
char profile[33], name[81], keyword[129], creator[129];
int source, minimum, maximum, unwatched, hide_live, session_minutes;
+ int catchup, hide_shorts, channel_count; char channels[8][25];
} MaxdSmartRule;
typedef struct { MaxdSmartRule rules[MAXD_SMART_RULES]; int count; uint32_t serial; } MaxdSmartStore;
static inline int maxd_smart_text(const char *value, size_t limit, int empty) {
@@ -64,6 +65,9 @@ static inline void maxd_smart_write(const MaxdSmartStore *s,cJSON *root) {
cJSON_AddNumberToObject(o,"id",r->id);cJSON_AddStringToObject(o,"profile",r->profile);
cJSON_AddStringToObject(o,"name",r->name);cJSON_AddStringToObject(o,"keyword",r->keyword);cJSON_AddStringToObject(o,"creator",r->creator);
cJSON_AddNumberToObject(o,"session_minutes",r->session_minutes);cJSON_AddNumberToObject(o,"source",r->source);cJSON_AddNumberToObject(o,"minimum",r->minimum);cJSON_AddNumberToObject(o,"maximum",r->maximum);
+ cJSON_AddBoolToObject(o,"catchup",r->catchup);cJSON_AddBoolToObject(o,"hide_shorts",r->hide_shorts);
+ cJSON *channels=cJSON_AddArrayToObject(o,"channels");
+ for(int j=0;jchannel_count;++j)cJSON_AddItemToArray(channels,cJSON_CreateString(r->channels[j]));
cJSON_AddBoolToObject(o,"unwatched",r->unwatched);cJSON_AddBoolToObject(o,"hide_live",r->hide_live);cJSON_AddItemToArray(rows,o);
}
}
@@ -92,6 +96,17 @@ static inline void maxd_smart_read(MaxdSmartStore *s,const cJSON *root) {
r->session_minutes=(int)maxd_smart_integer(o,"session_minutes",120,0);
r->source=(int)maxd_smart_integer(o,"source",3,0);r->minimum=(int)maxd_smart_integer(o,"minimum",86400,0);r->maximum=(int)maxd_smart_integer(o,"maximum",86400,0);
if(r->maximum && r->maximumminimum)r->minimum=r->maximum=0;
+ r->catchup=cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(o,"catchup"));
+ r->hide_shorts=cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(o,"hide_shorts"));
+ const cJSON *channel,*channels=cJSON_GetObjectItemCaseSensitive(o,"channels");
+ if(cJSON_IsArray(channels))cJSON_ArrayForEach(channel,channels) {
+ if(!cJSON_IsString(channel) || strlen(channel->valuestring)!=24 || strncmp(channel->valuestring,"UC",2) || r->channel_count>=8)continue;
+ int valid=1,duplicate=0;
+ for(int j=2;j<24;++j){char ch=channel->valuestring[j];valid&=(ch>='A'&&ch<='Z')||(ch>='a'&&ch<='z')||(ch>='0'&&ch<='9')||ch=='_'||ch=='-';}
+ for(int j=0;jchannel_count;++j)duplicate|=!strcmp(r->channels[j],channel->valuestring);
+ if(valid&&!duplicate)snprintf(r->channels[r->channel_count++],25,"%s",channel->valuestring);
+ }
+ if(r->catchup)r->source=1;
r->unwatched=!cJSON_IsFalse(cJSON_GetObjectItemCaseSensitive(o,"unwatched"));r->hide_live=!cJSON_IsFalse(cJSON_GetObjectItemCaseSensitive(o,"hide_live"));
}
}
diff --git a/native/maxd/viewing_catalog.h b/native/maxd/viewing_catalog.h
new file mode 100644
index 00000000..9aca2715
--- /dev/null
+++ b/native/maxd/viewing_catalog.h
@@ -0,0 +1,104 @@
+/* Everyday viewing controls in the existing provider. UI thread only.
+ * SPDX-License-Identifier: GPL-3.0-or-later */
+static int maxd_viewing_owner(const char *parent,const char *base,const char **action) {
+ size_t length=strlen(base);if(strncmp(parent,base,length) || parent[length]!=':')return 0;
+ const char *owner=parent+length+1,*end=strchr(owner,':');
+ if(!end || (size_t)(end-owner)!=strlen(g_library_profile) || strncmp(owner,g_library_profile,(size_t)(end-owner)))return 0;
+ *action=end+1;return 1;
+}
+static int maxd_viewing_catalog(const char *parent,int page,evo_provider_items_cb cb,void *ud) {
+ if(!parent)return 0;
+ const int presets=!strncmp(parent,"settings:presets",strlen("settings:presets"));
+ const int access=!strncmp(parent,"settings:accessibility",strlen("settings:accessibility"));
+ const int rest=!strncmp(parent,"settings:rest",strlen("settings:rest"));
+ if(!presets && !access && !rest)return 0;
+ evo_provider_item_t out[24];int n=0;const char *action="";
+ const char *base=presets?"settings:presets":access?"settings:accessibility":"settings:rest";
+ if(page) {cb(1,NULL,0,0,ud);return 1;}
+ if(strcmp(parent,base) && !maxd_viewing_owner(parent,base,&action)) {
+ tube_set_error("Reopen these controls for the current profile.");cb(0,NULL,0,0,ud);return 1;
+ }
+ char id[120],detail[180];
+#define MAXD_VIEW_ROW(key,title,help,kind) do { \
+ snprintf(id,sizeof id,"%s:%s:%s",base,g_library_profile,key); \
+ CATALOG_FOLDER(id,title,help);maxd_smart_fact(id,kind,title,""); \
+} while(0)
+ if(presets) {
+ static const char *names[]={"Movies","Gaming","Listening"};
+ if(!*action) {
+ for(int slot=0;slot<3;++slot) {
+ char key[16];snprintf(key,sizeof key,"%d",slot);
+ MaxdPlaybackPreset *p=maxd_preset_find(&g_maxd_presets,g_library_profile,slot,0);
+ snprintf(detail,sizeof detail,p?"Saved: up to %dp, %s fps; %.2gx speed":"Default: up to %dp, %s fps; %.2gx speed",
+ p?p->height:slot==0?2160:slot==1?1080:720,p?(p->fps==60?"60":p->fps==30?"30":"any"):slot==1?"60":"30",p?p->speed/100.0:1.0);
+ MAXD_VIEW_ROW(key,names[slot],detail,"page");
+ }
+ } else {
+ int slot=action[0]-'0';const char *operation=action+1;
+ if(slot<0 || slot>2 || (*operation && *operation!=':')) {cb(0,NULL,0,0,ud);return 1;}
+ if(*operation)++operation;
+ if(!strcmp(operation,"save")) {
+ MaxdPlaybackPreset *p=maxd_preset_find(&g_maxd_presets,g_library_profile,slot,1);
+ if(!p){tube_set_error("Preset storage is full.");cb(0,NULL,0,0,ud);return 1;}
+ p->height=g_height;p->fps=g_max_fps;p->codec=g_codec;p->speed=g_speed;
+ p->captions=g_captions;p->automatic=g_auto_captions;p->adaptive=g_auto_max;
+ copy(p->language,sizeof p->language,g_language);copy(p->audio,sizeof p->audio,g_audio_language);
+ save();
+ } else if(!strcmp(operation,"apply")) {
+ MaxdPlaybackPreset *p=maxd_preset_find(&g_maxd_presets,g_library_profile,slot,0);
+ if(p && (!valid_speed(p->speed) || language_index(p->language)<0 || (*p->audio && language_index(p->audio)<0))) {
+ tube_set_error("This saved preset is invalid. Save it again.");cb(0,NULL,0,0,ud);return 1;
+ }
+ g_height=p?p->height:slot==0?2160:slot==1?1080:720;g_max_fps=p?p->fps:slot==1?60:30;
+ g_codec=p?p->codec:0;g_speed=p?p->speed:100;g_last_speed=g_speed;
+ if(p) {g_captions=p->captions;g_auto_captions=p->automatic;g_auto_max=p->adaptive;
+ copy(g_language,sizeof g_language,p->language);copy(g_audio_language,sizeof g_audio_language,p->audio);}
+ save();
+ } else if(!strcmp(operation,"reset")) {
+ MaxdPlaybackPreset *p=maxd_preset_find(&g_maxd_presets,g_library_profile,slot,0);
+ if(p){int at=(int)(p-g_maxd_presets.rows);memmove(p,p+1,(size_t)(--g_maxd_presets.count-at)*sizeof *p);save();}
+ } else if(*operation) {cb(0,NULL,0,0,ud);return 1;}
+ char key[24];
+ snprintf(key,sizeof key,"%d:apply",slot);MAXD_VIEW_ROW(key,"Use this preset","Applies to the next resolved video; current playback stays as it is","action");
+ snprintf(key,sizeof key,"%d:save",slot);MAXD_VIEW_ROW(key,"Save current preferences","Save quality, FPS, codec, speed, audio/caption languages and Auto Max to this slot","action");
+ snprintf(key,sizeof key,"%d:reset",slot);MAXD_VIEW_ROW(key,"Reset this slot","Restore the built-in Movies, Gaming or Listening defaults","action");
+ }
+ } else if(access) {
+ if(!strcmp(action,"scale")) {g_ui.ui_scale=g_ui.ui_scale<115?115:g_ui.ui_scale<120?120:100;++g_ui_revision;save();}
+ else if(!strcmp(action,"contrast")) {g_ui.scheme=g_ui.scheme==3?0:3;++g_ui_revision;save();}
+ else if(!strcmp(action,"motion")) {g_ui.reduced_motion=!g_ui.reduced_motion;++g_ui_revision;save();}
+ else if(!strcmp(action,"caption-background")) {
+ int current=tube_extra_subtitle_style_index();
+ if(!tube_extra_set_subtitle_style(current==1?2:current==2?3:1)) {cb(0,NULL,0,0,ud);return 1;}
+ } else if(*action) {cb(0,NULL,0,0,ud);return 1;}
+ snprintf(detail,sizeof detail,"%d%%; cycles 100, 115, 120%%",g_ui.ui_scale);MAXD_VIEW_ROW("scale","Larger interface text",detail,"action");
+ MAXD_VIEW_ROW("contrast","High contrast",g_ui.scheme==3?"On: yellow accent on black":"Off: select to use the high-contrast palette","action");
+ MAXD_VIEW_ROW("motion","Reduced motion",g_ui.reduced_motion?"On: decorative travel is reduced":"Off: select to reduce browser motion","action");
+ int style=tube_extra_subtitle_style_index();
+ snprintf(detail,sizeof detail,"%s; select to cycle white captions",style==1?"Transparent":style==2?"Translucent black":style==3?"Opaque black":"Current player style");
+ MAXD_VIEW_ROW("caption-background","Caption background",detail,"action");
+ CATALOG_FOLDER("settings:subtitle-size","Caption text size","Choose the player caption size");maxd_smart_fact("settings:subtitle-size","page","Caption text size","");
+ } else {
+ if(!strcmp(action,"end")) {
+ if(!tube_sleep_schedule(0,1)){tube_set_error("Start a video before choosing end-of-video sleep.");cb(0,NULL,0,0,ud);return 1;}
+ } else if(!strcmp(action,"off")) tube_sleep_schedule(0,0);
+ else if(*action) {
+ const int minutes[]={15,30,45,60,90,120};int chosen=0;
+ for(int i=0;i<6;++i){char key[16];snprintf(key,sizeof key,"%d",minutes[i]);if(!strcmp(action,key))chosen=minutes[i];}
+ if(!chosen || !tube_sleep_schedule(chosen,0)){cb(0,NULL,0,0,ud);return 1;}
+ }
+ if(tube_sleep_after_video())copy(detail,sizeof detail,"Pauses when this video ends");
+ else if(tube_sleep_scheduled_minutes())snprintf(detail,sizeof detail,"%d min remaining",tube_sleep_scheduled_minutes());
+ else if(tube_sleep_minutes())snprintf(detail,sizeof detail,"Inactivity timer: %d minutes",tube_sleep_minutes());
+ else copy(detail,sizeof detail,"Off");
+ CATALOG_FOLDER("account:notice","Sleep timer status",detail);
+ MAXD_VIEW_ROW("off","Turn sleep timer off","Cancels the session timer and inactivity timer","action");
+ MAXD_VIEW_ROW("end","When this video ends","Pause once instead of repeat, autoplay or the next queued video","action");
+ const int minutes[]={15,30,45,60,90,120};
+ for(int i=0;i<6;++i){char key[16],title[64];snprintf(key,sizeof key,"%d",minutes[i]);snprintf(title,sizeof title,"Pause in %d minutes",minutes[i]);MAXD_VIEW_ROW(key,title,"Elapsed time; input does not restart the timer","action");}
+ CATALOG_FOLDER("settings:sleep-timer","Inactivity timer","Existing input-reset timer; choosing it cancels the session timer");
+ }
+#undef MAXD_VIEW_ROW
+ if(g_storage_notice){tube_set_error("Preferences changed for this session, but could not be saved. Check free space.");cb(0,NULL,0,0,ud);return 1;}
+ cb(1,out,n,0,ud);return 1;
+}
diff --git a/native/maxd/viewing_store.h b/native/maxd/viewing_store.h
new file mode 100644
index 00000000..e6e652e1
--- /dev/null
+++ b/native/maxd/viewing_store.h
@@ -0,0 +1,55 @@
+/* Saved playback slots belong to the actual profile, even with shared settings.
+ * SPDX-License-Identifier: GPL-3.0-or-later */
+#ifndef MAXD_VIEWING_STORE_H
+#define MAXD_VIEWING_STORE_H
+#include "smart_rules.h"
+#define MAXD_PRESET_ROWS 384
+typedef struct {
+ char profile[33], language[16], audio[16];
+ int slot, height, fps, codec, speed, captions, automatic, adaptive;
+} MaxdPlaybackPreset;
+typedef struct { MaxdPlaybackPreset rows[MAXD_PRESET_ROWS]; int count; } MaxdPresetStore;
+static inline MaxdPlaybackPreset *maxd_preset_find(MaxdPresetStore *s,const char *profile,int slot,int create) {
+ for(int i=0;icount;++i)if(s->rows[i].slot==slot&&!strcmp(s->rows[i].profile,profile))return &s->rows[i];
+ if(!create || slot<0 || slot>2 || !maxd_smart_text(profile,32,0) || s->count>=MAXD_PRESET_ROWS)return NULL;
+ MaxdPlaybackPreset *p=&s->rows[s->count++];memset(p,0,sizeof *p);
+ snprintf(p->profile,sizeof p->profile,"%s",profile);p->slot=slot;return p;
+}
+static inline void maxd_presets_forget(MaxdPresetStore *s,const char *profile) {
+ for(int i=s->count-1;i>=0;--i)if(!strcmp(s->rows[i].profile,profile)) {
+ memmove(s->rows+i,s->rows+i+1,(size_t)(s->count-i-1)*sizeof s->rows[0]);--s->count;
+ }
+}
+static inline void maxd_presets_write(const MaxdPresetStore *s,cJSON *root) {
+ cJSON *rows=cJSON_AddArrayToObject(root,"maxd_playback_presets");
+ for(int i=0;icount;++i) {
+ const MaxdPlaybackPreset *p=&s->rows[i];cJSON *o=cJSON_CreateObject();
+ cJSON_AddStringToObject(o,"profile",p->profile);cJSON_AddStringToObject(o,"language",p->language);cJSON_AddStringToObject(o,"audio",p->audio);
+#define MAXD_PRESET_WRITE(field) cJSON_AddNumberToObject(o,#field,p->field)
+ MAXD_PRESET_WRITE(slot);MAXD_PRESET_WRITE(height);MAXD_PRESET_WRITE(fps);MAXD_PRESET_WRITE(codec);MAXD_PRESET_WRITE(speed);
+ MAXD_PRESET_WRITE(captions);MAXD_PRESET_WRITE(automatic);MAXD_PRESET_WRITE(adaptive);
+#undef MAXD_PRESET_WRITE
+ cJSON_AddItemToArray(rows,o);
+ }
+}
+static inline void maxd_presets_read(MaxdPresetStore *s,const cJSON *root) {
+ memset(s,0,sizeof *s);const cJSON *o,*rows=cJSON_GetObjectItemCaseSensitive(root,"maxd_playback_presets");
+ if(!cJSON_IsArray(rows))return;
+ cJSON_ArrayForEach(o,rows) {
+ const char *owner=maxd_smart_string(o,"profile"),*language=maxd_smart_string(o,"language"),*audio=maxd_smart_string(o,"audio");
+ int slot=(int)maxd_smart_integer(o,"slot",2,-1);
+ int height=(int)maxd_smart_integer(o,"height",2160,-1),fps=(int)maxd_smart_integer(o,"fps",60,-1);
+ int codec=(int)maxd_smart_integer(o,"codec",4,-1),speed=(int)maxd_smart_integer(o,"speed",1000,-1);
+ const int heights[]={144,240,360,480,720,1080,1440,2160};int valid_height=0;
+ for(int i=0;i<8;++i)valid_height|=height==heights[i];
+ if(slot<0 || !valid_height || (fps!=0&&fps!=30&&fps!=60) || codec<0 || speed<1 ||
+ !maxd_smart_text(owner,32,0) || !maxd_smart_text(language,15,0) || !maxd_smart_text(audio,15,1) ||
+ maxd_preset_find(s,owner,slot,0))continue;
+ MaxdPlaybackPreset *p=maxd_preset_find(s,owner,slot,1);if(!p)continue;
+ p->height=height;p->fps=fps;p->codec=codec;p->speed=speed;
+ p->captions=(int)maxd_smart_integer(o,"captions",1,1);
+ p->automatic=(int)maxd_smart_integer(o,"automatic",1,0);p->adaptive=(int)maxd_smart_integer(o,"adaptive",1,0);
+ snprintf(p->language,sizeof p->language,"%s",language);snprintf(p->audio,sizeof p->audio,"%s",audio);
+ }
+}
+#endif
diff --git a/native/tube_about_data.h b/native/tube_about_data.h
index 3b7f8833..c37a0cfe 100644
--- a/native/tube_about_data.h
+++ b/native/tube_about_data.h
@@ -3,11 +3,17 @@
#ifndef TUBE_ABOUT_DATA_H
#define TUBE_ABOUT_DATA_H
-#define TUBE_ABOUT_CHANGELOG_VERSION "1.005.000"
-#define TUBE_ABOUT_CHANGELOG_ROWS 50
+#define TUBE_ABOUT_CHANGELOG_VERSION "1.006.000"
+#define TUBE_ABOUT_CHANGELOG_ROWS 56
#define TUBE_ABOUT_CHANGELOG_ROW_BYTES 300
#define TUBE_ABOUT_CHANGELOG_DATA \
+ {"1.006.000", "Add PS5 Continue Watching and subscription catch-up queues with watched/Shorts filters and review before appending."}, \
+ {"1.006.000", "Improve phone keyboard search, add scheduled/end-of-video sleep, playback presets and accessibility controls."}, \
+ {"1.006.000", "Add profile-owned channel quality, speed, caption and volume-leveling preferences."}, \
+ {"1.006.000", "Offer interrupted-session recovery with saved positions and queue review, without autoplay."}, \
+ {"1.006.000", "Add playback diagnostics and hold-Touchpad Quick Switch while browsing."}, \
+ {"1.006.000", "Add scoped cache cleanup and offline backup previews. Preserve app data and PiP off by default; credit ProsperoTube and EVO Player."}, \
{"1.005.000", "Add profile-specific PS5 feed controls: mute title phrases, prioritize locally followed channels and manage blocked channels."}, \
{"1.005.000", "Add playback health and confirmed lower-quality or AVC rescue while keeping position, audio and captions."}, \
{"1.005.000", "Smooth phone remote controls with timeouts, reconnect, duplicate-tap protection and steadier queue focus."}, \
diff --git a/native/tube_backup.c b/native/tube_backup.c
index 2f83983a..2363ae24 100644
--- a/native/tube_backup.c
+++ b/native/tube_backup.c
@@ -145,7 +145,7 @@ static int join(char *out, const char *data_dir, const char *a, const char *b, c
return written < 0 || written >= PATH_SIZE ? TUBE_BACKUP_E_ARGUMENT : TUBE_BACKUP_OK;
}
-int tube_backup_validate_file(const char *path) {
+static int read_backup_root(const char *path,cJSON **parsed) {
if (!path || !*path) return TUBE_BACKUP_E_ARGUMENT;
FILE *file = fopen(path, "rb");
if (!file) return errno == ENOENT ? TUBE_BACKUP_E_MISSING : TUBE_BACKUP_E_IO;
@@ -174,11 +174,13 @@ int tube_backup_validate_file(const char *path) {
version->valuedouble <= TUBE_BACKUP_VERSION_MAX && version->valuedouble == (double)(int)version->valuedouble &&
cJSON_IsArray(cJSON_GetObjectItemCaseSensitive(root, "records"));
}
- cJSON_Delete(root);
+ if(valid && parsed)*parsed=root;else cJSON_Delete(root);
free(body);
return valid ? TUBE_BACKUP_OK : TUBE_BACKUP_E_INVALID;
}
+int tube_backup_validate_file(const char *path) {return read_backup_root(path,NULL);}
+
/* Copy through `` and rename, so `to` is either the complete
* old file or the complete new one. */
static int copy_file(const char *from, const char *to, long long limit) {
@@ -269,6 +271,19 @@ static int backup_path(char *out, const char *data_dir, const char *name) {
return join(out, data_dir, TUBE_BACKUP_DIRECTORY, name, NULL);
}
+int tube_backup_inspect(const char *data_dir,const char *name,tube_backup_summary *summary) {
+ if(!summary)return TUBE_BACKUP_E_ARGUMENT;
+ memset(summary,0,sizeof *summary);char path[PATH_SIZE];int result=backup_path(path,data_dir,name);cJSON *root=NULL;
+ if(result!=TUBE_BACKUP_OK)return result;
+ result=read_backup_root(path,&root);if(result!=TUBE_BACKUP_OK)return result;
+ summary->settings=cJSON_GetArraySize(cJSON_GetObjectItemCaseSensitive(root,"profile_settings"));
+ summary->bookmarks=cJSON_GetArraySize(cJSON_GetObjectItemCaseSensitive(root,"maxd_bookmarks"));
+ summary->channels=cJSON_GetArraySize(cJSON_GetObjectItemCaseSensitive(root,"maxd_channel_preferences"));
+ summary->presets=cJSON_GetArraySize(cJSON_GetObjectItemCaseSensitive(root,"maxd_playback_presets"));
+ const cJSON *row,*records=cJSON_GetObjectItemCaseSensitive(root,"records");summary->records=cJSON_GetArraySize(records);
+ cJSON_ArrayForEach(row,records){summary->favorites+=cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(row,"favorite"));summary->queued+=cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(row,"queued"));}
+ cJSON_Delete(root);return TUBE_BACKUP_OK;
+}
int tube_backup_validate(const char *data_dir, const char *name) {
char path[PATH_SIZE];
int result = backup_path(path, data_dir, name);
diff --git a/native/tube_backup.h b/native/tube_backup.h
index c24f04f2..34fd416c 100644
--- a/native/tube_backup.h
+++ b/native/tube_backup.h
@@ -93,6 +93,9 @@ int tube_backup_create(const char *data_dir, long long now, char *name_out, size
int tube_backup_list(const char *data_dir, tube_backup_entry *out, int max);
int tube_backup_validate(const char *data_dir, const char *name);
+typedef struct { int settings,records,favorites,queued,bookmarks,channels,presets; } tube_backup_summary;
+/* Counts only, from the same bounded parser; no secrets or account names. */
+int tube_backup_inspect(const char *data_dir,const char *name,tube_backup_summary *summary);
/* Replace the state file with a validated backup. The state being replaced
* is first copied byte for byte to a "-safety" backup (named in `safety_out`
diff --git a/native/tube_player_extra.c b/native/tube_player_extra.c
index d8ef714f..216bb5f6 100644
--- a/native/tube_player_extra.c
+++ b/native/tube_player_extra.c
@@ -256,7 +256,12 @@ int tube_extra_gain_for(const TubePlayerExtra *profile, int muted, int has_loudn
if (gain > TUBE_VOLUME_MAX_MILLI) gain = TUBE_VOLUME_MAX_MILLI;
return (int)gain;
}
-int tube_extra_gain_milli(void) { return tube_extra_gain_for(prefs(), g_muted, g_has_loudness, g_loudness); }
+int tube_maxd_channel_leveling(void) __attribute__((weak));
+int tube_extra_gain_milli(void) {
+ TubePlayerExtra effective=*prefs();int override=tube_maxd_channel_leveling?tube_maxd_channel_leveling():-1;
+ if(override>=0)effective.auto_volume=override;
+ return tube_extra_gain_for(&effective, g_muted, g_has_loudness, g_loudness);
+}
int tube_extra_volume_step(int direction) {
int volume = prefs()->volume + (direction > 0 ? 5 : direction < 0 ? -5 : 0);
if (volume < 0) volume = 0;
diff --git a/native/tube_profile_settings.h b/native/tube_profile_settings.h
index ff49d0a0..39a8aa40 100644
--- a/native/tube_profile_settings.h
+++ b/native/tube_profile_settings.h
@@ -107,7 +107,7 @@ static void profile_settings_store(void) {
}
static int profile_settings_select(const char *profile) {
int i = profile_settings_slot(g_separate_settings ? profile : SHARED_SETTINGS,1); if (i < 0) return 0;
- if (strcmp(profile,g_library_profile)) tube_queue_retry_cancel();
+ if (strcmp(profile,g_library_profile)) { tube_queue_retry_cancel(); memset(&g_scheduled_sleep,0,sizeof g_scheduled_sleep); }
profile_settings_store(); copy(g_library_profile,sizeof g_library_profile,profile);
profile_settings_apply(&g_profile_settings[i].value); return 1;
}
@@ -140,6 +140,7 @@ static void ui_prefs_read(TubeUiPrefs *ui, const cJSON *root) {
const cJSON *rows = cJSON_GetObjectItemCaseSensitive(root,"video_menu"), *row;
uint64_t seen = 0; int n = 0;
tube_ui_defaults(ui);
+ ui->reduced_motion = boolean(root,"reduced_motion");
ui->ui_scale = settings_integer(root,"ui_scale",40,140,100);
ui->grid_scale = settings_integer(root,"video_grid_scale",50,150,100);
ui->title_lines = settings_integer(root,"card_title_lines",1,4,1);
@@ -160,6 +161,7 @@ static void ui_prefs_read(TubeUiPrefs *ui, const cJSON *root) {
tube_ui_validate(ui);
}
static void ui_prefs_write(cJSON *row, const TubeUiPrefs *ui) {
+ cJSON_AddBoolToObject(row,"reduced_motion",ui->reduced_motion);
cJSON_AddNumberToObject(row,"ui_scale",ui->ui_scale);
cJSON_AddNumberToObject(row,"video_grid_scale",ui->grid_scale);
cJSON_AddNumberToObject(row,"card_title_lines",ui->title_lines);
diff --git a/native/tube_provider.c b/native/tube_provider.c
index 48b7b924..e428eb64 100644
--- a/native/tube_provider.c
+++ b/native/tube_provider.c
@@ -47,6 +47,13 @@ static void maxd_party_sync(void);
static char g_maxd_party_ip[32];
#include "maxd/experience_store.h"
static MaxdSmartStore g_maxd_smart_store;
+#include "maxd/viewing_store.h"
+static MaxdPresetStore g_maxd_presets;
+#include "maxd/reliability_store.h"
+static MaxdReliabilityStore g_maxd_reliability;
+static int g_maxd_playing;
+static struct { int code; unsigned count; char profile[33],video[12]; } g_maxd_failure;
+int tube_maxd_thumbnail_cache(unsigned long long *,int *,int) __attribute__((weak));
static MaxdFeedStore g_maxd_feed;
static int maxd_feed_prompt(const char *,char *,size_t);
#include "tube_update.h"
@@ -249,6 +256,7 @@ static int playback_mode_continues(int mode) { return mode!=TUBE_MODE_PAUSE && m
static int g_player_chat_mode;
static int g_sleep_minutes, g_sleep_armed, g_sleep_fired;
static long long g_sleep_activity_ms;
+static struct { long long deadline; int after; char profile[33],video[12]; } g_scheduled_sleep;
static int g_remote_enabled, g_remote_identity_saved, g_remote_write_failed, g_remote_entropy_failed;
static int g_remote_stop_on_disconnect;
static int g_remote_close_on_disconnect;
@@ -700,9 +708,32 @@ void tube_sleep_activity(void) {
}
int tube_sleep_set_minutes(int minutes) {
if (minutes < 0 || minutes > 600 || minutes % 30) return 0;
+ memset(&g_scheduled_sleep,0,sizeof g_scheduled_sleep);
g_sleep_minutes = minutes; tube_sleep_activity(); save(); return 1;
}
+int tube_sleep_schedule(int minutes,int after_video) {
+ if ((after_video!=0 && after_video!=1) || (minutes!=0 && minutes!=15 && minutes!=30 && minutes!=45 && minutes!=60 && minutes!=90 && minutes!=120) ||
+ (minutes && after_video)) return 0;
+ if (after_video && (strlen(g_active_id)!=11 || strcmp(g_active_profile,g_library_profile) || g_finished)) return 0;
+ tube_sleep_set_minutes(0);
+ copy(g_scheduled_sleep.profile,sizeof g_scheduled_sleep.profile,g_library_profile);
+ g_scheduled_sleep.deadline=minutes?now_ms()+(long long)minutes*60000:0;
+ g_scheduled_sleep.after=after_video;copy(g_scheduled_sleep.video,sizeof g_scheduled_sleep.video,g_active_id);
+ return 1;
+}
+int tube_sleep_scheduled_minutes(void) {
+ if (strcmp(g_scheduled_sleep.profile,g_library_profile) || !g_scheduled_sleep.deadline) return 0;
+ long long remaining=g_scheduled_sleep.deadline-now_ms();return remaining>0?(int)((remaining+59999)/60000):0;
+}
+int tube_sleep_after_video(void) {
+ return g_scheduled_sleep.after && !strcmp(g_scheduled_sleep.video,g_active_id) && !strcmp(g_scheduled_sleep.profile,g_library_profile);
+}
int tube_sleep_tick(int playback_active) {
+ if (strcmp(g_scheduled_sleep.profile,g_library_profile) || (g_scheduled_sleep.after && strcmp(g_scheduled_sleep.video,g_active_id)))
+ memset(&g_scheduled_sleep,0,sizeof g_scheduled_sleep);
+ if (g_scheduled_sleep.deadline && now_ms()>=g_scheduled_sleep.deadline) {
+ memset(&g_scheduled_sleep,0,sizeof g_scheduled_sleep);return playback_active!=0;
+ }
if (!playback_active || !g_sleep_minutes || g_sleep_fired) return 0;
if (!g_sleep_armed) tube_sleep_activity();
long long current = now_ms();
@@ -1734,6 +1765,9 @@ static int comment_thread_current(void) {
}
/* Everything the profile kept on this PS5 beyond its library records. */
static void profile_forget(const char *profile) {
+ maxd_presets_forget(&g_maxd_presets,profile);
+ maxd_reliability_forget(&g_maxd_reliability,profile);
+ if(!strcmp(g_maxd_failure.profile,profile))memset(&g_maxd_failure,0,sizeof g_maxd_failure);
for(int i=g_maxd_feed.count-1;i>=0;--i)if(!strcmp(g_maxd_feed.rows[i].profile,profile)) {
memmove(&g_maxd_feed.rows[i],&g_maxd_feed.rows[i+1],(size_t)(g_maxd_feed.count-i-1)*sizeof g_maxd_feed.rows[0]);
--g_maxd_feed.count;++g_maxd_feed.revision;
@@ -1766,6 +1800,8 @@ static int caption_memory_find(const char *channel) {
/* Captions for a video of this channel: what the profile last chose while
* watching the channel, else its own Captions setting. */
static int captions_wanted(const char *channel) {
+ const MaxdChannelPref *p=maxd_channel_pref(&g_maxd_reliability,g_library_profile,channel,0);
+ if(p && p->captions>=0)return p->captions;
const int i = g_caption_memory && tube_sb_channel_valid(channel) ? caption_memory_find(channel) : -1;
return i >= 0 ? g_caption_memories[i].enabled : g_captions;
}
@@ -2114,6 +2150,9 @@ static const char *speed_key(const char *id, const char *profile) {
return r && tube_sb_channel_valid(r->item.parent_id) ? r->item.parent_id : "";
}
static int speed_lookup(const char *id, const char *profile) {
+ const Record *video=record_for(id,profile,0);
+ const MaxdChannelPref *prefs=video?maxd_channel_pref(&g_maxd_reliability,profile,video->item.parent_id,0):NULL;
+ if(prefs && prefs->speed)return prefs->speed;
const int mode = profile_speed_mode(profile);
if (mode == 0) return profile_speed(profile);
if (mode == 3) return 100;
@@ -2218,6 +2257,8 @@ static void save(void) {
if (!root || !rows) { cJSON_Delete(root); cJSON_Delete(rows); storage_failed(); return; }
profile_settings_write(root);
maxd_smart_write(&g_maxd_smart_store,root);
+ maxd_presets_write(&g_maxd_presets,root);
+ maxd_reliability_write(&g_maxd_reliability,root);
maxd_feed_write(&g_maxd_feed,root);
maxd_experience_write(root);
maxd_family_write(root);
@@ -2574,6 +2615,8 @@ static void parse_item(evo_provider_item_t *item, const cJSON *o) {
}
static int init_store(void) {
+ memset(&g_maxd_reliability,0,sizeof g_maxd_reliability);g_maxd_playing=0;memset(&g_maxd_failure,0,sizeof g_maxd_failure);
+ memset(&g_maxd_presets,0,sizeof g_maxd_presets);
maxd_smart_reset();
g_maxd_mark_count=0;memset(&g_maxd_family,0,sizeof g_maxd_family);
memset(&g_maxd_feed,0,sizeof g_maxd_feed);
@@ -2621,6 +2664,7 @@ static int init_store(void) {
g_speed_session_id[0] = g_speed_session_profile[0] = 0;
g_browse_music = g_browse_queue = 0;
g_store_writable = 0;
+ memset(&g_scheduled_sleep,0,sizeof g_scheduled_sleep);
g_sleep_minutes = g_sleep_armed = g_sleep_fired = 0;
g_player_preferences_count = 0; memset(g_player_preferences,0,sizeof g_player_preferences);
g_pixel_mode=0;atomic_store(&g_video_requested,0);atomic_store(&g_video_geometry,0);
@@ -2798,6 +2842,8 @@ static int init_store(void) {
r->subscribed = boolean(o, "subscribed");
}
maxd_smart_read(&g_maxd_smart_store,root);
+ maxd_presets_read(&g_maxd_presets,root);
+ maxd_reliability_read(&g_maxd_reliability,root);
maxd_feed_read(&g_maxd_feed,root);
maxd_experience_read(root);
maxd_family_read(root);
@@ -3910,7 +3956,7 @@ static void resolved(Request *r, const cJSON *root) {
* YouTube itself and sends the request headers the service names. */
if (g_embedded) stream_headers(out->headers, sizeof out->headers, str(c, "headers"));
}
- if (!r->choice_count) { tube_set_error(g_embedded ? "No supported playback choices were returned." : "The companion returned no supported playback choices."); complete(r, 0); return; }
+ if (!r->choice_count) { g_maxd_failure.code=5;++g_maxd_failure.count;copy(g_maxd_failure.profile,sizeof g_maxd_failure.profile,r->profile);copy(g_maxd_failure.video,sizeof g_maxd_failure.video,r->parent);tube_set_error(g_embedded ? "No supported playback choices were returned." : "The companion returned no supported playback choices."); complete(r, 0); return; }
streams_resolved(r, root);
if (!tube_recovery_active()) {
copy(g_paid_text, sizeof g_paid_text, str(root, "paid_content_text")); g_paid_shown = 0;
@@ -4398,7 +4444,11 @@ static void channels_result(Request *r, const cJSON *result) {
}
static void response(int ok, int status, const char *body, size_t size, void *ud) {
- Request *r = ud; r->inflight = 0;
+ Request *r = ud;
+ if(r->used && r->kind==2 && r->generation==g_generation && !strcmp(r->profile,g_library_profile) && (!ok || status<200 || status>=300)) {
+ g_maxd_failure.code=1;++g_maxd_failure.count;
+ copy(g_maxd_failure.profile,sizeof g_maxd_failure.profile,r->profile);copy(g_maxd_failure.video,sizeof g_maxd_failure.video,r->parent);
+ } r->inflight = 0;
if (!r->used) return;
if (r->kind == 10 && (r->generation != g_generation || r->intent != g_chat.serial)) {
cJSON *late = size <= 2 * 1024 * 1024 && body ? cJSON_ParseWithLength(body, size) : NULL;
@@ -5069,7 +5119,11 @@ static int extra_group_parent(const char *parent, int *choice) {
#include "maxd/party_catalog.h"
#include "maxd/phone_remote_catalog.h"
#include "maxd/feed_catalog.h"
+#include "maxd/viewing_catalog.h"
+#include "maxd/reliability_catalog.h"
static int local_catalog(const char *parent, int page, evo_provider_items_cb cb, void *ud) {
+ if(maxd_reliability_catalog(parent,page,cb,ud))return 1;
+ if(maxd_viewing_catalog(parent,page,cb,ud))return 1;
if(maxd_feed_catalog(parent,page,cb,ud))return 1;
if(maxd_family_catalog(parent,page,cb,ud))return 1;
if(maxd_party_catalog(parent,page,cb,ud))return 1;
@@ -5794,6 +5848,10 @@ static int local_catalog(const char *parent, int page, evo_provider_items_cb cb,
CATALOG_FOLDER( g_sections[s].id, label, detail);
}
if (group == SECTION_ROOT) {
+ MaxdCheckpoint *interrupted=maxd_checkpoint(&g_maxd_reliability,g_library_profile,0);
+ if(interrupted && interrupted->pending)CATALOG_FOLDER("settings:session-recovery","Recover interrupted session","Review the saved video position and remaining queue; no automatic playback");
+ CATALOG_FOLDER("continue-watching", "Continue Watching", "Unfinished videos and saved positions for this profile");
+ CATALOG_FOLDER("settings:catchup", "Subscription catch-up", "Build an unwatched queue from selected channels");
for (int i = 0; i < g_pin_count; ++i) if (!strcmp(g_pins[i].profile, g_library_profile))
CATALOG_FOLDER( g_pins[i].id, g_pins[i].title, !strncmp(g_pins[i].id, "channel:", 8) ? "Pinned channel; Touchpad for actions" : "Pinned playlist; Touchpad for actions");
/* A Guest finds signing in where the menu is, once, beside the preferences. */
@@ -6390,6 +6448,12 @@ static int local_catalog(const char *parent, int page, evo_provider_items_cb cb,
when, safety ? " (the state a restore replaced)" : "");
snprintf(id, sizeof id, "settings:backup:delete:%u:%s", g_backup_ticket, name);
CATALOG_FOLDER( id, "Delete this backup", "Removes this file only");
+ tube_backup_summary summary;
+ if(tube_backup_inspect(evo_data_dir(),name,&summary)!=TUBE_BACKUP_OK){tube_set_error("This backup changed or could not be read. Reopen the list.");cb(0,NULL,0,0,ud);return 1;}
+ char preview[256];snprintf(preview,sizeof preview,"Settings: %d; videos: %d; favorites: %d; queued: %d; bookmarks: %d; channels: %d; presets: %d",summary.settings,summary.records,summary.favorites,summary.queued,summary.bookmarks,summary.channels,summary.presets);
+ size_t overview_length=strlen(out[0].overview);
+ snprintf(out[0].overview+overview_length,sizeof out[0].overview-overview_length,"\n\nStored data preview: %s",preview);
+ CATALOG_FOLDER("account:notice:backup-preview","Import preview",preview);
} else {
static const int periods[] = {TUBE_BACKUP_AUTO_OFF, TUBE_BACKUP_AUTO_DAILY, TUBE_BACKUP_AUTO_WEEKLY, TUBE_BACKUP_AUTO_MONTHLY};
static const char *const names[] = {"off", "daily", "weekly", "monthly"};
@@ -6859,6 +6923,11 @@ static int local_catalog(const char *parent, int page, evo_provider_items_cb cb,
tube_row_fact("settings:auto-max","kind","cycle");tube_row_fact("settings:auto-max","label","Auto Max quality");
tube_row_fact("settings:auto-max","value",g_auto_max?"On":"Off");
CATALOG_FOLDER("settings:smart","Smart playlists","Create profile-owned rules and refresh matching feed videos");
+ CATALOG_FOLDER("settings:catchup","Subscription catch-up","Choose channels, hide Shorts and build an unwatched queue");
+ CATALOG_FOLDER("settings:reliability","Playback and maintenance","Channel preferences, session recovery, diagnostics, Quick Switch and storage");
+ CATALOG_FOLDER("settings:presets","Playback presets","Save Movies, Gaming and Listening preferences for this profile");
+ CATALOG_FOLDER("settings:accessibility","Accessibility","Text size, contrast, reduced motion and captions");
+ CATALOG_FOLDER("settings:rest","Sleep timer","Pause after a set time or when this video ends");
CATALOG_FOLDER("settings:session","Session builder","Build an unwatched queue within a time budget");
CATALOG_FOLDER("settings:family","Family profiles","Parent PIN, approved channels, search and daily viewing limits");
CATALOG_FOLDER("settings:party","Party queue","Let nearby guests suggest videos and vote from their phones");
@@ -6970,11 +7039,11 @@ static int local_catalog(const char *parent, int page, evo_provider_items_cb cb,
CATALOG_FOLDER( id, *names[i] ? names[i] : channels[i], "Followed locally on this PS5");
}
cb(1, out, n, (page + 1) * LOCAL_PAGE < total, ud); return 1;
- } else if (!strcmp(parent, "history") || !strcmp(parent, "favorites") || !strcmp(parent, "queue")) {
+ } else if (!strcmp(parent, "history") || !strcmp(parent, "continue-watching") || !strcmp(parent, "favorites") || !strcmp(parent, "queue")) {
int indexes[RECORDS], total = 0;
for (int i = 0; i < g_count; ++i) {
Record *r = &g_records[i];
- int include = !strcmp(parent, "history") ? r->updated > 0 : !strcmp(parent, "favorites") ? r->favorite : r->queued;
+ int include = !strcmp(parent, "continue-watching") ? r->updated > 0 && !r->item.played && !r->item.is_live && r->item.resume_pos_sec > 0 && r->item.duration_sec > 0 && r->item.resume_pos_sec < r->item.duration_sec * .97 : !strcmp(parent, "history") ? r->updated > 0 : !strcmp(parent, "favorites") ? r->favorite : r->queued;
if (include && current_record(r) && blocked_identity(r->item.parent_id,r->item.subtitle)<0) indexes[total++] = i;
}
for (int i = 0; i < total; ++i) for (int j = i + 1; j < total; ++j) {
@@ -6991,7 +7060,12 @@ static int local_catalog(const char *parent, int page, evo_provider_items_cb cb,
/* Phone playback can create history without ever loading a catalog thumbnail. */
if (!*out[n].art_url)
snprintf(out[n].art_url, sizeof out[n].art_url, "https://i.ytimg.com/vi/%s/hqdefault.jpg", r->item.id);
- dearrow_item(&out[n], r); ++n;
+ dearrow_item(&out[n], r);
+ if (!strcmp(parent, "continue-watching")) {
+ char progress_text[96];snprintf(progress_text,sizeof progress_text,"%lld:%02lld of %lld:%02lld",(long long)r->item.resume_pos_sec/60,(long long)r->item.resume_pos_sec%60,(long long)r->item.duration_sec/60,(long long)r->item.duration_sec%60);
+ copy(out[n].subtitle,sizeof out[n].subtitle,progress_text);
+ }
+ ++n;
}
cb(1, out, n, (page + 1) * LOCAL_PAGE < total, ud); return 1;
} else return 0;
@@ -7607,6 +7681,10 @@ static int resolve(const char *id, evo_provider_resolve_cb cb, void *ud) {
r->music_origin = g_launch_origin.music;
memset(&g_launch_origin, 0, sizeof g_launch_origin);
r->quality = recovering ? g_recovery.quality : (ResolveQuality){g_height,g_max_fps,g_codec};
+ if(!recovering && origin_record) {
+ const MaxdChannelPref *pref=maxd_channel_pref(&g_maxd_reliability,g_library_profile,origin_record->item.parent_id,0);
+ if(pref && pref->height && pref->heightquality.height)r->quality.height=pref->height;
+ }
if (!recovering) { g_streams.pinned = -1; g_streams.switching = 0; g_streams.audio_wanted[0] = 0; }
char audio_track[64] = "";
if (recovering && *g_streams.audio_wanted && !strcmp(g_streams.id, id))
@@ -7619,6 +7697,8 @@ static int resolve(const char *id, evo_provider_resolve_cb cb, void *ud) {
static void progress(const char *id, int64_t pos, int64_t dur, evo_provider_play_state_t state) {
if (*g_active_id && strcmp(id, g_active_id)) return;
+ if(state==EVO_PROVIDER_PLAY_START)g_maxd_playing=1;
+ if(state==EVO_PROVIDER_PLAY_STOP)g_maxd_playing=0;
if (state == EVO_PROVIDER_PLAY_STOP) tube_extra_video_end(); /* the player forgets the stopped video's facts */
const char *profile = *g_active_profile ? g_active_profile : g_library_profile;
const int silent = history_suppressed();
@@ -7656,7 +7736,13 @@ static void progress(const char *id, int64_t pos, int64_t dur, evo_provider_play
g_watch.position = pos; g_watch.stopped = state == EVO_PROVIDER_PLAY_STOP;
g_watch.dirty = 1; watch_flush(0);
}
- if (state == EVO_PROVIDER_PLAY_STOP || now_ms() - g_last_save >= 10000) save();
+ MaxdCheckpoint *checkpoint=maxd_checkpoint(&g_maxd_reliability,profile,1);
+ if(checkpoint) {
+ copy(checkpoint->video,sizeof checkpoint->video,id);checkpoint->position=r->item.resume_pos_sec;
+ checkpoint->duration=dur>0?dur:r->item.duration_sec;checkpoint->active=state!=EVO_PROVIDER_PLAY_STOP && !r->item.played;
+ checkpoint->pending=0;
+ }
+ if (state==EVO_PROVIDER_PLAY_START || state == EVO_PROVIDER_PLAY_STOP || now_ms() - g_last_save >= 10000) save();
}
static int live_window_valid(const int64_t window[7]) {
@@ -8379,6 +8465,10 @@ static int finish_and_next(int playlist) {
}
if (strcmp(g_active_profile, g_library_profile)) return 0;
g_completion_scope=g_playlist_scope;
+ if (tube_sleep_after_video()) {
+ memset(&g_scheduled_sleep,0,sizeof g_scheduled_sleep);
+ g_completion_action=TUBE_COMPLETION_PAUSE;return 0;
+ }
if (g_playback_mode==TUBE_MODE_ONE || looping) {
g_completion_action=g_recovery.choice.is_live?TUBE_COMPLETION_PAUSE:TUBE_COMPLETION_REPEAT;
return 0;
@@ -8979,6 +9069,10 @@ static int player_codec(const char *name) {
}
#include "maxd/auto_provider.h"
int tube_error_fix_begin(int error, double position, int live, int subtitles) {
+ if(recovery_scope() && error>=TUBE_ERROR_SOURCE && error<=TUBE_ERROR_BUFFERING) {
+ g_maxd_failure.code=error+1;++g_maxd_failure.count;
+ copy(g_maxd_failure.profile,sizeof g_maxd_failure.profile,g_active_profile);copy(g_maxd_failure.video,sizeof g_maxd_failure.video,g_active_id);
+ }
if (g_recovery.phase || !recovery_scope()) return TUBE_FIX_NONE;
const evo_stream_choice_t *playing = &g_recovery.choice;
int height = playing->height > 0 ? playing->height : g_recovery.quality.height;
diff --git a/native/tube_provider.h b/native/tube_provider.h
index 3d02879e..e16c804d 100644
--- a/native/tube_provider.h
+++ b/native/tube_provider.h
@@ -236,6 +236,9 @@ double tube_chat_reader_position(const char *parent);
int tube_chat_reader_seek(const char *parent, double position_sec);
/* Advance a stationary replay through remaining messages at the selected time. */
int tube_chat_reader_next(const char *parent);
+int tube_sleep_schedule(int minutes,int after_video);
+int tube_sleep_scheduled_minutes(void);
+int tube_sleep_after_video(void);
int tube_sleep_minutes(void);
int tube_sleep_set_minutes(int minutes);
void tube_sleep_activity(void);
@@ -372,6 +375,8 @@ int tube_player_audio_select(int index, double position, int live, int subtitles
/* Error fixer (tube_player_extra.h): arms the bounded recovery for one error
* and returns the TUBE_FIX_* action taken, 0 for none. While a reload asks
* for another quality, the host takes its stream from tube_error_fix_choice(). */
+int tube_maxd_channel_leveling(void);
+const char *tube_maxd_playback_diagnosis(void);
int tube_error_fix_begin(int error, double position, int live, int subtitles);
int tube_error_fix_relaxed(void);
int tube_error_fix_choice(const evo_stream_choice_t *choices, int count);
diff --git a/native/tube_ui_style.h b/native/tube_ui_style.h
index c407ab34..16036f86 100644
--- a/native/tube_ui_style.h
+++ b/native/tube_ui_style.h
@@ -32,6 +32,7 @@ static const struct { const char *id, *label; } g_tube_menu_keys[TUBE_MENU_KEYS]
/* One profile's preferences. Defaults reproduce the browser without this module. */
typedef struct TubeUiPrefs {
+ int reduced_motion; /* disable decorative browser motion */
int ui_scale; /* percent, SmartTube's list 40..140 */
int grid_scale; /* percent, SmartTube's list 50..150 */
int title_lines; /* 1..4 lines of a card title */
@@ -95,7 +96,9 @@ static inline int tube_ui_listed(const int *values, int count, int value) {
}
/* Replace every out-of-range field with its default; returns how many changed. */
static inline int tube_ui_validate(TubeUiPrefs *prefs) {
- int changed = 0; unsigned seen[2] = {0, 0};
+ int changed = 0;
+ if (prefs->reduced_motion < 0 || prefs->reduced_motion > 1) { prefs->reduced_motion = 0; ++changed; }
+ unsigned seen[2] = {0, 0};
if (tube_ui_listed(g_tube_ui_scales, TUBE_UI_SCALES, prefs->ui_scale) < 0) { prefs->ui_scale = 100; ++changed; }
if (tube_ui_listed(g_tube_grid_scales, TUBE_GRID_SCALES, prefs->grid_scale) < 0) { prefs->grid_scale = 100; ++changed; }
if (prefs->title_lines < 1 || prefs->title_lines > 4) { prefs->title_lines = 1; ++changed; }
@@ -117,7 +120,7 @@ static inline int tube_ui_validate(TubeUiPrefs *prefs) {
}
/* 1 = the browser needs no added rule, scale or scheme. */
static inline int tube_ui_plain(const TubeUiPrefs *p) {
- return p->ui_scale == 100 && p->grid_scale == 100 && p->title_lines == 1 && p->subtitle_lines == 1 && !p->square && !p->scheme;
+ return !p->reduced_motion && p->ui_scale == 100 && p->grid_scale == 100 && p->title_lines == 1 && p->subtitle_lines == 1 && !p->square && !p->scheme;
}
/* ---- Video actions menu. ---- */
@@ -258,6 +261,7 @@ static inline int tube_ui_rules(const TubeUiPrefs *prefs, char *out, size_t size
if (wrote < 0 || (size_t)wrote >= size - (size_t)used) { out[0] = 0; return -1; } \
used += wrote; \
} while (0)
+ if (p.reduced_motion) TUBE_UI_RULE("* { transition: none; animation: none; }\n");
if (p.ui_scale != 100) {
const int w = 1792 + l.dw, h = 1004 + l.dh;
TUBE_UI_RULE("#tube-root { width: %ddp; height: %ddp; }\n", w, h);
diff --git a/pyproject.toml b/pyproject.toml
index a1d7416f..59c0d1f9 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "prosperotube-companion"
-version = "1.005.000"
+version = "1.006.000"
description = "User-controlled LAN service for the native ProsperoTube PS5 client"
requires-python = ">=3.11"
license = {text = "GPL-3.0-or-later"}
diff --git a/scripts/build_ps5.sh b/scripts/build_ps5.sh
index 910f91ad..39a52bed 100644
--- a/scripts/build_ps5.sh
+++ b/scripts/build_ps5.sh
@@ -80,6 +80,18 @@ ffmpeg_patch=$(cat "${root}/scripts/patch_ffmpeg_dash_seek.py" "${root}/scripts/
ffmpeg_identity="7.1.1-minimal-EVO-9715f6e-atempo-v1-dash-hls-dvr-${ffmpeg_patch}"
if [[ ! -f "${PS5_PAYLOAD_SDK}/PROSPEROTUBE_FFMPEG" ]] ||
[[ "$(cat "${PS5_PAYLOAD_SDK}/PROSPEROTUBE_FFMPEG")" != "${ffmpeg_identity}" ]]; then
+ # Reuse the corresponding source already shipped with this project. The
+ # upstream builder verifies the same pin again before extraction.
+ ffmpeg_archive="${root}/runtime-sources/FFmpeg.tar.xz"
+ if [[ -f "${ffmpeg_archive}" ]]; then
+ printf '%s %s\n' '733984395e0dbbe5c046abda2dc49a5544e7e0e1e2366bba849222ae9e3a03b1' "${ffmpeg_archive}" | sha256sum --check --status || {
+ echo 'Bundled FFmpeg source checksum mismatch.' >&2; exit 2;
+ }
+ mkdir -p "${work}/third_party/ffmpeg"
+ if [[ ! -f "${work}/third_party/ffmpeg/ffmpeg-7.1.1.tar.xz" ]]; then
+ cp "${ffmpeg_archive}" "${work}/third_party/ffmpeg/ffmpeg-7.1.1.tar.xz"
+ fi
+ fi
bash "${work}/scripts/build-ffmpeg.sh" --install --jobs 8
[[ -f "${PS5_PAYLOAD_SDK}/target/user/homebrew/lib/libavfilter.a" ]]
grep -q '^#define CONFIG_ATEMPO_FILTER 1$' "${work}/build/ffmpeg/7.1.1-minimal/config_components.h"
diff --git a/scripts/maxd_overlay.py b/scripts/maxd_overlay.py
index 8b15a278..70b3175f 100644
--- a/scripts/maxd_overlay.py
+++ b/scripts/maxd_overlay.py
@@ -46,10 +46,10 @@ def apply(root, work, player):
for target in (app / "assets/rml", app / "assets/icons"):
for name in ("tube-mark.png", "tube-mark-large.png"):
shutil.copyfile(root / "native/branding/icon0.png", target / name)
- for name in ("brand.h", "lightbar.h", "maxd_feedback.h", "voice_gesture.h"):
+ for name in ("brand.h", "lightbar.h", "maxd_feedback.h", "voice_gesture.h", "quick_switch.h"):
shutil.copyfile(root / "native/maxd" / name, app / "addons/include" / name)
(app / "addons/include/maxd").mkdir(exist_ok=True)
- for name in ("auto_max.h", "auto_provider.h", "smart_rules.h", "smart_catalog.h", "feed_controls.h", "feed_catalog.h", "playback_health.h"):
+ for name in ("auto_max.h", "auto_provider.h", "smart_rules.h", "smart_catalog.h", "feed_controls.h", "feed_catalog.h", "playback_health.h", "viewing_store.h", "viewing_catalog.h", "reliability_store.h", "reliability_catalog.h"):
shutil.copyfile(root / "native/maxd" / name, app / "addons/include/maxd" / name)
shutil.copyfile(root / "native/maxd/lightbar.c", app / "addons/src/maxd_lightbar.c")
shutil.copyfile(root / "native/maxd/evo_feedback.c", app / "ui/src/evo_feedback.c")
diff --git a/scripts/package_release.py b/scripts/package_release.py
index a0d3cc7e..1861d665 100644
--- a/scripts/package_release.py
+++ b/scripts/package_release.py
@@ -53,7 +53,7 @@ def main():
for path in sorted(DIST.iterdir()):
if path.is_file() and path.suffix in {".zip", ".gz"}:
artifacts[path.name] = {"bytes": path.stat().st_size, "sha256": hashlib.file_digest(path.open("rb"), "sha256").hexdigest()}
- manifest = {"version": "1.005.000", "source_revision": revision, "title_id": "PPSA99991",
+ manifest = {"version": "1.006.000", "source_revision": revision, "title_id": "PPSA99991",
"validation": {"status": "Packaging records checksums; consult the validation record for test evidence.",
"ps5_hardware": "not tested", "live_youtube": "not tested"},
"artifacts": artifacts}
diff --git a/scripts/player_actions_overlay.py b/scripts/player_actions_overlay.py
index f977a5ac..2ea0ab3b 100644
--- a/scripts/player_actions_overlay.py
+++ b/scripts/player_actions_overlay.py
@@ -377,9 +377,9 @@ def _dimming(replace, player):
tube_extra_dim_input(static_cast(std::chrono::duration_cast(
std::chrono::steady_clock::now().time_since_epoch()).count()), 1, 0);
};''')
- replace(app, ''' toast("SLEEP TIMER", "Playback paused after inactivity");
+ replace(app, ''' toast("SLEEP TIMER", "Playback paused by the sleep timer");
}
- }''', ''' toast("SLEEP TIMER", "Playback paused after inactivity");
+ }''', ''' toast("SLEEP TIMER", "Playback paused by the sleep timer");
}
}
// ProsperoTube screen dimming: one idle clock for the browser and the player.
diff --git a/scripts/prepare_native.py b/scripts/prepare_native.py
index 2acf32ef..5ab59bd5 100644
--- a/scripts/prepare_native.py
+++ b/scripts/prepare_native.py
@@ -296,7 +296,7 @@ def main():
replace(player + "ui/src/evo_keyboard.c", "#define KB_MAX_BUF 256", "#define KB_MAX_BUF 1024")
param_path = WORK / player / "sce_sys/param.json"
param = json.loads(param_path.read_text())
- param.update(titleId=TITLE, conceptId="99991", contentId=f"UP9000-{TITLE}_00-TUBEDECK00000001", contentVersion="01.005.000")
+ param.update(titleId=TITLE, conceptId="99991", contentId=f"UP9000-{TITLE}_00-TUBEDECK00000001", contentVersion="01.006.000")
param["applicationCategoryType"] = 65536
param["contentBadgeType"] = 2
param.pop("gameIntent", None)
@@ -308,7 +308,7 @@ def main():
if not any(i.get("intentType") == "launchActivity" for i in intents):
raise SystemExit("game param.json must permit the launchActivity intent")''', '''if (v.get("applicationCategoryType"), v.get("contentBadgeType")) != (65536, 2) or "gameIntent" in v:
raise SystemExit("expected Media metadata: category 65536, badge 2, no gameIntent")''')
- (WORK / player / "VERSION").write_text("1.005.000\n")
+ (WORK / player / "VERSION").write_text("1.006.000\n")
revision = subprocess.check_output(["git", "-C", str(ROOT), "rev-parse", "--short=8", "HEAD"], text=True).strip()
# Dependency trees are regenerated from checked pins above, so their working
# files do not contribute to this package. Avoid recursively scanning them.
diff --git a/scripts/publish_maxd_160.py b/scripts/publish_maxd_160.py
new file mode 100644
index 00000000..c4fb7820
--- /dev/null
+++ b/scripts/publish_maxd_160.py
@@ -0,0 +1,191 @@
+#!/usr/bin/env python3
+"""Publish the checked 1.6.0 Actions build and matching source, without replacement.
+SPDX-License-Identifier: GPL-3.0-or-later
+"""
+import argparse
+import hashlib
+import json
+import os
+from pathlib import Path
+import shutil
+import subprocess
+import sys
+import zipfile
+
+REPO = "HandshakeHackin/youtube-maxd"
+PR = 8
+TAG = "v1.6.0"
+
+
+def command(*args, cwd=None):
+ return subprocess.check_output(args, cwd=cwd, text=True).strip()
+
+
+def api(endpoint):
+ return json.loads(command("gh", "api", endpoint))
+
+
+def sha(path):
+ with path.open("rb") as stream:
+ return hashlib.file_digest(stream, "sha256").hexdigest()
+
+
+def select():
+ pr = api(f"repos/{REPO}/pulls/{PR}")
+ if not pr["merged"] or pr["base"]["ref"] != "main" or pr["head"]["ref"] != "feature/everyday-viewing":
+ raise RuntimeError("Expected the merged 1.6.0 candidate PR")
+ candidate = pr["head"]["sha"]
+ subprocess.run(["git", "merge-base", "--is-ancestor", candidate, "HEAD"], check=True)
+ runs = api(f"repos/{REPO}/actions/runs?head_sha={candidate}&event=pull_request&per_page=100")["workflow_runs"]
+ builds = sorted((r for r in runs if r["name"] == "Build"), key=lambda r: r["id"], reverse=True)
+ for run in builds:
+ jobs = api(f"repos/{REPO}/actions/runs/{run['id']}/jobs?per_page=100")["jobs"]
+ if any(j["name"] == "Build the release ZIP" and j["conclusion"] == "success" for j in jobs):
+ break
+ else:
+ raise RuntimeError("No successful PS5 package build for the exact candidate commit")
+ feeds = [r for r in runs if r["name"] == "Feed and playback health checks"]
+ if not any(r["conclusion"] == "success" for r in feeds):
+ raise RuntimeError("Feed and playback health checks have not passed for the exact candidate")
+ artifact = f"youtube-maxd-PR{PR}-{candidate[:7]}"
+ artifacts = api(f"repos/{REPO}/actions/runs/{run['id']}/artifacts")["artifacts"]
+ if not any(a["name"] == artifact and not a["expired"] for a in artifacts):
+ raise RuntimeError("Verified build artifact is absent or expired")
+ output = Path(os.environ["GITHUB_OUTPUT"])
+ with output.open("a") as stream:
+ stream.write(f"sha={candidate}\nrun={run['id']}\nartifact={artifact}\n")
+ print(f"Selected candidate {candidate}, successful package run {run['id']}")
+
+
+def relabel(original, destination, label):
+ """Replace the existing label in place in the ZIP inventory, never append it."""
+ label_path = "PPSA99991/build-label.txt"
+ with zipfile.ZipFile(original) as before:
+ names = before.namelist()
+ if len(names) != len(set(names)) or names.count(label_path) != 1:
+ raise RuntimeError("Expected one unique CI build-label entry")
+ with zipfile.ZipFile(destination, "w") as after:
+ for info in before.infolist():
+ body = (label + "\n").encode() if info.filename == label_path else before.read(info)
+ after.writestr(info, body)
+
+
+def finish_draft(remote):
+ """Address drafts by release ID: their final tag URL does not exist yet."""
+ result = json.loads(command("gh", "api", "--method", "PATCH",
+ f"repos/{REPO}/releases/{remote['id']}",
+ "-F", "draft=false", "-F", "prerelease=false",
+ "-f", "make_latest=true"))
+ if result["draft"] or result["tag_name"] != TAG:
+ raise RuntimeError("Release was not published as expected")
+ print(result["html_url"])
+
+
+def publish(source, downloads, candidate, run):
+ source, downloads = source.resolve(), downloads.resolve()
+ if command("git", "rev-parse", "HEAD", cwd=source) != candidate:
+ raise RuntimeError("Source checkout differs from the selected candidate")
+ sys.path.insert(0, str(source / "scripts"))
+ from bootstrap_local_voice import MODEL_SHA, MODEL_SIZE
+ from release_version import identity
+ from verify_app_zip import verify
+ if identity() != ("PPSA99991", "01.006.000", "1.006.000"):
+ raise RuntimeError("Source identity is not 1.6.0")
+ store_param = json.loads((source / "store/sce_sys/param.json").read_text())
+ if (store_param["titleId"], store_param["contentVersion"]) != ("PPSA99991", "01.006.000"):
+ raise RuntimeError("Catalog-readable identity differs from the package version")
+ original = downloads / "PPSA99991.zip"
+ recorded = next(row.split()[0] for row in (downloads / "SHA256SUMS").read_text().splitlines()
+ if row.split()[-1] == "PPSA99991.zip")
+ if sha(original) != recorded:
+ raise RuntimeError("Downloaded package differs from Actions checksum")
+ with zipfile.ZipFile(original) as archive:
+ model = archive.read("PPSA99991/assets/voice/ggml-tiny.bin")
+ if len(model) != MODEL_SIZE or hashlib.sha256(model).hexdigest() != MODEL_SHA:
+ raise RuntimeError("Packaged voice model differs from the pinned complete model")
+ dist = source / "dist"
+ dist.mkdir(exist_ok=True)
+ candidate_zip = dist / "PPSA99991.zip"
+ shutil.copyfile(original, candidate_zip)
+ # Only replace the text build label; retain the built executable and assets.
+ relabel(original, candidate_zip, f"YouTube Max’d 1.6.0, {candidate}")
+ verify(candidate_zip)
+ with zipfile.ZipFile(original) as before, zipfile.ZipFile(candidate_zip) as after:
+ if set(before.namelist()) != set(after.namelist()):
+ raise RuntimeError("Release relabel changed package inventory")
+ for name in before.namelist():
+ if name != "PPSA99991/build-label.txt" and before.read(name) != after.read(name):
+ raise RuntimeError("Release relabel changed built bytes: " + name)
+ subprocess.run([sys.executable, str(source / "scripts/package_maxd_release.py")], cwd=source, check=True)
+ release = source.parent / "release"
+ release.mkdir(exist_ok=True)
+ for src, dest in ((candidate_zip, "PPSA99991.zip"),
+ (dist / "YouTube-Maxd-source.zip", "YouTube-Maxd-source.zip"),
+ (dist / "YouTube-Maxd-icon.png", "YouTube-Maxd-icon.png")):
+ shutil.copyfile(src, release / dest)
+ jobs = api(f"repos/{REPO}/actions/runs/{run}/jobs?per_page=100")["jobs"]
+ checks = next((j for j in jobs if j["name"] == "Offline checks"), {})
+ validation = {"version": "1.6.0", "content_version": "01.006.000", "title_id": "PPSA99991",
+ "source_commit": candidate, "build_run": f"https://github.com/{REPO}/actions/runs/{run}",
+ "ci_package_sha256": recorded, "release_package_sha256": sha(release / "PPSA99991.zip"),
+ "release_change": "build-label.txt only; all executable and asset bytes preserved",
+ "ps5_cross_build": "passed", "package_checks": "passed",
+ "voice_model_sha256": MODEL_SHA, "voice_model_bytes": MODEL_SIZE,
+ "full_offline_checks_status": checks.get("status"),
+ "full_offline_checks_conclusion": checks.get("conclusion"),
+ "ps5_hardware_tested": False}
+ (release / "native-validation.json").write_text(json.dumps(validation, indent=2) + "\n")
+ logs = source / "build/test-logs"
+ focused = [(p.name, p.read_text(errors="replace")) for p in sorted(logs.glob("*.log"))] if logs.exists() else []
+ report = ("# 1.6.0 validation\n\n"
+ f"Source: {candidate}\nBuild: {validation['build_run']}\n\n"
+ "The exact candidate passed the PS5 package job and focused feed/playback-health workflow, "
+ "including channel preferences, interrupted-session recovery, Quick Switch, backup validation, viewing queues and profile isolation, "
+ "phone transport and nine browser-script scenarios, QR links, actual menu navigation, "
+ "and release-notification versioning, async single-flight, deduplication and saved opt-out. "
+ "Release identity, About, lighting and packaging checks were repeated before publication.\n\n"
+ f"Full inherited Offline job: {checks.get('status')} / {checks.get('conclusion')}. "
+ "Repository-wide test success is not claimed; focused validation is separate.\n\n"
+ "No physical PS5, phone, microphone or live YouTube acceptance was performed. "
+ "Firmware 11.00 with ShadowMount+ remains the intended target.\n\n")
+ for name, body in focused:
+ report += f"## {name}\n\n```text\n{body}\n```\n\n"
+ (release / "TEST_RESULTS.md").write_text(report)
+ notes = (source / "docs/releases/01.006.000.md").read_text()
+ (release / "RELEASE_NOTES.md").write_text(notes)
+ assets = sorted(p for p in release.iterdir() if p.is_file() and p.name != "SHA256SUMS")
+ (release / "SHA256SUMS").write_text("".join(f"{sha(p)} {p.name}\n" for p in assets))
+ existing = subprocess.run(["gh", "release", "view", TAG, "--repo", REPO, "--json", "isDraft,assets"],
+ capture_output=True, text=True)
+ if existing.returncode == 0:
+ current = json.loads(existing.stdout)
+ if not current["isDraft"] or current["assets"]:
+ raise RuntimeError("Refusing to replace an existing release or asset")
+ raise RuntimeError("An empty draft already exists; inspect it before retrying")
+ all_assets = sorted(str(p) for p in release.iterdir() if p.is_file())
+ subprocess.run(["gh", "release", "create", TAG, "--repo", REPO, "--target", candidate,
+ "--draft", "--title", "YouTube Max’d 1.6.0", "--notes-file", str(release / "RELEASE_NOTES.md"),
+ *all_assets], check=True)
+ remote = next(r for r in api(f"repos/{REPO}/releases?per_page=100") if r["tag_name"] == TAG)
+ uploaded = {a["name"]: a for a in remote["assets"]}
+ for path in release.iterdir():
+ if path.is_file() and uploaded.get(path.name, {}).get("digest") != "sha256:" + sha(path):
+ raise RuntimeError("Uploaded asset digest mismatch: " + path.name)
+ finish_draft(remote)
+ print(f"Published https://github.com/{REPO}/releases/tag/{TAG}")
+
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument("mode", choices=("select", "publish"))
+ parser.add_argument("--source", type=Path)
+ parser.add_argument("--downloads", type=Path)
+ parser.add_argument("--candidate")
+ parser.add_argument("--run", type=int)
+ args = parser.parse_args()
+ if args.mode == "select":
+ select()
+ else:
+ if not all((args.source, args.downloads, args.candidate, args.run)):
+ parser.error("publish requires source, downloads, candidate and run")
+ publish(args.source, args.downloads, args.candidate, args.run)
diff --git a/scripts/sleep_timer_overlay.py b/scripts/sleep_timer_overlay.py
index d3664e8d..497b485a 100644
--- a/scripts/sleep_timer_overlay.py
+++ b/scripts/sleep_timer_overlay.py
@@ -9,6 +9,16 @@ def apply_sleep_timer_overlay(replace, player):
'KindAudio, KindSpeed, KindChat };', 'KindAudio, KindSpeed, KindChat, KindSleep };')
replace(picker, ' // End ProsperoTube chat option rows.', ''' // End ProsperoTube chat option rows.
if (playback->isActive()) {
+ const int scheduled[] = {15,30,45,60,90,120};
+ for (int minutes : scheduled) {
+ Entry e; e.kind = KindSleep; e.streamIndex = -minutes;
+ e.label = "Pause in " + std::to_string(minutes) + " minutes";
+ e.detail = "Elapsed-time timer; controller activity does not restart it";
+ m_tracks.push_back(std::move(e));
+ }
+ Entry finish; finish.kind = KindSleep; finish.streamIndex = -1;
+ finish.label = "Sleep when this video ends"; finish.detail = "Suppress repeat, autoplay and the next queued video once";
+ finish.badge = tube_sleep_after_video() ? "SELECTED" : ""; m_tracks.push_back(std::move(finish));
for (int minutes = 0; minutes <= 600; minutes += 30) {
Entry e; e.kind = KindSleep; e.streamIndex = minutes;
e.label = minutes ? "Sleep after " + std::to_string(minutes) + " min without input" : "Sleep timer: disabled";
@@ -18,7 +28,7 @@ def apply_sleep_timer_overlay(replace, player):
}
}''')
replace(picker, ' if (e.kind == KindChat) {', ''' if (e.kind == KindSleep) {
- if (tube_sleep_set_minutes(e.streamIndex)) toast("SLEEP TIMER", e.label.c_str());
+ if (e.streamIndex < 0 ? tube_sleep_schedule(e.streamIndex == -1 ? 0 : -e.streamIndex, e.streamIndex == -1) : tube_sleep_set_minutes(e.streamIndex)) toast("SLEEP TIMER", e.label.c_str());
else toast("SLEEP TIMER", "Choose a valid inactivity duration");
} else if (e.kind == KindChat) {''')
app = player + 'core/src/Application.cpp'
@@ -28,7 +38,7 @@ def apply_sleep_timer_overlay(replace, player):
auto playback = getPlaybackController();
if (tube_sleep_tick(playback && playback->isActive())) {
playback->setPaused(true);
- toast("SLEEP TIMER", "Playback paused after inactivity");
+ toast("SLEEP TIMER", "Playback paused by the sleep timer");
}
}''')
replace(app, ' phone.context = this;', ''' phone.context = this;
diff --git a/scripts/test_maxd.sh b/scripts/test_maxd.sh
index 23196389..976ecfe2 100644
--- a/scripts/test_maxd.sh
+++ b/scripts/test_maxd.sh
@@ -13,7 +13,7 @@ import json,pathlib,sys
root=pathlib.Path(sys.argv[1]);sys.path.insert(0,str(root/'scripts'))
from release_version import identity
title,content,version=identity()
-assert (title,content,version)==('PPSA99991','01.005.000','1.005.000')
+assert (title,content,version)==('PPSA99991','01.006.000','1.006.000')
assert json.loads((root/'UPSTREAM.json').read_text())['title_id']==title
source=(root/'native/tube_update_app.c').read_text()
assert '#ifndef TUBE_MAXD_ENABLE_SELF_UPDATE\n return;' in source
diff --git a/scripts/test_native.sh b/scripts/test_native.sh
index 4d406ade..8f0580c7 100644
--- a/scripts/test_native.sh
+++ b/scripts/test_native.sh
@@ -2,9 +2,9 @@
set -euo pipefail
root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
cases=("$@")
-if [ ${#cases[@]} -eq 0 ]; then cases=(maxd_feed maxd_feed_paging maxd_health maxd_phone_provider maxd_support maxd_experience maxd_party_provider maxd_smart maxd_auto maxd_quality storage_failure queue_reorder live_owner phone_recommendation suggestions native playback_recovery stream_choice sponsor paid_content dearrow speed_memory music_context topic_catalog player_chat chat_reader voice_search_provider disconnect_preferences player_preferences profile_settings video_geometry queue_failure codecs playlist_context playlist_window playback_next manual_navigation group_navigation group_block_window catalog_progress video_actions history_remove channel_block channel_block_queue channel_block_window channel_block_next channel_block_name video_menu search_history history_modes remote_history search_options description library_sections feedback section_order menu_launch extra_provider companion_features channel_pages account_changes account_settings links_about backup_ui third_sections third_captions comment_post channel_marks subscriptions_import startup_lock guest_sections interface_settings library_paging typed_search); fi
+if [ ${#cases[@]} -eq 0 ]; then cases=(maxd_reliability maxd_catchup maxd_viewing maxd_feed maxd_feed_paging maxd_health maxd_phone_provider maxd_support maxd_experience maxd_party_provider maxd_smart maxd_auto maxd_quality storage_failure queue_reorder live_owner phone_recommendation suggestions native playback_recovery stream_choice sponsor paid_content dearrow speed_memory music_context topic_catalog player_chat chat_reader voice_search_provider disconnect_preferences player_preferences profile_settings video_geometry queue_failure codecs playlist_context playlist_window playback_next manual_navigation group_navigation group_block_window catalog_progress video_actions history_remove channel_block channel_block_queue channel_block_window channel_block_next channel_block_name video_menu search_history history_modes remote_history search_options description library_sections feedback section_order menu_launch extra_provider companion_features channel_pages account_changes account_settings links_about backup_ui third_sections third_captions comment_post channel_marks subscriptions_import startup_lock guest_sections interface_settings library_paging typed_search); fi
for name in "${cases[@]}"; do
- case "$name" in maxd_feed|maxd_feed_paging|maxd_health|maxd_phone_provider|maxd_support|maxd_party_provider|maxd_experience|maxd_smart|maxd_auto|maxd_quality|storage_failure|queue_reorder|live_owner|phone_recommendation|suggestions|native|playback_recovery|stream_choice|sponsor|paid_content|dearrow|speed_memory|music_context|topic_catalog|player_chat|chat_reader|voice_search_provider|disconnect_preferences|player_preferences|profile_settings|video_geometry|queue_failure|codecs|playlist_context|playlist_window|playback_next|manual_navigation|group_navigation|group_block_window|catalog_progress|video_actions|history_remove|channel_block|channel_block_queue|channel_block_window|channel_block_next|channel_block_name|video_menu|search_history|history_modes|remote_history|search_options|description|library_sections|feedback|section_order|menu_launch|extra_provider|companion_features|channel_pages|account_changes|account_settings|links_about|backup_ui|third_sections|third_captions|comment_post|channel_marks|subscriptions_import|startup_lock|guest_sections|interface_settings|library_paging|typed_search) ;; *) echo "Unknown native test: $name" >&2; exit 2 ;; esac
+ case "$name" in maxd_reliability|maxd_catchup|maxd_viewing|maxd_feed|maxd_feed_paging|maxd_health|maxd_phone_provider|maxd_support|maxd_party_provider|maxd_experience|maxd_smart|maxd_auto|maxd_quality|storage_failure|queue_reorder|live_owner|phone_recommendation|suggestions|native|playback_recovery|stream_choice|sponsor|paid_content|dearrow|speed_memory|music_context|topic_catalog|player_chat|chat_reader|voice_search_provider|disconnect_preferences|player_preferences|profile_settings|video_geometry|queue_failure|codecs|playlist_context|playlist_window|playback_next|manual_navigation|group_navigation|group_block_window|catalog_progress|video_actions|history_remove|channel_block|channel_block_queue|channel_block_window|channel_block_next|channel_block_name|video_menu|search_history|history_modes|remote_history|search_options|description|library_sections|feedback|section_order|menu_launch|extra_provider|companion_features|channel_pages|account_changes|account_settings|links_about|backup_ui|third_sections|third_captions|comment_post|channel_marks|subscriptions_import|startup_lock|guest_sections|interface_settings|library_paging|typed_search) ;; *) echo "Unknown native test: $name" >&2; exit 2 ;; esac
done
work="$(python3 "${root}/scripts/prepare_native.py")"
evo="${work}/projects/evoplayer"
diff --git a/scripts/test_publish_160.py b/scripts/test_publish_160.py
new file mode 100644
index 00000000..88ba614e
--- /dev/null
+++ b/scripts/test_publish_160.py
@@ -0,0 +1,32 @@
+"""A release must replace a CI label without duplicating entries or changing payloads."""
+from pathlib import Path
+import tempfile
+import unittest
+import zipfile
+from publish_maxd_160 import relabel
+
+class RelabelTest(unittest.TestCase):
+ def test_existing_label_is_replaced_once_and_payload_modes_are_preserved(self):
+ with tempfile.TemporaryDirectory() as directory:
+ root = Path(directory)
+ original, first, second = (root / name for name in ('ci.zip', 'release.zip', 'again.zip'))
+ payload = b'fixture executable, not a PS5 binary'
+ with zipfile.ZipFile(original, 'w') as archive:
+ for name, data in [('eboot.bin', payload), ('build-label.txt', b'PR 4, fixture\n')]:
+ info = zipfile.ZipInfo('PPSA99991/' + name)
+ info.external_attr = 0o100777 << 16
+ info.compress_type = zipfile.ZIP_DEFLATED
+ archive.writestr(info, data)
+ relabel(original, first, 'YouTube Max’d 1.6.0')
+ relabel(first, second, 'YouTube Max’d 1.6.0 repeat')
+ for path, label in [(first, 'YouTube Max’d 1.6.0'), (second, 'YouTube Max’d 1.6.0 repeat')]:
+ with zipfile.ZipFile(path) as archive:
+ self.assertEqual(len(archive.namelist()), 2)
+ self.assertEqual(archive.namelist().count('PPSA99991/build-label.txt'), 1)
+ self.assertEqual(archive.read('PPSA99991/eboot.bin'), payload)
+ self.assertEqual(archive.read('PPSA99991/build-label.txt'), (label + '\n').encode())
+ self.assertTrue(all((i.external_attr >> 16) & 0o777 == 0o777 for i in archive.infolist()))
+ self.assertIsNone(archive.testzip())
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/scripts/test_quick_switch.py b/scripts/test_quick_switch.py
new file mode 100644
index 00000000..1ef2a5e9
--- /dev/null
+++ b/scripts/test_quick_switch.py
@@ -0,0 +1,47 @@
+"""Execute the actual generated Quick Switch dispatch with safe UI stubs."""
+import os
+from pathlib import Path
+import subprocess
+import tempfile
+root=Path(__file__).resolve().parents[1]
+work=Path(os.environ.get('PROSPEROTUBE_NATIVE_WORK',root/'.deps/native-work'))/'projects/evoplayer'
+source=(work/'core/src/screens/ProviderHostScreen.cpp').read_text()
+a=source.index(' if (voiceAllowed && tube_voice_state()==TUBE_VOICE_IDLE) {')
+b=source.index(' if (voiceAllowed) {',a)
+block=source[a:b]
+assert a < source.index('tube_afterglow_input(pressed, held);',a)
+assert 'held & (PadButtons::L3 | PadButtons::TouchPad)' in (work/'core/src/Application.cpp').read_text()
+code=r'''
+#include
+#include
+#include
+#include
+#include "maxd/quick_switch.h"
+namespace PadButtons {constexpr uint32_t TouchPad=1,Circle=2;}
+static int voice,opened;static bool afterglow;
+constexpr int TUBE_VOICE_IDLE=0;
+static int tube_voice_state(){return voice;}
+static bool tube_afterglow_shown(){return afterglow;}
+static int tube_afterglow_open_quick_switch(){++opened;return 1;}
+static void evo_rmlui_provider_push_folder(const char *id,const char *title){assert(!std::strcmp(id,"settings:quick-switch")&&!std::strcmp(title,"Quick Switch"));++opened;}
+struct Host {MaxdQuickSwitch m_quickSwitch{};bool voiceAllowed=true;uint32_t seen=0;
+bool input(uint32_t pressed,uint32_t held,uint32_t released) {
+'''+block+r'''
+seen=pressed;return false;
+}};
+int main(){
+ for(afterglow=false;;afterglow=true){
+ Host h;opened=0;assert(h.input(1,1,0));assert(!h.input(0,0,1)&&h.seen==1&&!opened);
+ assert(h.input(1,1,0));h.m_quickSwitch.since-=700;
+ assert(h.input(0,1,0)&&opened==1);assert(h.input(0,1,0)&&opened==1);assert(!h.input(0,0,1));
+ assert(h.input(1,1,0));assert(!h.input(2,1,0)&&h.seen==2&&opened==1);
+ h.voiceAllowed=false;assert(!h.input(1,1,0)&&opened==1);
+ if(afterglow)break;
+ }
+}
+'''
+with tempfile.TemporaryDirectory(prefix='maxd-quick-switch-') as directory:
+ path=Path(directory);(path/'test.cpp').write_text(code)
+ subprocess.run(['g++','-std=c++17','-Wall','-Wextra','-Werror','-fsanitize=address,undefined','-fno-omit-frame-pointer','-I'+str(root/'native'),str(path/'test.cpp'),'-o',str(path/'test')],check=True)
+ subprocess.run([str(path/'test')],check=True)
+print('PASS: shipping Quick Switch Classic/Afterglow routing, held sampling, short-tap preservation, one-shot holds, Circle and unavailable-context guards')
diff --git a/scripts/test_sleep_timer.sh b/scripts/test_sleep_timer.sh
index fad27c25..c9074339 100644
--- a/scripts/test_sleep_timer.sh
+++ b/scripts/test_sleep_timer.sh
@@ -7,7 +7,7 @@ mkdir -p "${root}/build/tests"
cc -std=c11 -D_DEFAULT_SOURCE -Dclock_gettime=tube_test_clock_gettime -O1 -g -Wall -Wextra -Werror \
-fsanitize=address,undefined -fno-omit-frame-pointer \
-I"${root}/native" -I"${evo}/include" -I"${evo}/addons/include" \
- "${root}/tests/test_sleep_timer.c" "${root}/native/tube_provider.c" "${root}/native/tube_remote.c" "${root}/native/tube_player_extra.c" "${root}/native/tube_backup.c" \
+ "${root}/tests/test_sleep_timer.c" "${root}/native/tube_provider.c" "${root}/native/maxd/party_server.c" "${root}/native/maxd/phone_remote.c" "${root}/native/maxd/diagnostics.c" "${root}/native/tube_remote.c" "${root}/native/tube_phone.c" "${root}/native/tube_player_extra.c" "${root}/native/tube_backup.c" \
"${evo}/addons/src/cJSON.c" "${evo}/addons/src/evo_provider_mgr.c" "${evo}/src/evo_data_path.c" \
-lm -o "${root}/build/tests/test_sleep_timer"
ASAN_OPTIONS=${ASAN_OPTIONS:-detect_leaks=1} "${root}/build/tests/test_sleep_timer"
diff --git a/scripts/voice_controls_overlay.py b/scripts/voice_controls_overlay.py
index e2bbfc96..3247326a 100644
--- a/scripts/voice_controls_overlay.py
+++ b/scripts/voice_controls_overlay.py
@@ -2,14 +2,15 @@
def apply_voice_controls_overlay(replace, player, host):
header = player + "core/include/evo/screens/ProviderHostScreen.hpp"
- replace(header, '#include ', '#include \n#include "voice_gesture.h"')
+ replace(header, '#include ', '#include \n#include "voice_gesture.h"\n#include "quick_switch.h"')
replace(header, " static bool playbackStartupBusy();", " static bool playbackStartupBusy();\n bool submitVoiceQuery(const char* query);")
- replace(header, " void startSelected();", " bool m_voiceHeld = false;\n MaxdVoiceGesture m_voiceGesture{};\n void startSelected();")
+ replace(header, " void startSelected();", " bool m_voiceHeld = false;\n MaxdVoiceGesture m_voiceGesture{};\n MaxdQuickSwitch m_quickSwitch{};\n void startSelected();")
replace(host, '#include "tube_provider.h"', '#include "tube_provider.h"\n#include "tube_voice.h"')
replace(host, "void ProviderHostScreen::onExit()\n{", """void ProviderHostScreen::onExit()
{
m_voiceHeld = false;
m_voiceGesture = MaxdVoiceGesture{};
+ m_quickSwitch = MaxdQuickSwitch{};
if (m_providerId == "youtube") tube_voice_cancel();""")
replace(host, " (void)held;\n (void)released;", """ (void)held;
if (m_providerId == "youtube") {
@@ -33,6 +34,17 @@ def apply_voice_controls_overlay(replace, player, host):
m_signIn != SignIn::Suggest && m_signIn != SignIn::Signing && !evo_keyboard_is_open() &&
!evo_rmlui_provider_panel_open() &&
(!tube_afterglow_shown() || tube_afterglow_voice_allowed());
+ if (voiceAllowed && tube_voice_state()==TUBE_VOICE_IDLE) {
+ const auto quickTime=std::chrono::duration_cast(std::chrono::steady_clock::now().time_since_epoch()).count();
+ const int quick=maxd_quick_switch(&m_quickSwitch,!!(pressed&PadButtons::TouchPad),!!(held&PadButtons::TouchPad),!!(released&PadButtons::TouchPad),!!(pressed&PadButtons::Circle),quickTime);
+ if(quick==MAXD_QUICK_OPEN) {
+ if(tube_afterglow_shown())tube_afterglow_open_quick_switch();
+ else evo_rmlui_provider_push_folder("settings:quick-switch","Quick Switch");
+ return true;
+ }
+ if(quick==MAXD_QUICK_WAIT)return true;
+ if(quick==MAXD_QUICK_TAP)pressed|=PadButtons::TouchPad;
+ } else m_quickSwitch=MaxdQuickSwitch{};
if (voiceAllowed) {
if (!tube_afterglow_shown() && (pressed & PadButtons::L3) && evo_rmlui_provider_discussion_key(5)) return true;
const auto time = std::chrono::duration_cast(
@@ -72,7 +84,7 @@ def apply_voice_controls_overlay(replace, player, host):
# EVO dispatches only button edges. A hold must be sampled between those
# edges or it can never reach the push-to-talk threshold.
replace(app, " if (hasInput) {\n m_screenManager->handleInput(pressed, held, released);",
- " if (hasInput || ((held & PadButtons::L3) && m_screenManager &&\n m_screenManager->getCurrentScreenId() == ScreenId::EmbyBrowse)) {\n m_screenManager->handleInput(pressed, held, released);")
+ " if (hasInput || ((held & (PadButtons::L3 | PadButtons::TouchPad)) && m_screenManager &&\n m_screenManager->getCurrentScreenId() == ScreenId::EmbyBrowse)) {\n m_screenManager->handleInput(pressed, held, released);")
replace(app, " int uiActive = (frame < 10) ||", " int uiActive = tube_voice_state() == TUBE_VOICE_RECORDING ||\n tube_voice_state() == TUBE_VOICE_TRANSCRIBING || (frame < 10) ||")
replace(app, '#include "tube_phone.h"', '#include "tube_phone.h"\n#include "tube_voice.h"')
replace(app, " tube_phone_sync_scope(); /* retire changed profiles before resolver callbacks */", """ tube_phone_sync_scope(); /* retire changed profiles before resolver callbacks */
diff --git a/store/sce_sys/param.json b/store/sce_sys/param.json
index 22de1b0e..9ac17772 100644
--- a/store/sce_sys/param.json
+++ b/store/sce_sys/param.json
@@ -10,7 +10,7 @@
"conceptId": "99991",
"contentBadgeType": 2,
"contentId": "UP9000-PPSA99991_00-TUBEDECK00000001",
- "contentVersion": "01.005.000",
+ "contentVersion": "01.006.000",
"downloadDataSize": 256,
"kernel": {
"flexibleMemorySize": 1073741824
diff --git a/tests/afterglow/boards/maxd-everyday.json b/tests/afterglow/boards/maxd-everyday.json
new file mode 100644
index 00000000..03749f26
--- /dev/null
+++ b/tests/afterglow/boards/maxd-everyday.json
@@ -0,0 +1,173 @@
+{
+ "about": "Everyday controls from real provider fixture exports; ordinary and larger text",
+ "boards": [
+ {
+ "name": "maxd-everyday-presets-100",
+ "fixture": "guest",
+ "route": {
+ "screen": "settings",
+ "argument": "settings:presets",
+ "title": "Playback presets"
+ },
+ "text_scale": 1.0,
+ "reduced_motion": true,
+ "expect": {
+ "screen": "settings"
+ }
+ },
+ {
+ "name": "maxd-everyday-presets-120",
+ "fixture": "guest",
+ "route": {
+ "screen": "settings",
+ "argument": "settings:presets",
+ "title": "Playback presets"
+ },
+ "text_scale": 1.2,
+ "reduced_motion": true,
+ "expect": {
+ "screen": "settings"
+ }
+ },
+ {
+ "name": "maxd-everyday-preset-slot-100",
+ "fixture": "guest",
+ "route": {
+ "screen": "settings",
+ "argument": "settings:presets:guest:0",
+ "title": "Movies"
+ },
+ "text_scale": 1.0,
+ "reduced_motion": true,
+ "expect": {
+ "screen": "settings"
+ }
+ },
+ {
+ "name": "maxd-everyday-preset-slot-120",
+ "fixture": "guest",
+ "route": {
+ "screen": "settings",
+ "argument": "settings:presets:guest:0",
+ "title": "Movies"
+ },
+ "text_scale": 1.2,
+ "reduced_motion": true,
+ "expect": {
+ "screen": "settings"
+ }
+ },
+ {
+ "name": "maxd-everyday-accessibility-100",
+ "fixture": "guest",
+ "route": {
+ "screen": "settings",
+ "argument": "settings:accessibility",
+ "title": "Accessibility"
+ },
+ "text_scale": 1.0,
+ "reduced_motion": true,
+ "expect": {
+ "screen": "settings"
+ }
+ },
+ {
+ "name": "maxd-everyday-accessibility-120",
+ "fixture": "guest",
+ "route": {
+ "screen": "settings",
+ "argument": "settings:accessibility",
+ "title": "Accessibility"
+ },
+ "text_scale": 1.2,
+ "reduced_motion": true,
+ "expect": {
+ "screen": "settings"
+ }
+ },
+ {
+ "name": "maxd-everyday-catchup-100",
+ "fixture": "guest",
+ "route": {
+ "screen": "settings",
+ "argument": "settings:catchup",
+ "title": "Subscription catch-up"
+ },
+ "text_scale": 1.0,
+ "reduced_motion": true,
+ "expect": {
+ "screen": "settings"
+ }
+ },
+ {
+ "name": "maxd-everyday-catchup-120",
+ "fixture": "guest",
+ "route": {
+ "screen": "settings",
+ "argument": "settings:catchup",
+ "title": "Subscription catch-up"
+ },
+ "text_scale": 1.2,
+ "reduced_motion": true,
+ "expect": {
+ "screen": "settings"
+ }
+ },
+ {
+ "name": "maxd-everyday-catchup-editor-100",
+ "fixture": "guest",
+ "route": {
+ "screen": "settings",
+ "argument": "settings:smart:1",
+ "title": "Catch-up rules"
+ },
+ "text_scale": 1.0,
+ "reduced_motion": true,
+ "expect": {
+ "screen": "settings"
+ }
+ },
+ {
+ "name": "maxd-everyday-catchup-editor-120",
+ "fixture": "guest",
+ "route": {
+ "screen": "settings",
+ "argument": "settings:smart:1",
+ "title": "Catch-up rules"
+ },
+ "text_scale": 1.2,
+ "reduced_motion": true,
+ "expect": {
+ "screen": "settings"
+ }
+ },
+ {
+ "name": "maxd-everyday-sleep-100",
+ "fixture": "guest",
+ "route": {
+ "screen": "settings",
+ "argument": "settings:rest",
+ "title": "Sleep timer"
+ },
+ "text_scale": 1.0,
+ "reduced_motion": true,
+ "expect": {
+ "screen": "settings"
+ }
+ },
+ {
+ "name": "maxd-everyday-sleep-120",
+ "fixture": "guest",
+ "route": {
+ "screen": "settings",
+ "argument": "settings:rest",
+ "title": "Sleep timer"
+ },
+ "text_scale": 1.2,
+ "reduced_motion": true,
+ "expect": {
+ "screen": "settings"
+ }
+ }
+ ]
+}
diff --git a/tests/afterglow/boards/maxd-reliability.json b/tests/afterglow/boards/maxd-reliability.json
new file mode 100644
index 00000000..a1f14e10
--- /dev/null
+++ b/tests/afterglow/boards/maxd-reliability.json
@@ -0,0 +1,201 @@
+{
+ "about": "Reliability controls exported from the real provider; normal and larger text",
+ "boards": [
+ {
+ "name": "maxd-reliability-maintenance-100",
+ "fixture": "guest",
+ "route": {
+ "screen": "settings",
+ "argument": "settings:reliability",
+ "title": "Playback and maintenance"
+ },
+ "text_scale": 1.0,
+ "reduced_motion": true,
+ "expect": {
+ "screen": "settings"
+ }
+ },
+ {
+ "name": "maxd-reliability-maintenance-120",
+ "fixture": "guest",
+ "route": {
+ "screen": "settings",
+ "argument": "settings:reliability",
+ "title": "Playback and maintenance"
+ },
+ "text_scale": 1.2,
+ "reduced_motion": true,
+ "expect": {
+ "screen": "settings"
+ }
+ },
+ {
+ "name": "maxd-reliability-channel-100",
+ "fixture": "guest",
+ "route": {
+ "screen": "settings",
+ "argument": "settings:channel-prefs:guest:UCabcdefghijklmnopqrstuv",
+ "title": "Channel preferences"
+ },
+ "text_scale": 1.0,
+ "reduced_motion": true,
+ "expect": {
+ "screen": "settings"
+ }
+ },
+ {
+ "name": "maxd-reliability-channel-120",
+ "fixture": "guest",
+ "route": {
+ "screen": "settings",
+ "argument": "settings:channel-prefs:guest:UCabcdefghijklmnopqrstuv",
+ "title": "Channel preferences"
+ },
+ "text_scale": 1.2,
+ "reduced_motion": true,
+ "expect": {
+ "screen": "settings"
+ }
+ },
+ {
+ "name": "maxd-reliability-recovery-100",
+ "fixture": "guest",
+ "route": {
+ "screen": "settings",
+ "argument": "settings:session-recovery",
+ "title": "Interrupted session"
+ },
+ "text_scale": 1.0,
+ "reduced_motion": true,
+ "expect": {
+ "screen": "settings"
+ }
+ },
+ {
+ "name": "maxd-reliability-recovery-120",
+ "fixture": "guest",
+ "route": {
+ "screen": "settings",
+ "argument": "settings:session-recovery",
+ "title": "Interrupted session"
+ },
+ "text_scale": 1.2,
+ "reduced_motion": true,
+ "expect": {
+ "screen": "settings"
+ }
+ },
+ {
+ "name": "maxd-reliability-diagnostics-100",
+ "fixture": "guest",
+ "route": {
+ "screen": "settings",
+ "argument": "settings:playback-diagnostics",
+ "title": "Playback diagnostics"
+ },
+ "text_scale": 1.0,
+ "reduced_motion": true,
+ "expect": {
+ "screen": "settings"
+ }
+ },
+ {
+ "name": "maxd-reliability-diagnostics-120",
+ "fixture": "guest",
+ "route": {
+ "screen": "settings",
+ "argument": "settings:playback-diagnostics",
+ "title": "Playback diagnostics"
+ },
+ "text_scale": 1.2,
+ "reduced_motion": true,
+ "expect": {
+ "screen": "settings"
+ }
+ },
+ {
+ "name": "maxd-reliability-quick-100",
+ "fixture": "guest",
+ "route": {
+ "screen": "settings",
+ "argument": "settings:quick-switch",
+ "title": "Quick Switch"
+ },
+ "text_scale": 1.0,
+ "reduced_motion": true,
+ "expect": {
+ "screen": "settings"
+ }
+ },
+ {
+ "name": "maxd-reliability-quick-120",
+ "fixture": "guest",
+ "route": {
+ "screen": "settings",
+ "argument": "settings:quick-switch",
+ "title": "Quick Switch"
+ },
+ "text_scale": 1.2,
+ "reduced_motion": true,
+ "expect": {
+ "screen": "settings"
+ }
+ },
+ {
+ "name": "maxd-reliability-storage-100",
+ "fixture": "guest",
+ "route": {
+ "screen": "settings",
+ "argument": "settings:storage",
+ "title": "Storage and cache"
+ },
+ "text_scale": 1.0,
+ "reduced_motion": true,
+ "expect": {
+ "screen": "settings"
+ }
+ },
+ {
+ "name": "maxd-reliability-storage-120",
+ "fixture": "guest",
+ "route": {
+ "screen": "settings",
+ "argument": "settings:storage",
+ "title": "Storage and cache"
+ },
+ "text_scale": 1.2,
+ "reduced_motion": true,
+ "expect": {
+ "screen": "settings"
+ }
+ },
+ {
+ "name": "maxd-reliability-backup-preview-100",
+ "fixture": "guest",
+ "route": {
+ "screen": "settings",
+ "argument": "settings:backup:entry:reliability",
+ "title": "Import preview"
+ },
+ "text_scale": 1.0,
+ "reduced_motion": true,
+ "expect": {
+ "screen": "settings"
+ }
+ },
+ {
+ "name": "maxd-reliability-backup-preview-120",
+ "fixture": "guest",
+ "route": {
+ "screen": "settings",
+ "argument": "settings:backup:entry:reliability",
+ "title": "Import preview"
+ },
+ "text_scale": 1.2,
+ "reduced_motion": true,
+ "expect": {
+ "screen": "settings"
+ }
+ }
+ ]
+}
diff --git a/tests/afterglow/fixtures/d-empty/catalog/continue-watching.json b/tests/afterglow/fixtures/d-empty/catalog/continue-watching.json
new file mode 100644
index 00000000..d18ed433
--- /dev/null
+++ b/tests/afterglow/fixtures/d-empty/catalog/continue-watching.json
@@ -0,0 +1,6 @@
+{
+ "items": [
+
+ ],
+ "has_more": false
+}
diff --git a/tests/afterglow/fixtures/d-guest/catalog/continue-watching.json b/tests/afterglow/fixtures/d-guest/catalog/continue-watching.json
new file mode 100644
index 00000000..595ae2cd
--- /dev/null
+++ b/tests/afterglow/fixtures/d-guest/catalog/continue-watching.json
@@ -0,0 +1,8 @@
+{
+ "items": [
+ {"id": "sevenday000", "title": "Seven Days Alone on the Ridge Line — A Silent Hiking Film", "subtitle": "Northlight Atlas", "channel_id": "UCnorthlightatlas0000000", "art_url": "art://ridges/0/11/448x252", "duration_sec": 2892, "views": "1.2M views", "published": "3 weeks ago", "badges": ["4k", "cc"], "resume_sec": 1879, "watched": "Today, 20:14"},
+ {"id": "irebuilt001", "title": "I Rebuilt a Whole City in One Weekend (No Mods)", "subtitle": "Glassfern Games", "channel_id": "UCglassferngames00000000", "art_url": "art://city/1/23/448x252", "duration_sec": 1601, "views": "842K views", "published": "5 days ago", "resume_sec": 480, "watched": "Yesterday"},
+ {"id": "onepansi003", "title": "One Pan, Six Dinners: The Lazy Week Plan", "subtitle": "Ostrel Kitchen", "channel_id": "UCostrelkitchen000000000", "art_url": "art://plate/0/47/448x252", "duration_sec": 1113, "views": "410K views", "published": "1 day ago", "badges": ["new", "cc"], "resume_sec": 133, "watched": "Sunday"}
+ ],
+ "has_more": false
+}
diff --git a/tests/afterglow/fixtures/d-long-texts/catalog/continue-watching.json b/tests/afterglow/fixtures/d-long-texts/catalog/continue-watching.json
new file mode 100644
index 00000000..60f6240d
--- /dev/null
+++ b/tests/afterglow/fixtures/d-long-texts/catalog/continue-watching.json
@@ -0,0 +1,13 @@
+{
+ "items": [
+ {"id": "sevenday000", "title": "Donaudampfschifffahrtsgesellschaftskapitänsmützenabzeichenhersteller: warum es dieses Wort wirklich gibt", "subtitle": "Nordlicht-Atlas Dokumentarfilmgesellschaft für besonders ausführliche Naturaufnahmen", "channel_id": "UCnorthlightatlas0000000", "art_url": "art://ridges/0/11/448x252", "duration_sec": 359999, "views": "1.234.567.890 Aufrufe", "published": "vor 11 Monaten und 3 Wochen", "badges": ["4k", "cc"], "resume_sec": 1879, "watched": "Vorgestern um 23:59 Uhr", "total": 1234567},
+ {"id": "writinga009", "title": "Sieben Tage allein auf dem Grat — ein stiller Wanderfilm in voller Länge, ohne Musik und ohne Kommentar", "subtitle": "Glasfarn Spieleentwicklungsgemeinschaft", "channel_id": "UCmossbyte00000000000000", "art_url": "art://code/0/109/448x252", "duration_sec": 3764, "views": "987.654.321 Aufrufe", "published": "vor mehr als 12 Jahren", "badges": ["cc"], "resume_sec": 1693, "watched": "Am vergangenen Donnerstagnachmittag"},
+ {"id": "irebuilt001", "title": "Rechtsschutzversicherungsgesellschaften verständlich erklärt: ein außergewöhnlich langer Titel zum Prüfen der Zeilenumbrüche", "subtitle": "Umlaufbahnbrunnen Wissenschaftsvermittlung und Sternbeobachtung e. V.", "channel_id": "UCglassferngames00000000", "art_url": "art://city/1/23/448x252", "duration_sec": 1601, "views": "12,3 Mrd. Aufrufe", "published": "vor 1 Tag", "resume_sec": 480, "watched": "Gestern"},
+ {"id": "whatwoul002", "title": "Ich habe an einem einzigen verregneten Wochenende eine vollständige Großstadt neu aufgebaut (ohne Modifikationen)", "subtitle": "K", "channel_id": "UCorbitwell0000000000000", "art_url": "art://space/0/35/448x252", "duration_sec": 359999, "views": "3 Aufrufe", "published": "gerade eben", "badges": ["4k", "cc"], "resume_sec": 719, "watched": "Heute, 20:14 Uhr"},
+ {"id": "onepansi003", "title": "Wie sähe ein Sonnenuntergang auf einer anderen Welt aus? Eine ausführliche Betrachtung mit Kreide und Küchentisch", "subtitle": "Nordlicht-Atlas Dokumentarfilmgesellschaft für besonders ausführliche Naturaufnahmen", "channel_id": "UCostrelkitchen000000000", "art_url": "art://plate/0/47/448x252", "duration_sec": 1113, "views": "1.234.567.890 Aufrufe", "published": "vor 11 Monaten und 3 Wochen", "badges": ["new", "cc"], "resume_sec": 133, "watched": "Vorgestern um 23:59 Uhr"},
+ {"id": "bluehour020", "title": "Eine Pfanne, sechs Abendessen: der bequeme Wochenplan für vielbeschäftigte Menschen mit kleinem Kühlschrank", "subtitle": "Glasfarn Spieleentwicklungsgemeinschaft", "channel_id": "UCnorthlightatlas0000000", "art_url": "art://ocean/1/241/448x252", "duration_sec": 2490, "views": "987.654.321 Aufrufe", "published": "vor mehr als 12 Jahren", "badges": ["4k"], "resume_sec": 2490, "played": true, "watched": "Am vergangenen Donnerstagnachmittag"},
+ {"id": "amapofev016", "title": "Kraftfahrzeughaftpflichtversicherung", "subtitle": "Umlaufbahnbrunnen Wissenschaftsvermittlung und Sternbeobachtung e. V.", "channel_id": "UCtidewrit00000000000000", "art_url": "art://globe/1/193/448x252", "duration_sec": 359999, "views": "12,3 Mrd. Aufrufe", "published": "vor 1 Tag", "badges": ["cc"], "resume_sec": 1000, "played": true, "watched": "Gestern"},
+ {"id": "thedesks005", "title": "Kurz", "subtitle": "K", "channel_id": "UClathelumen000000000000", "art_url": "art://desk/0/61/448x252", "duration_sec": 725, "views": "3 Aufrufe", "published": "gerade eben", "badges": ["4k"], "resume_sec": 290, "watched": "Heute, 20:14 Uhr"}
+ ],
+ "has_more": true
+}
diff --git a/tests/afterglow/fixtures/d-offline/catalog/continue-watching.json b/tests/afterglow/fixtures/d-offline/catalog/continue-watching.json
new file mode 100644
index 00000000..0626c447
--- /dev/null
+++ b/tests/afterglow/fixtures/d-offline/catalog/continue-watching.json
@@ -0,0 +1,13 @@
+{
+ "items": [
+ {"id": "sevenday000", "title": "Seven Days Alone on the Ridge Line — A Silent Hiking Film", "subtitle": "Northlight Atlas", "channel_id": "UCnorthlightatlas0000000", "art_url": "art://ridges/0/11/448x252", "duration_sec": 2892, "views": "1.2M views", "published": "3 weeks ago", "badges": ["4k", "cc"], "resume_sec": 1879, "watched": "Today, 20:14", "total": 24},
+ {"id": "writinga009", "title": "Writing a Tiny Renderer in an Afternoon", "subtitle": "Mossbyte", "channel_id": "UCmossbyte00000000000000", "art_url": "art://code/0/109/448x252", "duration_sec": 3764, "views": "148K views", "published": "2 weeks ago", "badges": ["cc"], "resume_sec": 1693, "watched": "Today, 18:40"},
+ {"id": "irebuilt001", "title": "I Rebuilt a Whole City in One Weekend (No Mods)", "subtitle": "Glassfern Games", "channel_id": "UCglassferngames00000000", "art_url": "art://city/1/23/448x252", "duration_sec": 1601, "views": "842K views", "published": "5 days ago", "resume_sec": 480, "watched": "Yesterday"},
+ {"id": "whatwoul002", "title": "What Would a Sunset Look Like on Another World?", "subtitle": "Orbitwell", "channel_id": "UCorbitwell0000000000000", "art_url": "art://space/0/35/448x252", "duration_sec": 847, "views": "3.4M views", "published": "2 months ago", "badges": ["4k", "cc"], "resume_sec": 719, "watched": "Yesterday"},
+ {"id": "onepansi003", "title": "One Pan, Six Dinners: The Lazy Week Plan", "subtitle": "Ostrel Kitchen", "channel_id": "UCostrelkitchen000000000", "art_url": "art://plate/0/47/448x252", "duration_sec": 1113, "views": "410K views", "published": "1 day ago", "badges": ["new", "cc"], "resume_sec": 133, "watched": "Sunday"},
+ {"id": "bluehour020", "title": "Blue Hour on the Northern Coast, No Talking", "subtitle": "Northlight Atlas", "channel_id": "UCnorthlightatlas0000000", "art_url": "art://ocean/1/241/448x252", "duration_sec": 2490, "views": "640K views", "published": "2 months ago", "badges": ["4k"], "resume_sec": 2490, "played": true, "watched": "Sunday"},
+ {"id": "amapofev016", "title": "A Map of Every Night Train Still Running", "subtitle": "Tidewrit", "channel_id": "UCtidewrit00000000000000", "art_url": "art://globe/1/193/448x252", "duration_sec": 1000, "views": "1.4M views", "published": "3 weeks ago", "badges": ["cc"], "resume_sec": 1000, "played": true, "watched": "Last week"},
+ {"id": "thedesks005", "title": "The Desk Setup I Would Build Again From Scratch", "subtitle": "Lathe & Lumen", "channel_id": "UClathelumen000000000000", "art_url": "art://desk/0/61/448x252", "duration_sec": 725, "views": "267K views", "published": "1 week ago", "badges": ["4k"], "resume_sec": 290, "watched": "Last week"}
+ ],
+ "has_more": true
+}
diff --git a/tests/afterglow/fixtures/d-signed-in/catalog/continue-watching.json b/tests/afterglow/fixtures/d-signed-in/catalog/continue-watching.json
new file mode 100644
index 00000000..0626c447
--- /dev/null
+++ b/tests/afterglow/fixtures/d-signed-in/catalog/continue-watching.json
@@ -0,0 +1,13 @@
+{
+ "items": [
+ {"id": "sevenday000", "title": "Seven Days Alone on the Ridge Line — A Silent Hiking Film", "subtitle": "Northlight Atlas", "channel_id": "UCnorthlightatlas0000000", "art_url": "art://ridges/0/11/448x252", "duration_sec": 2892, "views": "1.2M views", "published": "3 weeks ago", "badges": ["4k", "cc"], "resume_sec": 1879, "watched": "Today, 20:14", "total": 24},
+ {"id": "writinga009", "title": "Writing a Tiny Renderer in an Afternoon", "subtitle": "Mossbyte", "channel_id": "UCmossbyte00000000000000", "art_url": "art://code/0/109/448x252", "duration_sec": 3764, "views": "148K views", "published": "2 weeks ago", "badges": ["cc"], "resume_sec": 1693, "watched": "Today, 18:40"},
+ {"id": "irebuilt001", "title": "I Rebuilt a Whole City in One Weekend (No Mods)", "subtitle": "Glassfern Games", "channel_id": "UCglassferngames00000000", "art_url": "art://city/1/23/448x252", "duration_sec": 1601, "views": "842K views", "published": "5 days ago", "resume_sec": 480, "watched": "Yesterday"},
+ {"id": "whatwoul002", "title": "What Would a Sunset Look Like on Another World?", "subtitle": "Orbitwell", "channel_id": "UCorbitwell0000000000000", "art_url": "art://space/0/35/448x252", "duration_sec": 847, "views": "3.4M views", "published": "2 months ago", "badges": ["4k", "cc"], "resume_sec": 719, "watched": "Yesterday"},
+ {"id": "onepansi003", "title": "One Pan, Six Dinners: The Lazy Week Plan", "subtitle": "Ostrel Kitchen", "channel_id": "UCostrelkitchen000000000", "art_url": "art://plate/0/47/448x252", "duration_sec": 1113, "views": "410K views", "published": "1 day ago", "badges": ["new", "cc"], "resume_sec": 133, "watched": "Sunday"},
+ {"id": "bluehour020", "title": "Blue Hour on the Northern Coast, No Talking", "subtitle": "Northlight Atlas", "channel_id": "UCnorthlightatlas0000000", "art_url": "art://ocean/1/241/448x252", "duration_sec": 2490, "views": "640K views", "published": "2 months ago", "badges": ["4k"], "resume_sec": 2490, "played": true, "watched": "Sunday"},
+ {"id": "amapofev016", "title": "A Map of Every Night Train Still Running", "subtitle": "Tidewrit", "channel_id": "UCtidewrit00000000000000", "art_url": "art://globe/1/193/448x252", "duration_sec": 1000, "views": "1.4M views", "published": "3 weeks ago", "badges": ["cc"], "resume_sec": 1000, "played": true, "watched": "Last week"},
+ {"id": "thedesks005", "title": "The Desk Setup I Would Build Again From Scratch", "subtitle": "Lathe & Lumen", "channel_id": "UClathelumen000000000000", "art_url": "art://desk/0/61/448x252", "duration_sec": 725, "views": "267K views", "published": "1 week ago", "badges": ["4k"], "resume_sec": 290, "watched": "Last week"}
+ ],
+ "has_more": true
+}
diff --git a/tests/afterglow/fixtures/empty/catalog/continue-watching.json b/tests/afterglow/fixtures/empty/catalog/continue-watching.json
new file mode 100644
index 00000000..d334d9d6
--- /dev/null
+++ b/tests/afterglow/fixtures/empty/catalog/continue-watching.json
@@ -0,0 +1,4 @@
+{
+ "items": [],
+ "has_more": false
+}
diff --git a/tests/afterglow/fixtures/guest/catalog/continue-watching.json b/tests/afterglow/fixtures/guest/catalog/continue-watching.json
new file mode 100644
index 00000000..d334d9d6
--- /dev/null
+++ b/tests/afterglow/fixtures/guest/catalog/continue-watching.json
@@ -0,0 +1,4 @@
+{
+ "items": [],
+ "has_more": false
+}
diff --git a/tests/afterglow/fixtures/guest/catalog/settings_accessibility.json b/tests/afterglow/fixtures/guest/catalog/settings_accessibility.json
new file mode 100644
index 00000000..48c769cc
--- /dev/null
+++ b/tests/afterglow/fixtures/guest/catalog/settings_accessibility.json
@@ -0,0 +1,59 @@
+{
+ "items": [{
+ "id": "settings:accessibility:guest:scale",
+ "title": "Larger interface text",
+ "subtitle": "115%; cycles 100, 115, 120%",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "action",
+ "label": "Larger interface text"
+ }, {
+ "id": "settings:accessibility:guest:contrast",
+ "title": "High contrast",
+ "subtitle": "On: yellow accent on black",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "action",
+ "label": "High contrast"
+ }, {
+ "id": "settings:accessibility:guest:motion",
+ "title": "Reduced motion",
+ "subtitle": "On: decorative travel is reduced",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "action",
+ "label": "Reduced motion"
+ }, {
+ "id": "settings:accessibility:guest:caption-background",
+ "title": "Caption background",
+ "subtitle": "Current player style; select to cycle white captions",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "action",
+ "label": "Caption background"
+ }, {
+ "id": "settings:subtitle-size",
+ "title": "Caption text size",
+ "subtitle": "Choose the player caption size",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "page",
+ "label": "Caption text size"
+ }],
+ "has_more": false
+}
\ No newline at end of file
diff --git a/tests/afterglow/fixtures/guest/catalog/settings_backup_entry_reliability.json b/tests/afterglow/fixtures/guest/catalog/settings_backup_entry_reliability.json
new file mode 100644
index 00000000..affed0cc
--- /dev/null
+++ b/tests/afterglow/fixtures/guest/catalog/settings_backup_entry_reliability.json
@@ -0,0 +1,31 @@
+{
+ "items": [{
+ "id": "settings:backup:restore:1:youtube-20261104-182004.json",
+ "title": "Restore this backup",
+ "subtitle": "Replaces the settings and library on this PS5; the current state is kept as a safety copy",
+ "overview": "Backup of 2026-11-04 18:20 UTC. Restoring it also restores the companion pairing it held: pair again if the companion was paired since. Cross restores; Circle returns without changing anything.\n\nStored data preview: Settings: 2; videos: 2; favorites: 0; queued: 1; bookmarks: 0; channels: 1; presets: 0",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0
+ }, {
+ "id": "settings:backup:delete:1:youtube-20261104-182004.json",
+ "title": "Delete this backup",
+ "subtitle": "Removes this file only",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0
+ }, {
+ "id": "account:notice:backup-preview",
+ "title": "Import preview",
+ "subtitle": "Settings: 2; videos: 2; favorites: 0; queued: 1; bookmarks: 0; channels: 1; presets: 0",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0
+ }],
+ "has_more": false
+}
\ No newline at end of file
diff --git a/tests/afterglow/fixtures/guest/catalog/settings_catchup.json b/tests/afterglow/fixtures/guest/catalog/settings_catchup.json
new file mode 100644
index 00000000..e25ad402
--- /dev/null
+++ b/tests/afterglow/fixtures/guest/catalog/settings_catchup.json
@@ -0,0 +1,26 @@
+{
+ "items": [{
+ "id": "settings:catchup:new:guest",
+ "title": "Create catch-up queue",
+ "subtitle": "Subscriptions, unwatched uploads, chosen channels and a time budget",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "action",
+ "label": "Create catch-up queue"
+ }, {
+ "id": "settings:smart:1",
+ "title": "Subscription catch-up",
+ "subtitle": "Edit filters, preview matching videos or append them to your play queue",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "page",
+ "label": "Subscription catch-up"
+ }],
+ "has_more": false
+}
\ No newline at end of file
diff --git a/tests/afterglow/fixtures/guest/catalog/settings_channel-prefs_guest_UCabcdefghijklmnopqrstuv.json b/tests/afterglow/fixtures/guest/catalog/settings_channel-prefs_guest_UCabcdefghijklmnopqrstuv.json
new file mode 100644
index 00000000..0ba08772
--- /dev/null
+++ b/tests/afterglow/fixtures/guest/catalog/settings_channel-prefs_guest_UCabcdefghijklmnopqrstuv.json
@@ -0,0 +1,59 @@
+{
+ "items": [{
+ "id": "settings:channel-prefs:guest:UCabcdefghijklmnopqrstuv:quality",
+ "title": "Quality ceiling",
+ "subtitle": "Up to 720p; still respects the profile ceiling",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "action",
+ "label": "Quality ceiling"
+ }, {
+ "id": "settings:channel-prefs:guest:UCabcdefghijklmnopqrstuv:speed",
+ "title": "Playback speed",
+ "subtitle": "0.5x for future videos",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "action",
+ "label": "Playback speed"
+ }, {
+ "id": "settings:channel-prefs:guest:UCabcdefghijklmnopqrstuv:captions",
+ "title": "Captions",
+ "subtitle": "Off for this channel",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "action",
+ "label": "Captions"
+ }, {
+ "id": "settings:channel-prefs:guest:UCabcdefghijklmnopqrstuv:leveling",
+ "title": "Volume leveling",
+ "subtitle": "On when loudness metadata is available",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "action",
+ "label": "Volume leveling"
+ }, {
+ "id": "settings:channel-prefs:guest:UCabcdefghijklmnopqrstuv:reset",
+ "title": "Reset channel overrides",
+ "subtitle": "Keep the existing profile settings and legacy caption/speed memories",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "action",
+ "label": "Reset channel overrides"
+ }],
+ "has_more": false
+}
\ No newline at end of file
diff --git a/tests/afterglow/fixtures/guest/catalog/settings_playback-diagnostics.json b/tests/afterglow/fixtures/guest/catalog/settings_playback-diagnostics.json
new file mode 100644
index 00000000..fa4ed031
--- /dev/null
+++ b/tests/afterglow/fixtures/guest/catalog/settings_playback-diagnostics.json
@@ -0,0 +1,31 @@
+{
+ "items": [{
+ "id": "account:notice",
+ "title": "Last observed playback failure",
+ "subtitle": "The video decoder reported an error. Try an available AVC format at up to 1080p30 SDR in Playback health & rescue.",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0
+ }, {
+ "id": "account:notice:diagnostics",
+ "title": "Recovery options",
+ "subtitle": "During playback, press R2 and select Playback health & rescue to review lower-quality and compatible AVC alternatives. Alternatives depend on the formats alrea",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0
+ }, {
+ "id": "settings:codec",
+ "title": "Default codec",
+ "subtitle": "Select Auto or another supported codec for future resolves",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0
+ }],
+ "has_more": false
+}
\ No newline at end of file
diff --git a/tests/afterglow/fixtures/guest/catalog/settings_presets.json b/tests/afterglow/fixtures/guest/catalog/settings_presets.json
new file mode 100644
index 00000000..ebcda469
--- /dev/null
+++ b/tests/afterglow/fixtures/guest/catalog/settings_presets.json
@@ -0,0 +1,37 @@
+{
+ "items": [{
+ "id": "settings:presets:guest:0",
+ "title": "Movies",
+ "subtitle": "Default: up to 2160p, 30 fps; 1x speed",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "page",
+ "label": "Movies"
+ }, {
+ "id": "settings:presets:guest:1",
+ "title": "Gaming",
+ "subtitle": "Default: up to 1080p, 60 fps; 1x speed",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "page",
+ "label": "Gaming"
+ }, {
+ "id": "settings:presets:guest:2",
+ "title": "Listening",
+ "subtitle": "Default: up to 720p, 30 fps; 1x speed",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "page",
+ "label": "Listening"
+ }],
+ "has_more": false
+}
\ No newline at end of file
diff --git a/tests/afterglow/fixtures/guest/catalog/settings_presets_guest_0.json b/tests/afterglow/fixtures/guest/catalog/settings_presets_guest_0.json
new file mode 100644
index 00000000..59cb6ba5
--- /dev/null
+++ b/tests/afterglow/fixtures/guest/catalog/settings_presets_guest_0.json
@@ -0,0 +1,37 @@
+{
+ "items": [{
+ "id": "settings:presets:guest:0:apply",
+ "title": "Use this preset",
+ "subtitle": "Applies to the next resolved video; current playback stays as it is",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "action",
+ "label": "Use this preset"
+ }, {
+ "id": "settings:presets:guest:0:save",
+ "title": "Save current preferences",
+ "subtitle": "Save quality, FPS, codec, speed, audio/caption languages and Auto Max to this slot",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "action",
+ "label": "Save current preferences"
+ }, {
+ "id": "settings:presets:guest:0:reset",
+ "title": "Reset this slot",
+ "subtitle": "Restore the built-in Movies, Gaming or Listening defaults",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "action",
+ "label": "Reset this slot"
+ }],
+ "has_more": false
+}
\ No newline at end of file
diff --git a/tests/afterglow/fixtures/guest/catalog/settings_quick-switch.json b/tests/afterglow/fixtures/guest/catalog/settings_quick-switch.json
new file mode 100644
index 00000000..1dfeb66e
--- /dev/null
+++ b/tests/afterglow/fixtures/guest/catalog/settings_quick-switch.json
@@ -0,0 +1,55 @@
+{
+ "items": [{
+ "id": "continue-watching",
+ "title": "Continue Watching",
+ "subtitle": "Jump to this page",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "link",
+ "label": "Continue Watching",
+ "screen": "grid",
+ "argument": "continue-watching"
+ }, {
+ "id": "library:subscriptions",
+ "title": "Subscriptions",
+ "subtitle": "Jump to this page",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "link",
+ "label": "Subscriptions",
+ "screen": "grid",
+ "argument": "library:subscriptions"
+ }, {
+ "id": "search-history",
+ "title": "Search",
+ "subtitle": "Square starts a new search; recent queries remain available",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "link",
+ "label": "Search",
+ "screen": "search"
+ }, {
+ "id": "queue",
+ "title": "Play queue",
+ "subtitle": "Jump to this page",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "link",
+ "label": "Play queue",
+ "screen": "grid",
+ "argument": "queue"
+ }],
+ "has_more": false
+}
\ No newline at end of file
diff --git a/tests/afterglow/fixtures/guest/catalog/settings_reliability.json b/tests/afterglow/fixtures/guest/catalog/settings_reliability.json
new file mode 100644
index 00000000..6eaa93ec
--- /dev/null
+++ b/tests/afterglow/fixtures/guest/catalog/settings_reliability.json
@@ -0,0 +1,70 @@
+{
+ "items": [{
+ "id": "settings:channel-prefs",
+ "title": "Channel preferences",
+ "subtitle": "Open these controls",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "page",
+ "label": "Channel preferences"
+ }, {
+ "id": "settings:session-recovery",
+ "title": "Interrupted session",
+ "subtitle": "Open these controls",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "page",
+ "label": "Interrupted session"
+ }, {
+ "id": "settings:playback-diagnostics",
+ "title": "Playback diagnostics",
+ "subtitle": "Open these controls",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "page",
+ "label": "Playback diagnostics"
+ }, {
+ "id": "settings:quick-switch",
+ "title": "Quick Switch",
+ "subtitle": "Open these controls",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "page",
+ "label": "Quick Switch"
+ }, {
+ "id": "settings:storage",
+ "title": "Storage and cache",
+ "subtitle": "Open these controls",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "page",
+ "label": "Storage and cache"
+ }, {
+ "id": "settings:backup",
+ "title": "Offline backup and restore",
+ "subtitle": "Open these controls",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "page",
+ "label": "Offline backup and restore"
+ }],
+ "has_more": false
+}
\ No newline at end of file
diff --git a/tests/afterglow/fixtures/guest/catalog/settings_rest.json b/tests/afterglow/fixtures/guest/catalog/settings_rest.json
new file mode 100644
index 00000000..d28607bb
--- /dev/null
+++ b/tests/afterglow/fixtures/guest/catalog/settings_rest.json
@@ -0,0 +1,110 @@
+{
+ "items": [{
+ "id": "account:notice",
+ "title": "Sleep timer status",
+ "subtitle": "Off",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0
+ }, {
+ "id": "settings:rest:guest:off",
+ "title": "Turn sleep timer off",
+ "subtitle": "Cancels the session timer and inactivity timer",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "action",
+ "label": "Turn sleep timer off"
+ }, {
+ "id": "settings:rest:guest:end",
+ "title": "When this video ends",
+ "subtitle": "Pause once instead of repeat, autoplay or the next queued video",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "action",
+ "label": "When this video ends"
+ }, {
+ "id": "settings:rest:guest:15",
+ "title": "Pause in 15 minutes",
+ "subtitle": "Elapsed time; input does not restart the timer",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "action",
+ "label": "Pause in 15 minutes"
+ }, {
+ "id": "settings:rest:guest:30",
+ "title": "Pause in 30 minutes",
+ "subtitle": "Elapsed time; input does not restart the timer",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "action",
+ "label": "Pause in 30 minutes"
+ }, {
+ "id": "settings:rest:guest:45",
+ "title": "Pause in 45 minutes",
+ "subtitle": "Elapsed time; input does not restart the timer",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "action",
+ "label": "Pause in 45 minutes"
+ }, {
+ "id": "settings:rest:guest:60",
+ "title": "Pause in 60 minutes",
+ "subtitle": "Elapsed time; input does not restart the timer",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "action",
+ "label": "Pause in 60 minutes"
+ }, {
+ "id": "settings:rest:guest:90",
+ "title": "Pause in 90 minutes",
+ "subtitle": "Elapsed time; input does not restart the timer",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "action",
+ "label": "Pause in 90 minutes"
+ }, {
+ "id": "settings:rest:guest:120",
+ "title": "Pause in 120 minutes",
+ "subtitle": "Elapsed time; input does not restart the timer",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "action",
+ "label": "Pause in 120 minutes"
+ }, {
+ "id": "settings:sleep-timer",
+ "title": "Inactivity timer",
+ "subtitle": "Existing input-reset timer; choosing it cancels the session timer",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0
+ }],
+ "has_more": false
+}
\ No newline at end of file
diff --git a/tests/afterglow/fixtures/guest/catalog/settings_session-recovery.json b/tests/afterglow/fixtures/guest/catalog/settings_session-recovery.json
new file mode 100644
index 00000000..8caa20cb
--- /dev/null
+++ b/tests/afterglow/fixtures/guest/catalog/settings_session-recovery.json
@@ -0,0 +1,41 @@
+{
+ "items": [{
+ "id": "settings:session-recovery:guest:resume",
+ "title": "Resume interrupted video",
+ "subtitle": "Saved position 2:03; queue order is retained. Playback starts only if you select Resume.",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "link",
+ "label": "Resume interrupted video",
+ "screen": "grid",
+ "argument": "settings:session-recovery:guest:resume"
+ }, {
+ "id": "queue",
+ "title": "Review remaining play queue",
+ "subtitle": "Review or reorder saved entries before resuming",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "link",
+ "label": "Review remaining play queue",
+ "screen": "grid",
+ "argument": "queue"
+ }, {
+ "id": "settings:session-recovery:guest:dismiss",
+ "title": "Dismiss interruption offer",
+ "subtitle": "Keep the queue, bookmarks and saved history",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "action",
+ "label": "Dismiss interruption offer"
+ }],
+ "has_more": false
+}
\ No newline at end of file
diff --git a/tests/afterglow/fixtures/guest/catalog/settings_smart_1.json b/tests/afterglow/fixtures/guest/catalog/settings_smart_1.json
new file mode 100644
index 00000000..e088bb4c
--- /dev/null
+++ b/tests/afterglow/fixtures/guest/catalog/settings_smart_1.json
@@ -0,0 +1,144 @@
+{
+ "items": [{
+ "id": "maxd:smart:run:1",
+ "title": "Open playlist",
+ "subtitle": "Refresh matching videos from the first eight feed pages (up to 128 matches)",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "link",
+ "label": "Open playlist",
+ "screen": "grid",
+ "argument": "maxd:smart:run:1"
+ }, {
+ "id": "settings:smart:1:budget",
+ "title": "Time budget",
+ "subtitle": "Up to 30 minutes",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "cycle",
+ "label": "Time budget",
+ "value": "Up to 30 minutes"
+ }, {
+ "id": "settings:smart:1:name",
+ "title": "Name",
+ "subtitle": "Subscription catch-up",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "text",
+ "label": "Name",
+ "value": "Subscription catch-up"
+ }, {
+ "id": "settings:smart:1:channels",
+ "title": "Choose channels",
+ "subtitle": "None selected includes all subscription channels; up to eight explicit channels",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "page",
+ "label": "Choose channels"
+ }, {
+ "id": "settings:smart:1:shorts",
+ "title": "Hide Shorts",
+ "subtitle": "On",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "cycle",
+ "label": "Hide Shorts",
+ "value": "On"
+ }, {
+ "id": "settings:smart:1:enqueue",
+ "title": "Append matching videos to queue",
+ "subtitle": "Keeps existing entries; avoids duplicates; scans at most eight pages",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "action",
+ "label": "Append matching videos to queue"
+ }, {
+ "id": "settings:smart:1:keyword",
+ "title": "Title contains",
+ "subtitle": "Any title",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "text",
+ "label": "Title contains"
+ }, {
+ "id": "settings:smart:1:creator",
+ "title": "Creator contains",
+ "subtitle": "Any creator",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "text",
+ "label": "Creator contains"
+ }, {
+ "id": "settings:smart:1:duration",
+ "title": "Duration",
+ "subtitle": "Any duration",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "cycle",
+ "label": "Duration",
+ "value": "Any duration"
+ }, {
+ "id": "settings:smart:1:unwatched",
+ "title": "Unwatched only: on",
+ "subtitle": "Account and local watched markers",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "cycle",
+ "label": "Unwatched only",
+ "value": "On"
+ }, {
+ "id": "settings:smart:1:live",
+ "title": "Hide live videos: on",
+ "subtitle": "Upcoming videos are always excluded",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "cycle",
+ "label": "Hide live videos",
+ "value": "On"
+ }, {
+ "id": "settings:smart:1:delete",
+ "title": "Delete playlist",
+ "subtitle": "Review before deleting local rules",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "page",
+ "label": "Delete playlist"
+ }],
+ "has_more": false
+}
\ No newline at end of file
diff --git a/tests/afterglow/fixtures/guest/catalog/settings_storage.json b/tests/afterglow/fixtures/guest/catalog/settings_storage.json
new file mode 100644
index 00000000..08b718fa
--- /dev/null
+++ b/tests/afterglow/fixtures/guest/catalog/settings_storage.json
@@ -0,0 +1,35 @@
+{
+ "items": [{
+ "id": "settings:storage:guest:thumbnails",
+ "title": "Clear Afterglow thumbnail RAM",
+ "subtitle": "2.0 MiB, 2 ready pictures; reloaded on demand",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "action",
+ "label": "Clear Afterglow thumbnail RAM"
+ }, {
+ "id": "settings:storage:guest:captions",
+ "title": "Clear temporary caption file",
+ "subtitle": "0 KiB; available only when playback and requests are idle",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0,
+ "kind": "action",
+ "label": "Clear temporary caption file"
+ }, {
+ "id": "account:notice",
+ "title": "Saved data is kept",
+ "subtitle": "These controls do not remove profiles, credentials, bookmarks, queue records, backups or the voice model. Thumbnail RAM is separate from disk usage.",
+ "overview": "",
+ "is_folder": true,
+ "interface": true,
+ "duration_sec": 0,
+ "resume_sec": 0
+ }],
+ "has_more": false
+}
\ No newline at end of file
diff --git a/tests/afterglow/fixtures/long-texts/catalog/continue-watching.json b/tests/afterglow/fixtures/long-texts/catalog/continue-watching.json
new file mode 100644
index 00000000..67008d02
--- /dev/null
+++ b/tests/afterglow/fixtures/long-texts/catalog/continue-watching.json
@@ -0,0 +1,95 @@
+{
+ "items": [
+ {
+ "id": "vid00xxxxxx",
+ "title": "Seven Days Alone on the Ridge Line — A Silent Hiking Film — Seven Days Alone on the Ridge Line — A Silent Hiking Film (the complete, unabridged, remastered edition)",
+ "subtitle": "Northlight Atlas International Broadcasting Collective Archive",
+ "channel_id": "UCfixture000000000000000",
+ "art_url": "art://ridges/0/11",
+ "views": "1,204,331,882 views",
+ "published": "3 weeks ago",
+ "duration_sec": 2892,
+ "badges": [
+ "4k",
+ "cc"
+ ],
+ "resume_sec": 1879,
+ "overview": "An invented description for the pictures of the interface."
+ },
+ {
+ "id": "vid09xxxxxx",
+ "title": "Writing a Tiny Renderer in an Afternoon — Writing a Tiny Renderer in an Afternoon (the complete, unabridged, remastered edition)",
+ "subtitle": "Mossbyte International Broadcasting Collective Archive",
+ "channel_id": "UCfixture000000000000009",
+ "art_url": "art://code/0/109",
+ "views": "1,204,331,882 views",
+ "published": "2 weeks ago",
+ "duration_sec": 3764,
+ "badges": [
+ "cc"
+ ],
+ "resume_sec": 1693,
+ "overview": "An invented description for the pictures of the interface."
+ },
+ {
+ "id": "vid01xxxxxx",
+ "title": "I Rebuilt a Whole City in One Weekend (No Mods) — I Rebuilt a Whole City in One Weekend (No Mods) (the complete, unabridged, remastered edition)",
+ "subtitle": "Glassfern Games International Broadcasting Collective Archive",
+ "channel_id": "UCfixture000000000000001",
+ "art_url": "art://city/1/23",
+ "views": "1,204,331,882 views",
+ "published": "5 days ago",
+ "duration_sec": 1601,
+ "resume_sec": 480,
+ "overview": "An invented description for the pictures of the interface."
+ },
+ {
+ "id": "vid02xxxxxx",
+ "title": "What Would a Sunset Look Like on Another World? — What Would a Sunset Look Like on Another World? (the complete, unabridged, remastered edition)",
+ "subtitle": "Orbitwell International Broadcasting Collective Archive",
+ "channel_id": "UCfixture000000000000002",
+ "art_url": "art://space/0/35",
+ "views": "1,204,331,882 views",
+ "published": "2 months ago",
+ "duration_sec": 847,
+ "badges": [
+ "4k",
+ "cc"
+ ],
+ "resume_sec": 719,
+ "overview": "An invented description for the pictures of the interface."
+ },
+ {
+ "id": "vid03xxxxxx",
+ "title": "One Pan, Six Dinners: The Lazy Week Plan — One Pan, Six Dinners: The Lazy Week Plan (the complete, unabridged, remastered edition)",
+ "subtitle": "Ostrel Kitchen International Broadcasting Collective Archive",
+ "channel_id": "UCfixture000000000000003",
+ "art_url": "art://plate/0/47",
+ "views": "1,204,331,882 views",
+ "published": "1 day ago",
+ "duration_sec": 1113,
+ "badges": [
+ "new",
+ "cc"
+ ],
+ "resume_sec": 133,
+ "overview": "An invented description for the pictures of the interface."
+ },
+ {
+ "id": "vid20xxxxxx",
+ "title": "Blue Hour on the Northern Coast, No Talking — Blue Hour on the Northern Coast, No Talking (the complete, unabridged, remastered edition)",
+ "subtitle": "Northlight Atlas International Broadcasting Collective Archive",
+ "channel_id": "UCfixture000000000000000",
+ "art_url": "art://ocean/1/241",
+ "views": "1,204,331,882 views",
+ "published": "2 months ago",
+ "duration_sec": 2490,
+ "badges": [
+ "4k"
+ ],
+ "resume_sec": 1245,
+ "overview": "An invented description for the pictures of the interface."
+ }
+ ],
+ "has_more": false
+}
diff --git a/tests/afterglow/fixtures/probe/catalog/continue-watching.json b/tests/afterglow/fixtures/probe/catalog/continue-watching.json
new file mode 100644
index 00000000..606ae8d4
--- /dev/null
+++ b/tests/afterglow/fixtures/probe/catalog/continue-watching.json
@@ -0,0 +1,29 @@
+{
+ "items": [
+ {
+ "id": "probe0xxxxx",
+ "title": "A picture that says which way is up",
+ "subtitle": "Fixture channel",
+ "art_url": "probe://upright",
+ "duration_sec": 600,
+ "resume_sec": 200
+ },
+ {
+ "id": "probe1xxxxx",
+ "title": "A picture that says which way is up",
+ "subtitle": "Fixture channel",
+ "art_url": "probe://upright",
+ "duration_sec": 600,
+ "resume_sec": 200
+ },
+ {
+ "id": "probe2xxxxx",
+ "title": "A picture that says which way is up",
+ "subtitle": "Fixture channel",
+ "art_url": "probe://upright",
+ "duration_sec": 600,
+ "resume_sec": 200
+ }
+ ],
+ "has_more": false
+}
diff --git a/tests/afterglow/fixtures/scripts/catalog/continue-watching.json b/tests/afterglow/fixtures/scripts/catalog/continue-watching.json
new file mode 100644
index 00000000..dd3f7591
--- /dev/null
+++ b/tests/afterglow/fixtures/scripts/catalog/continue-watching.json
@@ -0,0 +1,9 @@
+{
+ "items": [
+ {"id": "scr01xxxxxx", "title": "尾根の上で過ごした七日間 — 静かな山歩きの記録、雨の朝から星の夜まで", "subtitle": "北の光アトラス", "channel_id": "UCfixture000000000000000", "art_url": "art://ridges/0/11", "views": "120万 回視聴", "published": "3 週間前", "duration_sec": 2892, "resume_sec": 1880, "badges": ["4k", "cc"]},
+ {"id": "scr02xxxxxx", "title": "سبعة أيام وحيدًا على خط التلال — فيلم صامت عن المشي في الجبال العالية", "subtitle": "أطلس ضوء الشمال", "channel_id": "UCfixture000000000000001", "art_url": "art://dunes/3/133", "views": "1.2 مليون مشاهدة", "published": "قبل 3 أسابيع", "duration_sec": 2000, "resume_sec": 600},
+ {"id": "scr03xxxxxx", "title": "Donaudampfschifffahrtsgesellschaftskapitänsmützenabzeichen und andere Bandwurmwörter, kurz erklärt", "subtitle": "Sprachwerkstatt Nordlicht", "channel_id": "UCfixture000000000000002", "art_url": "art://code/0/109", "views": "148.000 Aufrufe", "published": "vor 2 Wochen", "duration_sec": 3764, "resume_sec": 1500, "badges": ["cc"]},
+ {"id": "scr04xxxxxx", "title": "Семь дней в одиночку на гребне хребта — немой фильм о долгом походе", "subtitle": "Атлас северного света", "channel_id": "UCfixture000000000000003", "art_url": "art://aurora/0/145", "views": "2,2 млн просмотров", "published": "8 месяцев назад", "duration_sec": 1198, "resume_sec": 300, "badges": ["4k"]}
+ ],
+ "has_more": false
+}
diff --git a/tests/afterglow/fixtures/signed-in/catalog/continue-watching.json b/tests/afterglow/fixtures/signed-in/catalog/continue-watching.json
new file mode 100644
index 00000000..11ca90da
--- /dev/null
+++ b/tests/afterglow/fixtures/signed-in/catalog/continue-watching.json
@@ -0,0 +1,95 @@
+{
+ "items": [
+ {
+ "id": "vid00xxxxxx",
+ "title": "Seven Days Alone on the Ridge Line — A Silent Hiking Film",
+ "subtitle": "Northlight Atlas",
+ "channel_id": "UCfixture000000000000000",
+ "art_url": "art://ridges/0/11",
+ "views": "1.2M views",
+ "published": "3 weeks ago",
+ "duration_sec": 2892,
+ "badges": [
+ "4k",
+ "cc"
+ ],
+ "resume_sec": 1879,
+ "overview": "An invented description for the pictures of the interface."
+ },
+ {
+ "id": "vid09xxxxxx",
+ "title": "Writing a Tiny Renderer in an Afternoon",
+ "subtitle": "Mossbyte",
+ "channel_id": "UCfixture000000000000009",
+ "art_url": "art://code/0/109",
+ "views": "148K views",
+ "published": "2 weeks ago",
+ "duration_sec": 3764,
+ "badges": [
+ "cc"
+ ],
+ "resume_sec": 1693,
+ "overview": "An invented description for the pictures of the interface."
+ },
+ {
+ "id": "vid01xxxxxx",
+ "title": "I Rebuilt a Whole City in One Weekend (No Mods)",
+ "subtitle": "Glassfern Games",
+ "channel_id": "UCfixture000000000000001",
+ "art_url": "art://city/1/23",
+ "views": "842K views",
+ "published": "5 days ago",
+ "duration_sec": 1601,
+ "resume_sec": 480,
+ "overview": "An invented description for the pictures of the interface."
+ },
+ {
+ "id": "vid02xxxxxx",
+ "title": "What Would a Sunset Look Like on Another World?",
+ "subtitle": "Orbitwell",
+ "channel_id": "UCfixture000000000000002",
+ "art_url": "art://space/0/35",
+ "views": "3.4M views",
+ "published": "2 months ago",
+ "duration_sec": 847,
+ "badges": [
+ "4k",
+ "cc"
+ ],
+ "resume_sec": 719,
+ "overview": "An invented description for the pictures of the interface."
+ },
+ {
+ "id": "vid03xxxxxx",
+ "title": "One Pan, Six Dinners: The Lazy Week Plan",
+ "subtitle": "Ostrel Kitchen",
+ "channel_id": "UCfixture000000000000003",
+ "art_url": "art://plate/0/47",
+ "views": "410K views",
+ "published": "1 day ago",
+ "duration_sec": 1113,
+ "badges": [
+ "new",
+ "cc"
+ ],
+ "resume_sec": 133,
+ "overview": "An invented description for the pictures of the interface."
+ },
+ {
+ "id": "vid20xxxxxx",
+ "title": "Blue Hour on the Northern Coast, No Talking",
+ "subtitle": "Northlight Atlas",
+ "channel_id": "UCfixture000000000000000",
+ "art_url": "art://ocean/1/241",
+ "views": "640K views",
+ "published": "2 months ago",
+ "duration_sec": 2490,
+ "badges": [
+ "4k"
+ ],
+ "resume_sec": 1245,
+ "overview": "An invented description for the pictures of the interface."
+ }
+ ],
+ "has_more": false
+}
diff --git a/tests/afterglow/host_main.cpp b/tests/afterglow/host_main.cpp
index 6d248894..f2eb20df 100644
--- a/tests/afterglow/host_main.cpp
+++ b/tests/afterglow/host_main.cpp
@@ -938,6 +938,7 @@ int main(int argc, char **argv)
profile.signed_in = cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(who, "signed_in"));
source.set_profile(profile);
}
+ if (engine) engine->set_text_scale(static_cast(number_of(board,"text_scale",1.0)));
FrameOptions frame_options;
frame_options.scheme = scheme;
frame_options.opening = cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(board, "opening"));
diff --git a/tests/test_backup_ui.c b/tests/test_backup_ui.c
index 8ed110d6..ff9547e2 100644
--- a/tests/test_backup_ui.c
+++ b/tests/test_backup_ui.c
@@ -54,7 +54,7 @@ int main(void) {
snprintf(entry,sizeof entry,"settings:backup:entry:%s",name);assert(!strcmp(last_items[0].id,entry));
/* The state moves on; the entry screen reviews the restore and issues a ticket for one action. */
assert(tube_set_playback_speed(200));assert(tube_toggle_favorite("abcdefghijk")==1);
- show(entry);assert(last_count==2 && find("Restore this backup")==0 && strstr(last_items[0].overview,"pairing") && strstr(last_items[0].overview," UTC"));
+ show(entry);assert(last_count==3 && find("Restore this backup")==0 && strstr(last_items[0].overview,"pairing") && strstr(last_items[0].overview," UTC"));
snprintf(stale,sizeof stale,"%s",row);assert(find("Delete this backup")==1);
show(entry);assert(find("Restore this backup")==0 && strcmp(row,stale));snprintf(restore,sizeof restore,"%s",row);
refused(stale);assert(tube_playback_speed()==200); /* an earlier ticket restores nothing */
diff --git a/tests/test_maxd_catchup.c b/tests/test_maxd_catchup.c
new file mode 100644
index 00000000..63c3710e
--- /dev/null
+++ b/tests/test_maxd_catchup.c
@@ -0,0 +1,37 @@
+/* Exercise real async subscription scanning and append-to-queue ownership. */
+#define main existing_provider_regression
+#include "test_native.c"
+#undef main
+static const evo_provider_t *p;
+static void choose(const char *id) {assert(!p->list_catalog(id,0,items_cb,NULL) && last_ok);}
+static void drain(void) {while(pending_count)reply(0,0,500,"{}");}
+static void health(void) {while(pending_count && strstr(pending[0].url,"/v1/health"))reply(0,1,200,"{\"api_version\":1,\"features\":[\"search\",\"library\"]}");}
+static const char *feed="{\"state\":\"done\",\"result\":{\"items\":["
+ "{\"id\":\"abcdefghij1\",\"channel_id\":\"UCabcdefghijklmnopqrstuv\",\"title\":\"First upload\",\"duration_sec\":900},"
+ "{\"id\":\"abcdefghij2\",\"channel_id\":\"UCabcdefghijklmnopqrstuv\",\"title\":\"Second upload\",\"duration_sec\":600},"
+ "{\"id\":\"abcdefghij3\",\"channel_id\":\"UCabcdefghijklmnopqrstuv\",\"title\":\"Short upload\",\"duration_sec\":30,\"is_short\":true},"
+ "{\"id\":\"abcdefghij4\",\"channel_id\":\"UCzyxwvutsrqponmlkjihgfe\",\"title\":\"Other channel\",\"duration_sec\":900},"
+ "{\"id\":\"abcdefghij5\",\"channel_id\":\"UCabcdefghijklmnopqrstuv\",\"title\":\"Already watched\",\"duration_sec\":600,\"watch_percent\":100}]}}";
+static void enqueue(void) {
+ health();assert(!p->list_catalog("settings:smart:1:enqueue",0,items_cb,NULL));
+ assert(pending_count && strstr(pending[0].body,"subscriptions"));poll_job(feed);health();assert(last_ok);
+}
+int main(void) {
+ char dir[]="/tmp/maxd-catchup-XXXXXX";assert(mkdtemp(dir) && !setenv("EVO_DATA_DIR_OVERRIDE",dir,1));
+ p=&evo_provider_youtube;assert(!p->init());
+ assert(!p->set_source("http://127.0.0.1:8765#123456"));
+ p->search("seed",0,items_cb,NULL);reply(0,1,200,"{\"token\":\"abcdefghijklmnopqrstuvwxabcdefghijkl\"}");
+ poll_job("{\"state\":\"done\",\"result\":{\"items\":[]}}");health();
+ choose("settings:catchup:new:guest");choose("settings:smart:1:channel:UCabcdefghijklmnopqrstuv");
+ enqueue();assert(last_count==2 && strstr(last_items[0].title,"Added 2"));
+ choose("queue");assert(last_count==2 && !strcmp(last_items[0].id,"abcdefghij1") && !strcmp(last_items[1].id,"abcdefghij2"));
+ enqueue();assert(strstr(last_items[0].title,"Added 0"));choose("queue");assert(last_count==2);
+ choose("settings:smart:1:shorts");for(int i=0;i<5;++i)choose("settings:smart:1:budget"); /* no limit */
+ enqueue();assert(strstr(last_items[0].title,"Added 1"));choose("queue");assert(last_count==3 && !strcmp(last_items[2].id,"abcdefghij3"));
+ /* A profile switch while the scan is pending cannot enqueue into either account. */
+ assert(!p->list_catalog("settings:smart:1:enqueue",0,items_cb,NULL));assert(pending_count);
+ choose("library:profile:alice");drain();choose("queue");assert(!last_count);
+ choose("library:profile:guest");choose("queue");assert(last_count==3);
+ p->shutdown();drain();unlink(evo_data_path("youtube.json"));assert(!rmdir(dir));
+ puts("PASS: actual subscription catch-up scanning, channel/Shorts/watched filters, budget, duplicate-free queue append and cancelled ownership");
+}
diff --git a/tests/test_maxd_features.c b/tests/test_maxd_features.c
index 4b4862b1..e61725a9 100644
--- a/tests/test_maxd_features.c
+++ b/tests/test_maxd_features.c
@@ -1,6 +1,9 @@
/* Rule persistence and measured adaptation policies. GPL-3.0-or-later. */
#include "maxd/smart_rules.h"
#include "maxd/auto_max.h"
+#include "maxd/viewing_store.h"
+#include "maxd/reliability_store.h"
+#include "maxd/quick_switch.h"
#include
#include
int main(void) {
@@ -47,5 +50,31 @@ int main(void) {
assert(maxd_auto_pick(f,5,3,MAXD_AUTO_UP,1080,0,0,0,0)==-1);
assert(maxd_auto_pick(f,5,3,MAXD_AUTO_UP,2160,30,1,0,0)==-1);
assert(maxd_auto_pick(f,5,1,MAXD_AUTO_DROP,2160,0,0,maxd_auto_cost(f[1]),0)==2);
- puts("PASS: smart rule bounds, filtering, profiles, JSON; Auto Max warmup, windows, cooldown, pause/reset, recovery, codec/FPS/quality ceilings");
+ MaxdPresetStore presets={0},restored;
+ MaxdPlaybackPreset *preset=maxd_preset_find(&presets,"guest",0,1);assert(preset);
+ preset->height=1080;preset->fps=60;preset->speed=100;preset->captions=1;strcpy(preset->language,"en");
+ root=cJSON_CreateObject();maxd_presets_write(&presets,root);maxd_presets_read(&restored,root);cJSON_Delete(root);
+ assert(restored.count==1 && !maxd_preset_find(&restored,"alice",0,0));
+ assert(!memcmp(&presets.rows[0],&restored.rows[0],sizeof *preset));
+ root=cJSON_Parse("{\"maxd_playback_presets\":[{\"profile\":\"guest\",\"slot\":0,\"height\":9999,\"fps\":60,\"speed\":100,\"codec\":0,\"language\":\"en\"}]}");
+ maxd_presets_read(&restored,root);cJSON_Delete(root);assert(!restored.count);
+ maxd_presets_forget(&presets,"guest");assert(!presets.count);
+ MaxdQuickSwitch quick={0};
+ assert(maxd_quick_switch(&quick,1,1,0,0,100)==MAXD_QUICK_WAIT);
+ assert(maxd_quick_switch(&quick,0,0,1,0,200)==MAXD_QUICK_TAP);
+ assert(maxd_quick_switch(&quick,1,1,0,0,1000)==MAXD_QUICK_WAIT);
+ assert(maxd_quick_switch(&quick,0,1,0,0,1650)==MAXD_QUICK_OPEN);
+ assert(maxd_quick_switch(&quick,0,1,0,0,2000)==MAXD_QUICK_WAIT);
+ assert(maxd_quick_switch(&quick,0,0,1,0,2100)==MAXD_QUICK_NONE);
+ assert(maxd_quick_switch(&quick,1,1,0,0,2200)==MAXD_QUICK_WAIT);
+ assert(maxd_quick_switch(&quick,0,1,0,1,2300)==MAXD_QUICK_NONE);
+ MaxdReliabilityStore reliability={0},loaded_reliability;
+ MaxdChannelPref *channel=maxd_channel_pref(&reliability,"guest","UCabcdefghijklmnopqrstuv",1);assert(channel);channel->height=720;channel->leveling=1;
+ MaxdCheckpoint *checkpoint=maxd_checkpoint(&reliability,"guest",1);assert(checkpoint);strcpy(checkpoint->video,"abcdefghijk");checkpoint->position=42;checkpoint->duration=900;checkpoint->active=1;
+ root=cJSON_CreateObject();maxd_reliability_write(&reliability,root);maxd_reliability_read(&loaded_reliability,root);cJSON_Delete(root);
+ assert(loaded_reliability.count==1 && loaded_reliability.sessions_count==1 && loaded_reliability.sessions[0].pending);
+ assert(!maxd_channel_pref(&loaded_reliability,"alice","UCabcdefghijklmnopqrstuv",0));
+ assert(!maxd_channel_pref(&loaded_reliability,"guest","UCbad/pathabcdefghijklmn",1));
+ maxd_reliability_forget(&loaded_reliability,"guest");assert(!loaded_reliability.count && !loaded_reliability.sessions_count);
+ puts("PASS: smart rule bounds, filtering, profiles, JSON; Auto Max warmup, windows, cooldown, pause/reset, recovery, codec/FPS/quality ceilings; saved preset validation and ownership");
}
diff --git a/tests/test_maxd_phone_page.mjs b/tests/test_maxd_phone_page.mjs
index e0c591e7..5581c4d9 100644
--- a/tests/test_maxd_phone_page.mjs
+++ b/tests/test_maxd_phone_page.mjs
@@ -36,7 +36,7 @@ function page({invite='',token='test-session',handler}={}){
let state={active:true,paused:false,busy:false,live:false,position:30,duration:4000,selection:1,sequence:0,queue:[]};
const store=new Map(token?[['maxd-remote',token]]:[]);
const h={ids,timers,calls,document,get removed(){return removed;},state,handler:handler||((path)=>response(path==='/pair'?{token:'test-paired'}:path==='/command'?{ok:true}:path==='/report'?{version:'test'}:state))};
- const context=vm.createContext({URL,AbortController,document,location:{hash:invite,pathname:'/'},history:{replaceState(){removed=true;}},sessionStorage:{getItem:k=>store.get(k),setItem:(k,v)=>store.set(k,v),removeItem:k=>store.delete(k)},
+ const context=vm.createContext({URL,TextEncoder,AbortController,document,location:{hash:invite,pathname:'/'},history:{replaceState(){removed=true;}},sessionStorage:{getItem:k=>store.get(k),setItem:(k,v)=>store.set(k,v),removeItem:k=>store.delete(k)},
setTimeout(fn,delay){timers.set(++serial,{fn,delay});return serial;},clearTimeout(id){timers.delete(id);},setInterval(){},
fetch(path,options){calls.push({path,body:JSON.parse(options.body),options});const pending=Promise.resolve(h.handler(path,options));
return new Promise((resolve,reject)=>{const abort=()=>{const e=Error('aborted');e.name='AbortError';reject(e);};options.signal.addEventListener('abort',abort,{once:true});pending.then(resolve,reject).finally(()=>options.signal.removeEventListener('abort',abort));});}
@@ -103,3 +103,16 @@ test('successful search clears sent text without erasing a new draft',async()=>{
const gate=deferred();h.ids.get('query').value='sent';let count=0;h.handler=path=>path==='/command'?response({ok:true}):++count===1?gate.promise:response(h.state);
const control=h.eval("command('search','sent')");h.ids.get('query').value='new draft';gate.resolve(response(h.state));await control;assert.equal(h.ids.get('query').value,'new draft');
});
+
+test('phone keyboard rejects blank and oversized Unicode searches without sending commands',async()=>{
+ const h=page();await flush();
+ const query=h.ids.get('query'),form=h.ids.get('search');
+ query.value=' ';form.onsubmit({preventDefault(){}});await flush();
+ assert.equal(h.calls.filter(c=>c.path==='/command').length,0);
+ assert.match(h.ids.get('status').textContent,/Type a search/);assert.equal(h.document.activeElement,query);
+ query.value='😀'.repeat(201);form.onsubmit({preventDefault(){}});await flush();
+ assert.equal(h.calls.filter(c=>c.path==='/command').length,0);assert.match(h.ids.get('status').textContent,/800 UTF-8 bytes/);
+ query.value='テレビ';form.onsubmit({preventDefault(){}});await flush();
+ assert.equal(h.calls.filter(c=>c.path==='/command').length,1);assert.equal(query.value,'');
+ assert.equal(h.calls.find(c=>c.path==='/command').body.text,'テレビ');
+});
diff --git a/tests/test_maxd_reliability.c b/tests/test_maxd_reliability.c
new file mode 100644
index 00000000..357e1f0c
--- /dev/null
+++ b/tests/test_maxd_reliability.c
@@ -0,0 +1,82 @@
+/* Real provider paths for channel overrides, interrupted queues and maintenance. */
+#define main existing_provider_regression
+#include "test_native.c"
+#undef main
+#include "tube_backup.h"
+static const evo_provider_t *p;
+static unsigned long long thumbnail_bytes=2ull*1024*1024;static int thumbnails=2;
+int tube_maxd_thumbnail_cache(unsigned long long *bytes,int *count,int clear) {if(clear){thumbnail_bytes=0;thumbnails=0;}if(bytes)*bytes=thumbnail_bytes;if(count)*count=thumbnails;return 1;}
+static void choose(const char *id) {int rc=p->list_catalog(id,0,items_cb,NULL);if(rc||!last_ok)fprintf(stderr,"Refused action: %s\n",id);assert(!rc && last_ok);}
+static void export_page(const char *file) {
+ const char *dir=getenv("MAXD_RELIABILITY_FIXTURE_DIR");if(!dir)return;
+ cJSON *root=cJSON_CreateObject(),*rows=cJSON_AddArrayToObject(root,"items");cJSON_AddBoolToObject(root,"has_more",last_more);
+ for(int i=0;iid);cJSON_AddStringToObject(row,"title",item->title);cJSON_AddStringToObject(row,"subtitle",item->subtitle);
+ cJSON_AddStringToObject(row,"overview",item->overview);cJSON_AddBoolToObject(row,"is_folder",item->is_folder);
+ cJSON_AddBoolToObject(row,"interface",1);cJSON_AddNumberToObject(row,"duration_sec",item->duration_sec);cJSON_AddNumberToObject(row,"resume_sec",item->resume_pos_sec);
+ const char *facts[]={"kind","label","value","screen","argument"};
+ for(int j=0;j<5;++j){const char *value=tube_row_fact_get(item->id,facts[j]);if(*value)cJSON_AddStringToObject(row,facts[j],value);}
+ cJSON_AddItemToArray(rows,row);
+ }
+ char path[1024];snprintf(path,sizeof path,"%s/%s.json",dir,file);FILE *f=fopen(path,"w");assert(f);
+ char *json=cJSON_Print(root);assert(json);assert(fputs(json,f)>=0 && !fclose(f));free(json);cJSON_Delete(root);
+}
+static void drain(void) {while(pending_count)reply(0,0,500,"{}");}
+static void health(void) {while(pending_count && strstr(pending[0].url,"/v1/health"))reply(0,1,200,"{\"api_version\":1,\"features\":[\"search\",\"library\"]}");}
+static evo_stream_choice_t choice;
+static void resolved(int ok,const evo_stream_choice_t *choices,int count,void *ud){(void)ud;assert(ok&&count==1);choice=choices[0];}
+static void resolve_a(int ceiling) {
+ assert(!p->resolve("abcdefghijk",resolved,NULL));char expected[64];snprintf(expected,sizeof expected,"\"max_height\":%d",ceiling);assert(pending_count && strstr(pending[0].body,expected));
+ poll_job("{\"state\":\"done\",\"result\":{\"id\":\"abcdefghijk\",\"title\":\"Fixture\",\"duration_sec\":900,\"loudness_db\":6,\"choices\":[{\"url\":\"http://127.0.0.1:8765/media/capability/p0\",\"label\":\"720p\",\"container\":\"mp4\",\"height\":720,\"fps\":30,\"video_codec\":\"h264\"}]}}");health();
+}
+int main(void) {
+ char dir[]="/tmp/maxd-reliability-XXXXXX";assert(mkdtemp(dir) && !setenv("EVO_DATA_DIR_OVERRIDE",dir,1));p=&evo_provider_youtube;assert(!p->init());
+ assert(!p->set_source("http://127.0.0.1:8765#123456"));p->search("seed",0,items_cb,NULL);reply(0,1,200,"{\"token\":\"abcdefghijklmnopqrstuvwxabcdefghijkl\"}");
+ poll_job("{\"state\":\"done\",\"result\":{\"items\":[{\"id\":\"abcdefghijk\",\"title\":\"First\",\"subtitle\":\"Channel One\",\"channel_id\":\"UCabcdefghijklmnopqrstuv\",\"duration_sec\":900},{\"id\":\"bcdefghijkl\",\"title\":\"Next\",\"subtitle\":\"Channel One\",\"channel_id\":\"UCabcdefghijklmnopqrstuv\",\"duration_sec\":900}]}}");health();
+ choose("settings");assert(last_count>0);
+ choose("settings:reliability");assert(last_count==6);export_page("settings_reliability");
+ choose("settings:channel-prefs");assert(last_count==1 && !strcmp(last_items[0].title,"Channel One"));
+ const char *quality="settings:channel-prefs:guest:UCabcdefghijklmnopqrstuv:quality";
+ choose(quality);choose(quality); /* channel ceiling 720 */
+ choose("settings:channel-prefs:guest:UCabcdefghijklmnopqrstuv:speed");
+ choose("settings:channel-prefs:guest:UCabcdefghijklmnopqrstuv:captions");
+ choose("settings:channel-prefs:guest:UCabcdefghijklmnopqrstuv:leveling");choose("settings:channel-prefs:guest:UCabcdefghijklmnopqrstuv:leveling");
+ choose("settings:channel-prefs:guest:UCabcdefghijklmnopqrstuv");export_page("settings_channel-prefs_guest_UCabcdefghijklmnopqrstuv");
+ assert(tube_playback_speed_for("bcdefghijkl")==50 && !tube_captions_for("bcdefghijkl"));
+ resolve_a(720);p->stream_chosen("abcdefghijk",&choice);p->report_progress("abcdefghijk",0,900,EVO_PROVIDER_PLAY_START);
+ assert(!tube_extra_auto_volume() && tube_extra_gain_milli()>0 && tube_extra_gain_milli()<1000);
+ (void)tube_error_fix_begin(TUBE_ERROR_VIDEO_DECODER,42,0,0);
+ choose("settings:playback-diagnostics");export_page("settings_playback-diagnostics");
+ assert(strstr(tube_maxd_playback_diagnosis(),"video decoder") && !strstr(tube_maxd_playback_diagnosis(),"://"));
+ /* Clean stop clears the offer; checkpoints survive only missing stop reports. */
+ p->report_progress("abcdefghijk",50,900,EVO_PROVIDER_PLAY_STOP);p->shutdown();drain();assert(!p->init());
+ choose("settings:session-recovery");assert(last_count==1 && strstr(last_items[0].title,"No interrupted"));
+ choose("settings:max-quality:480");resolve_a(480);p->stream_chosen("abcdefghijk",&choice);
+ p->report_progress("abcdefghijk",0,900,EVO_PROVIDER_PLAY_START);p->report_progress("abcdefghijk",123,900,EVO_PROVIDER_PLAY_UPDATE);
+ assert(tube_toggle_queue("bcdefghijkl")); /* also commits the latest checkpoint */
+ p->shutdown();drain();assert(!p->init());health();
+ choose("settings:session-recovery");assert(last_count==3 && strstr(last_items[0].subtitle,"2:03"));assert(!strcmp(tube_row_fact_get(last_items[0].id,"screen"),"grid"));export_page("settings_session-recovery");
+ choose("queue");assert(last_count==1 && !strcmp(last_items[0].id,"bcdefghijkl"));
+ choose("library:profile:alice");p->list_catalog("settings:session-recovery:guest:resume",0,items_cb,NULL);assert(!last_ok);
+ p->list_catalog(quality,0,items_cb,NULL);assert(!last_ok);assert(strstr(tube_maxd_playback_diagnosis(),"No playback failure"));
+ choose("library:profile:guest");choose("settings:session-recovery:guest:resume");assert(last_count==1 && !last_items[0].is_folder && last_items[0].resume_pos_sec==123);
+ p->shutdown();drain();assert(!p->init());choose("settings:session-recovery:guest:dismiss");
+ choose("queue");assert(last_count==1);
+ choose("settings:quick-switch");export_page("settings_quick-switch");assert(last_count==4 && !strcmp(tube_row_fact_get("search-history","screen"),"search"));
+ choose("settings:storage");export_page("settings_storage");
+ choose("settings:storage:guest:thumbnails");assert(!thumbnail_bytes && !thumbnails);
+ char path[512];snprintf(path,sizeof path,"%s/active.srt",dir);FILE *file=fopen(path,"w");assert(file && fputs("temporary captions",file)>=0 && !fclose(file));
+ drain();choose("settings:storage:guest:captions");assert(access(path,F_OK));
+ assert(!access(evo_data_path("youtube.json"),F_OK));
+ choose("settings:backup:create");tube_backup_entry entries[4];int count=tube_backup_list(dir,entries,4);assert(count>0);
+ tube_backup_summary summary;assert(!tube_backup_inspect(dir,entries[0].name,&summary));assert(summary.queued==1 && summary.channels==1 && summary.records>=2);
+ snprintf(path,sizeof path,"settings:backup:entry:%s",entries[0].name);choose(path);assert(last_count==3 && strstr(last_items[2].subtitle,"channels: 1"));assert(strstr(last_items[0].overview,"Stored data preview"));export_page("settings_backup_entry_reliability");
+ /* History-disabled playback must not create an interruption record. */
+ choose("settings:history:2");p->stream_chosen("bcdefghijkl",&choice);p->report_progress("bcdefghijkl",20,900,EVO_PROVIDER_PLAY_START);
+ p->shutdown();drain();assert(!p->init());choose("settings:session-recovery");assert(last_count==1 && strstr(last_items[0].title,"No interrupted"));
+ p->shutdown();drain();
+ for(int i=0;ilist_catalog(id,0,items_cb,NULL);if(rc||!last_ok)fprintf(stderr,"Failed viewing action: %s\n",id);assert(!rc && last_ok);}
+static void export_page(const char *file) {
+ const char *dir=getenv("MAXD_VIEWING_FIXTURE_DIR");if(!dir)return;
+ cJSON *root=cJSON_CreateObject(),*rows=cJSON_AddArrayToObject(root,"items");cJSON_AddBoolToObject(root,"has_more",last_more);
+ for(int i=0;iid);cJSON_AddStringToObject(row,"title",item->title);cJSON_AddStringToObject(row,"subtitle",item->subtitle);
+ cJSON_AddStringToObject(row,"overview",item->overview);cJSON_AddBoolToObject(row,"is_folder",item->is_folder);
+ cJSON_AddBoolToObject(row,"interface",1);cJSON_AddNumberToObject(row,"duration_sec",item->duration_sec);cJSON_AddNumberToObject(row,"resume_sec",item->resume_pos_sec);
+ const char *facts[]={"kind","label","value","screen","argument"};
+ for(int j=0;j<5;++j){const char *value=tube_row_fact_get(item->id,facts[j]);if(*value)cJSON_AddStringToObject(row,facts[j],value);}
+ cJSON_AddItemToArray(rows,row);
+ }
+ char path[1024];snprintf(path,sizeof path,"%s/%s.json",dir,file);FILE *f=fopen(path,"w");assert(f);
+ char *json=cJSON_Print(root);assert(json);assert(fputs(json,f)>=0 && !fclose(f));free(json);cJSON_Delete(root);
+}
+static void drain(void) {while(pending_count)reply(0,0,500,"{}");}
+int main(void) {
+ char dir[]="/tmp/maxd-viewing-XXXXXX";assert(mkdtemp(dir));assert(!setenv("EVO_DATA_DIR_OVERRIDE",dir,1));
+ p=&evo_provider_youtube;assert(!p->init());
+ choose("settings:presets");assert(last_count==3);export_page("settings_presets");
+ choose("settings:presets:guest:0");export_page("settings_presets_guest_0");
+ choose("settings:max-quality:720");choose("settings:presets:guest:0:save");
+ choose("settings:max-quality:2160");choose("settings:presets:guest:0:apply");
+ choose("settings:max-quality");assert(strstr(last_items[4].subtitle,"Selected"));
+ choose("settings:accessibility:guest:scale");assert(tube_ui_prefs()->ui_scale==115);
+ choose("settings:accessibility:guest:motion");assert(tube_ui_prefs()->reduced_motion);
+ choose("settings:accessibility:guest:contrast");assert(tube_ui_prefs()->scheme==3);export_page("settings_accessibility");
+ choose("settings:accessibility:guest:caption-background");assert(tube_extra_subtitle_style_index()==1);
+ choose("settings:accessibility:guest:caption-background");assert(tube_extra_subtitle_style_index()==2);
+ choose("settings:accessibility:guest:caption-background");assert(tube_extra_subtitle_style_index()==3);
+ char css[12000];assert(tube_ui_rules(tube_ui_prefs(),css,sizeof css)>0 && strstr(css,"transition: none"));
+ choose("library:profile:alice");
+ p->list_catalog("settings:presets:guest:0:apply",0,items_cb,NULL);assert(!last_ok);
+ p->list_catalog("settings:accessibility:guest:scale",0,items_cb,NULL);assert(!last_ok);
+ choose("settings:presets:alice:0:apply");choose("settings:max-quality");assert(strstr(last_items[7].subtitle,"Selected"));
+ choose("library:profile:guest");choose("settings:presets:guest:0:apply");
+ p->shutdown();assert(!p->init());choose("settings:presets:guest:0:apply");
+ assert(tube_ui_prefs()->reduced_motion && tube_ui_prefs()->ui_scale==115);
+ /* Real playback progress, including profile isolation and completed removal. */
+ p->stream_chosen("abcdefghijk",NULL);p->report_progress("abcdefghijk",0,900,EVO_PROVIDER_PLAY_START);
+ p->report_progress("abcdefghijk",123,900,EVO_PROVIDER_PLAY_STOP);
+ choose("continue-watching");assert(last_count==1 && last_items[0].resume_pos_sec==123 && strstr(last_items[0].subtitle,"2:03"));
+ choose("library:profile:alice");choose("continue-watching");assert(!last_count);
+ choose("library:profile:guest");p->stream_chosen("abcdefghijk",NULL);p->report_progress("abcdefghijk",900,900,EVO_PROVIDER_PLAY_STOP);
+ choose("continue-watching");assert(!last_count);
+ /* Catch-up rule metadata is independent of general shared preferences. */
+ choose("settings:catchup:new:guest");choose("settings:smart:1");
+ export_page("settings_smart_1_catchup");
+ choose("settings:catchup");export_page("settings_catchup");
+ choose("settings:rest");export_page("settings_rest");
+ choose("settings:smart:1:channel:UCabcdefghijklmnopqrstuv");
+ choose("settings:smart:1:shorts");
+ cJSON *store=read_store(),*rule=cJSON_GetArrayItem(cJSON_GetObjectItem(store,"maxd_smart_playlists"),0);
+ assert(cJSON_IsTrue(cJSON_GetObjectItem(rule,"catchup")) && cJSON_GetObjectItem(rule,"source")->valueint==1);
+ assert(cJSON_GetArraySize(cJSON_GetObjectItem(rule,"channels"))==1 && cJSON_IsFalse(cJSON_GetObjectItem(rule,"hide_shorts")));cJSON_Delete(store);
+ choose("library:profile:alice");p->list_catalog("settings:smart:1:shorts",0,items_cb,NULL);assert(!last_ok);
+ p->list_catalog("settings:catchup:new:guest",0,items_cb,NULL);assert(!last_ok);
+ p->shutdown();drain();unlink(evo_data_path("youtube.json"));assert(!rmdir(dir));
+ puts("PASS: Continue Watching progress/completion/profile isolation, saved playback presets and stale actions, accessibility persistence/captions, catch-up channel persistence");
+}
diff --git a/tests/test_sleep_timer.c b/tests/test_sleep_timer.c
index d5513047..498e03c3 100644
--- a/tests/test_sleep_timer.c
+++ b/tests/test_sleep_timer.c
@@ -28,7 +28,21 @@ int main(void) {
timer_clock-=500;assert(!tube_sleep_tick(1)); /* Clock regression restarts safely. */
assert(tube_sleep_set_minutes(0));timer_clock+=999999999;assert(!tube_sleep_tick(1));
p->list_catalog("settings:sleep:bad",0,items_cb,NULL);assert(!last_ok);
+ assert(tube_sleep_schedule(15,0));timer_clock+=14*60000;
+ tube_sleep_activity();assert(tube_sleep_scheduled_minutes()==1 && !tube_sleep_tick(1));
+ timer_clock+=60000;assert(tube_sleep_tick(1) && !tube_sleep_tick(1));
+ p->stream_chosen("abcdefghijk",NULL);
+ assert(tube_sleep_schedule(0,1) && tube_sleep_after_video());
+ p->stream_chosen("abcdefghijk",NULL);assert(tube_sleep_after_video()); /* same-video reopen */
+ assert(tube_set_playback_mode(TUBE_MODE_ONE));
+ assert(!tube_finish_drained_and_next(100) && tube_take_completion_action()==TUBE_COMPLETION_PAUSE);
+ assert(!tube_sleep_after_video() && !tube_take_completion_action());
+ p->stream_chosen("abcdefghijk",NULL);assert(tube_sleep_schedule(0,1));
+ p->stream_chosen("bcdefghijkl",NULL);assert(!tube_sleep_after_video());
+ assert(tube_sleep_schedule(30,0));
+ p->list_catalog("library:profile:alice",0,items_cb,NULL);assert(last_ok && !tube_sleep_tick(1) && !tube_sleep_scheduled_minutes());
+ assert(!tube_sleep_schedule(7,0) && !tube_sleep_schedule(15,1));
p->shutdown();unlink(evo_data_path("youtube.json"));assert(!rmdir(dir));
- puts("PASS: inactivity timer choices, persistence, reset, disabled/idle, exact expiry, one-shot and clock regression");
+ puts("PASS: inactivity and elapsed-time timers, exact expiry, input independence, end-video pause over repeat, same-video reopen, cancellation/profile isolation and persistence");
return 0;
}