feat(slint): first-class local playlists with offline-only mode (D7/D8)
New local_playlists + local_playlist_tracks schema in the shared per-user library.db (ids 'local:<uuid>', sources qobuz/local/plex, position-compacted, 8 repo tests in qbz-library). PlaylistRef routing at the navigation seam makes local ids unrepresentable in Qobuz playlist calls by construction (all take u64). Local playlists appear in sidebar, manager and picker (picker hides the Qobuz set while offline); detail view reuses the existing playlist row machinery and renders offline; creation modal gains the offline-only toggle (forced on while offline - creating offline always produces a local playlist, D8) and Edit can flip it later; explicit Upload-to-Qobuz conversion for non-offline-only locals (confirm dialog, local rows attach via the existing sidecar, entity kept on failure). Never-to-Qobuz guard: queues built from an offline-only playlist carry a core-level stamp cleared by every queue replacement; the QConnect sync skips the cloud push and play-on-peer falls back to local playback while the stamp is set. Deferred (logged in the slice report): plex-row attach on upload, custom reorder for local playlists, folder/favorite/hide on local items, manager sort interleaving, offline cover thumbs for cached qobuz rows. cc
This commit is contained in:
21 files changed
+2474
-74
No files matched your search
@@ -123,13 +123,16 @@ export component CreatePlaylistModal inherits Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
// Public checkbox row.
|
||||
// Public checkbox row — meaningless for a local playlist,
|
||||
// so it dims + locks while offline-only is ON.
|
||||
HorizontalLayout {
|
||||
spacing: 10px;
|
||||
opacity: CreatePlaylistState.offline-only ? 0.4 : 1.0;
|
||||
toggle := TouchArea {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
mouse-cursor: pointer;
|
||||
mouse-cursor: CreatePlaylistState.offline-only ? default : pointer;
|
||||
enabled: !CreatePlaylistState.offline-only;
|
||||
clicked => {
|
||||
CreatePlaylistState.is-public = !CreatePlaylistState.is-public;
|
||||
}
|
||||
@@ -161,6 +164,56 @@ export component CreatePlaylistModal inherits Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
// Offline-only checkbox row (D8) — creates a LOCAL playlist
|
||||
// (library.db) that never reaches Qobuz. While the app is
|
||||
// offline the toggle is forced ON and locked, with a hint.
|
||||
VerticalLayout {
|
||||
spacing: 6px;
|
||||
HorizontalLayout {
|
||||
spacing: 10px;
|
||||
opacity: CreatePlaylistState.offline-locked ? 0.7 : 1.0;
|
||||
offline-toggle := TouchArea {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
mouse-cursor: CreatePlaylistState.offline-locked ? default : pointer;
|
||||
enabled: !CreatePlaylistState.offline-locked;
|
||||
clicked => {
|
||||
CreatePlaylistState.offline-only = !CreatePlaylistState.offline-only;
|
||||
}
|
||||
Rectangle {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
y: Math.round((parent.height - self.height) / 2 / 1px) * 1px;
|
||||
border-radius: 4px;
|
||||
background: CreatePlaylistState.offline-only ? Theme.accent : transparent;
|
||||
border-width: CreatePlaylistState.offline-only ? 0px : 1.5px;
|
||||
border-color: Theme.text-muted;
|
||||
QbzIcon {
|
||||
source: @image-url("../assets/icons/check.svg");
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
x: Math.round((parent.width - self.width) / 2 / 1px) * 1px;
|
||||
y: Math.round((parent.height - self.height) / 2 / 1px) * 1px;
|
||||
tint: #ffffff;
|
||||
visible: CreatePlaylistState.offline-only;
|
||||
}
|
||||
}
|
||||
}
|
||||
Text {
|
||||
text: @tr("Offline-only playlist");
|
||||
color: Theme.text-secondary;
|
||||
font-size: Typography.body;
|
||||
vertical-alignment: center;
|
||||
horizontal-stretch: 1;
|
||||
}
|
||||
}
|
||||
if CreatePlaylistState.offline-locked: Text {
|
||||
text: @tr("Created locally — you're offline");
|
||||
color: Theme.text-muted;
|
||||
font-size: Typography.legal;
|
||||
}
|
||||
}
|
||||
|
||||
// Cancel + Create.
|
||||
HorizontalLayout {
|
||||
alignment: end;
|
||||
|
||||
Reference in new issue
Block a user