Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,17 +234,17 @@ it report `"oidc_state": true` in `GET /meta`.
`privacy_policy_url` if configured. Clients use the capabilities to decide which
features they can use.

| Capability | Meaning |
| ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| `encrypted_sync` | [Encrypted sync](#encrypted-sync) is available |
| `collection_changes` | Collections accept [incremental changes](#incremental-changes) |
| `live_sync` | [Change notifications and device requests](#live-sync) |
| `account_sessions` | Tokens are bound to [account sessions](#account-sessions) |
| `key_pairing` | [Secure device pairing](#secure-device-pairing) |
| `bulk_sync` | Plaintext subscriptions and watch history accept bulk uploads |
| `history_page_size` | Maximum page size for plaintext watch history |
| `seen_videos`, `seen_posts`, `seen_rss_items`, `watch_stats`, `live_reminders`, `external_media_positions`, `notification_dismissals` | The matching [collection](#collections) exists |
| `separate_profiles` | [Separate profiles](#separate-profiles) have their own collections |
| Capability | Meaning |
| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| `encrypted_sync` | [Encrypted sync](#encrypted-sync) is available |
| `collection_changes` | Collections accept [incremental changes](#incremental-changes) |
| `live_sync` | [Change notifications and device requests](#live-sync) |
| `account_sessions` | Tokens are bound to [account sessions](#account-sessions) |
| `key_pairing` | [Secure device pairing](#secure-device-pairing) |
| `bulk_sync` | Plaintext subscriptions and watch history accept bulk uploads |
| `history_page_size` | Maximum page size for plaintext watch history |
| `seen_videos`, `seen_posts`, `seen_rss_items`, `watch_stats`, `live_reminders`, `external_media_positions`, `notification_dismissals`, `sync_deletions` | The matching [collection](#collections) exists |
| `separate_profiles` | [Separate profiles](#separate-profiles) have their own collections |

### Encrypted sync

Expand Down Expand Up @@ -278,6 +278,7 @@ features they can use.
| `seenPosts` | 16 MiB | `seen_posts` |
| `seenRssItems` | 16 MiB | `seen_rss_items` |
| `externalMediaPositions` (media opened by URL) | 16 MiB | `external_media_positions` |
| `syncDeletions` (deletions confirmed on a device) | 16 MiB | `sync_deletions` |
| `playlists`, `history` | 64 MiB | |

All collections of an account, including pending changes, are limited to
Expand Down
1 change: 1 addition & 0 deletions src/dto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ pub struct SyncCapabilities {
pub external_media_positions: u8,
pub seen_rss_items: u8,
pub notification_dismissals: u8,
pub sync_deletions: u8,
pub live_sync: u8,
/// Collections accept appended changes and incremental reads.
pub collection_changes: u8,
Expand Down
5 changes: 5 additions & 0 deletions src/handlers/encrypted_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ pub(crate) fn sync_capabilities() -> SyncCapabilities {
external_media_positions: 1,
seen_rss_items: 1,
notification_dismissals: 1,
sync_deletions: 1,
live_sync: 1,
collection_changes: 1,
separate_profiles: 1,
Expand Down Expand Up @@ -130,6 +131,8 @@ fn collection_limit(collection: &str) -> HandlerResult<usize> {
"watchStats" | "liveReminders" => Ok(8 * MEBIBYTE),
// Playback positions of media opened by URL instead of from YouTube.
"externalMediaPositions" => Ok(16 * MEBIBYTE),
// Deletions devices confirmed, so other devices apply them without asking.
"syncDeletions" => Ok(16 * MEBIBYTE),
"subscriptions" | "playlistBookmarks" | "seenVideos" | "seenPosts" | "seenRssItems" => {
Ok(16 * MEBIBYTE)
}
Expand Down Expand Up @@ -640,6 +643,8 @@ mod tests {
2 * MEBIBYTE
);
assert_eq!(super::sync_capabilities().notification_dismissals, 1);
assert_eq!(collection_limit("syncDeletions").unwrap(), 16 * MEBIBYTE);
assert_eq!(super::sync_capabilities().sync_deletions, 1);
assert_eq!(super::sync_capabilities().live_reminders, 1);
assert_eq!(super::sync_capabilities().watch_stats, 1);
assert_eq!(super::sync_capabilities().seen_videos, 1);
Expand Down
1 change: 1 addition & 0 deletions src/handlers/health.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ mod tests {
assert_eq!(json["capabilities"]["external_media_positions"], 1);
assert_eq!(json["capabilities"]["seen_rss_items"], 1);
assert_eq!(json["capabilities"]["notification_dismissals"], 1);
assert_eq!(json["capabilities"]["sync_deletions"], 1);
assert_eq!(json["capabilities"]["separate_profiles"], 1);
match &policy {
Some(url) => assert_eq!(json["privacy_policy_url"], *url),
Expand Down
Loading