# fer0n/unwatched architecture

> Architecture diagram of the GitHub repository fer0n/unwatched, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fer0n/unwatched
- Repository: https://github.com/fer0n/unwatched

## Overview

Unwatched is a cross-platform RSS-based YouTube player. Its main workflow is to follow channels or add individual videos, sort new items through the inbox or queue, then play them with playback-speed and chapter controls. The README also highlights search, podcast support, notifications, and iCloud sync. The graph combines those documented capabilities with relationships shown in sampled source and the SOURCE INDEX; unsampled feature internals are represented at their existing directory paths.

Main entry points: [`UnwatchedShared/UnwatchedShared/Model/Video.swift`](https://github.com/fer0n/unwatched/blob/main/UnwatchedShared/UnwatchedShared/Model/Video.swift) (Video library), [`Unwatched/Unwatched/Controller/PlayerManager/PlayerManager.swift`](https://github.com/fer0n/unwatched/blob/main/Unwatched/Unwatched/Controller/PlayerManager/PlayerManager.swift) (Playback manager), [`UnwatchedShared/UnwatchedShared/Model/Subscription.swift`](https://github.com/fer0n/unwatched/blob/main/UnwatchedShared/UnwatchedShared/Model/Subscription.swift) (Subscriptions), [`Unwatched/Unwatched/Controller/NavigationManager.swift`](https://github.com/fer0n/unwatched/blob/main/Unwatched/Unwatched/Controller/NavigationManager.swift) (Navigation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Discovery and intake"]
  node_navigation["Navigation"]
  node_browser["YouTube browser<br/>[BrowserView.swift]"]
  node_channel_search["Channel search"]
  node_url_service["URL handling<br/>[UrlService.swift]"]
end

subgraph group_library["Queue and library"]
  node_queue[("Queue<br/>[QueueEntry.swift]")]
  node_inbox[("Inbox triage<br/>[InboxEntry.swift]")]
  node_subscriptions[("Subscriptions<br/>[Subscription.swift]")]
  node_videos[("Video library<br/>[Video.swift]")]
  node_library_views["Library views<br/>[LibraryView.swift]"]
end

subgraph group_playback["Playback and chapters"]
  node_player_manager["Playback manager"]
  node_player_backend["Player backend"]
  node_av_player["AV player"]
  node_chapters["Chapter service"]
  node_chapter_ui["Chapter controls<br/>[ChapterList.swift]"]
end

subgraph group_services["Data and services"]
  node_video_service["Video service<br/>[VideoService.swift]"]
  node_subscription_service["Subscription service"]
  node_refresh["Feed refresh"]
  node_search["Local search"]
  node_sync["Cloud sync"]
  node_podcast["Podcast downloads"]
end

subgraph group_platform["App integrations"]
  node_share["Share intake"]
end

node_user(("Viewer"))
node_data_api{{"YouTube data API"}}
node_icloud{{"iCloud"}}

node_user -->|"opens app"| node_navigation
node_navigation -->|"routes to"| node_browser
node_navigation -->|"starts playback"| node_player_manager
node_user -->|"shares URL"| node_share
node_share -->|"adds video"| node_videos
node_share -->|"previews channel"| node_subscriptions
node_browser -.->|"resolves URL"| node_url_service
node_user -->|"finds channels"| node_channel_search
node_channel_search -.->|"searches channels"| node_data_api
node_user -->|"follows channels"| node_subscriptions
node_subscriptions -.->|"refreshes feeds"| node_refresh
node_refresh -->|"fetches videos"| node_videos
node_videos -->|"triages new items"| node_inbox
node_videos -->|"queues new items"| node_queue
node_user -->|"organizes queue"| node_queue
node_user -->|"sorts new items"| node_inbox
node_library_views -.->|"shows library"| node_videos
node_library_views -.->|"offers search"| node_search
node_search -->|"searches videos"| node_videos
node_player_manager -->|"controls playback"| node_player_backend
node_player_backend -->|"uses AV player"| node_av_player
node_player_manager -->|"marks watched"| node_videos
node_player_manager -->|"moves video"| node_queue
node_player_manager -.->|"controls chapters"| node_chapters
node_chapter_ui -->|"shows chapters"| node_chapters
node_user -->|"plays video"| node_player_manager
node_subscriptions -.->|"syncs library"| node_sync
node_sync -->|"syncs data"| node_icloud
node_user -.->|"downloads podcasts"| node_podcast
node_podcast -.->|"tracks downloads"| node_videos

click node_navigation "https://github.com/fer0n/unwatched/blob/main/Unwatched/Unwatched/Controller/NavigationManager.swift"
click node_browser "https://github.com/fer0n/unwatched/blob/main/Unwatched/Unwatched/View/Browser/BrowserView.swift"
click node_channel_search "https://github.com/fer0n/unwatched/blob/main/Unwatched/Unwatched/Service/YoutubeChannelSearch.swift"
click node_url_service "https://github.com/fer0n/unwatched/blob/main/Unwatched/Unwatched/Service/UrlService.swift"
click node_share "https://github.com/fer0n/unwatched/blob/main/Unwatched/UnwatchedShareExtension/ShareViewController.swift"
click node_queue "https://github.com/fer0n/unwatched/blob/main/UnwatchedShared/UnwatchedShared/Model/QueueEntry.swift"
click node_inbox "https://github.com/fer0n/unwatched/blob/main/UnwatchedShared/UnwatchedShared/Model/InboxEntry.swift"
click node_subscriptions "https://github.com/fer0n/unwatched/blob/main/UnwatchedShared/UnwatchedShared/Model/Subscription.swift"
click node_videos "https://github.com/fer0n/unwatched/blob/main/UnwatchedShared/UnwatchedShared/Model/Video.swift"
click node_library_views "https://github.com/fer0n/unwatched/blob/main/Unwatched/Unwatched/View/Library/LibraryView.swift"
click node_player_manager "https://github.com/fer0n/unwatched/blob/main/Unwatched/Unwatched/Controller/PlayerManager/PlayerManager.swift"
click node_player_backend "https://github.com/fer0n/unwatched/blob/main/UnwatchedShared/UnwatchedShared/Controller/PlayerBackend.swift"
click node_av_player "https://github.com/fer0n/unwatched/blob/main/Unwatched/Unwatched/InnerTube/AVPlayerViewModel.swift"
click node_chapters "https://github.com/fer0n/unwatched/blob/main/UnwatchedShared/UnwatchedShared/Service/ChapterService.swift"
click node_chapter_ui "https://github.com/fer0n/unwatched/blob/main/Unwatched/Unwatched/View/Chapter/ChapterList.swift"
click node_video_service "https://github.com/fer0n/unwatched/blob/main/Unwatched/Unwatched/Service/VideoService.swift"
click node_subscription_service "https://github.com/fer0n/unwatched/blob/main/Unwatched/Unwatched/Service/SubscriptionService.swift"
click node_refresh "https://github.com/fer0n/unwatched/blob/main/Unwatched/Unwatched/Controller/RefreshManager/RefreshManager.swift"
click node_search "https://github.com/fer0n/unwatched/blob/main/Unwatched/Unwatched/Service/LocalSearchService.swift"
click node_sync "https://github.com/fer0n/unwatched/blob/main/Unwatched/Unwatched/Helper/CloudStorage/CloudStorageSync.swift"
click node_podcast "https://github.com/fer0n/unwatched/blob/main/UnwatchedShared/UnwatchedShared/Controller/PodcastDownloadManager.swift"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_navigation,node_browser,node_channel_search,node_url_service,node_user toneBlue
class node_queue,node_inbox,node_subscriptions,node_videos,node_library_views toneAmber
class node_player_manager,node_player_backend,node_av_player,node_chapters,node_chapter_ui,node_data_api toneMint
class node_video_service,node_subscription_service,node_refresh,node_search,node_sync,node_podcast toneRose
class node_share,node_icloud toneIndigo
```

## Components

### Discovery and intake

- [Navigation](https://github.com/fer0n/unwatched/blob/main/Unwatched/Unwatched/Controller/NavigationManager.swift): `Unwatched/Unwatched/Controller/NavigationManager.swift`
- [YouTube browser](https://github.com/fer0n/unwatched/blob/main/Unwatched/Unwatched/View/Browser/BrowserView.swift): `Unwatched/Unwatched/View/Browser/BrowserView.swift`
- [Channel search](https://github.com/fer0n/unwatched/blob/main/Unwatched/Unwatched/Service/YoutubeChannelSearch.swift): `Unwatched/Unwatched/Service/YoutubeChannelSearch.swift`
- [URL handling](https://github.com/fer0n/unwatched/blob/main/Unwatched/Unwatched/Service/UrlService.swift): `Unwatched/Unwatched/Service/UrlService.swift`

### Queue and library

- [Queue](https://github.com/fer0n/unwatched/blob/main/UnwatchedShared/UnwatchedShared/Model/QueueEntry.swift): `UnwatchedShared/UnwatchedShared/Model/QueueEntry.swift`
- [Inbox triage](https://github.com/fer0n/unwatched/blob/main/UnwatchedShared/UnwatchedShared/Model/InboxEntry.swift): `UnwatchedShared/UnwatchedShared/Model/InboxEntry.swift`
- [Subscriptions](https://github.com/fer0n/unwatched/blob/main/UnwatchedShared/UnwatchedShared/Model/Subscription.swift): `UnwatchedShared/UnwatchedShared/Model/Subscription.swift`
- [Video library](https://github.com/fer0n/unwatched/blob/main/UnwatchedShared/UnwatchedShared/Model/Video.swift): `UnwatchedShared/UnwatchedShared/Model/Video.swift`
- [Library views](https://github.com/fer0n/unwatched/blob/main/Unwatched/Unwatched/View/Library/LibraryView.swift): `Unwatched/Unwatched/View/Library/LibraryView.swift`

### Playback and chapters

- [Playback manager](https://github.com/fer0n/unwatched/blob/main/Unwatched/Unwatched/Controller/PlayerManager/PlayerManager.swift): `Unwatched/Unwatched/Controller/PlayerManager/PlayerManager.swift`
- [Player backend](https://github.com/fer0n/unwatched/blob/main/UnwatchedShared/UnwatchedShared/Controller/PlayerBackend.swift): `UnwatchedShared/UnwatchedShared/Controller/PlayerBackend.swift`
- [AV player](https://github.com/fer0n/unwatched/blob/main/Unwatched/Unwatched/InnerTube/AVPlayerViewModel.swift): `Unwatched/Unwatched/InnerTube/AVPlayerViewModel.swift`
- [Chapter service](https://github.com/fer0n/unwatched/blob/main/UnwatchedShared/UnwatchedShared/Service/ChapterService.swift): `UnwatchedShared/UnwatchedShared/Service/ChapterService.swift`
- [Chapter controls](https://github.com/fer0n/unwatched/blob/main/Unwatched/Unwatched/View/Chapter/ChapterList.swift): `Unwatched/Unwatched/View/Chapter/ChapterList.swift`

### Data and services

- [Video service](https://github.com/fer0n/unwatched/blob/main/Unwatched/Unwatched/Service/VideoService.swift): `Unwatched/Unwatched/Service/VideoService.swift`
- [Subscription service](https://github.com/fer0n/unwatched/blob/main/Unwatched/Unwatched/Service/SubscriptionService.swift): `Unwatched/Unwatched/Service/SubscriptionService.swift`
- [Feed refresh](https://github.com/fer0n/unwatched/blob/main/Unwatched/Unwatched/Controller/RefreshManager/RefreshManager.swift): `Unwatched/Unwatched/Controller/RefreshManager/RefreshManager.swift`
- [Local search](https://github.com/fer0n/unwatched/blob/main/Unwatched/Unwatched/Service/LocalSearchService.swift): `Unwatched/Unwatched/Service/LocalSearchService.swift`
- [Cloud sync](https://github.com/fer0n/unwatched/blob/main/Unwatched/Unwatched/Helper/CloudStorage/CloudStorageSync.swift): `Unwatched/Unwatched/Helper/CloudStorage/CloudStorageSync.swift`
- [Podcast downloads](https://github.com/fer0n/unwatched/blob/main/UnwatchedShared/UnwatchedShared/Controller/PodcastDownloadManager.swift): `UnwatchedShared/UnwatchedShared/Controller/PodcastDownloadManager.swift`

### App integrations

- [Share intake](https://github.com/fer0n/unwatched/blob/main/Unwatched/UnwatchedShareExtension/ShareViewController.swift): `Unwatched/UnwatchedShareExtension/ShareViewController.swift`

### Other components

- **Viewer**
- **YouTube data API**
- **iCloud**

## Connections

- Viewer → Navigation: opens app (evidence: `README.md`)
- Navigation → YouTube browser: routes to (evidence: `Unwatched/Unwatched/Controller/NavigationManager.swift`)
- Navigation → Playback manager: starts playback (evidence: `Unwatched/Unwatched/Controller/NavigationManager.swift`)
- Viewer → Share intake: shares URL (evidence: `Unwatched/UnwatchedShareExtension/ShareViewController.swift`)
- Share intake → Video library: adds video (evidence: `Unwatched/UnwatchedShareExtension/ShareViewController.swift`)
- Share intake → Subscriptions: previews channel (evidence: `Unwatched/UnwatchedShareExtension/ShareViewController.swift`)
- YouTube browser → URL handling: resolves URL
- Viewer → Channel search: finds channels (evidence: `README.md`)
- Channel search → YouTube data API: searches channels
- Viewer → Subscriptions: follows channels (evidence: `README.md`)
- Subscriptions → Feed refresh: refreshes feeds
- Feed refresh → Video library: fetches videos (evidence: `Unwatched/Unwatched/Controller/RefreshManager/RefreshManager.swift`)
- Video library → Inbox triage: triages new items (evidence: `README.md`)
- Video library → Queue: queues new items (evidence: `README.md`)
- Viewer → Queue: organizes queue (evidence: `README.md`)
- Viewer → Inbox triage: sorts new items (evidence: `README.md`)
- Library views → Video library: shows library
- Library views → Local search: offers search
- Local search → Video library: searches videos (evidence: `Unwatched/Unwatched/Service/LocalSearchService.swift`)
- Playback manager → Player backend: controls playback (evidence: `Unwatched/Unwatched/Controller/PlayerManager/PlayerManager+Playback.swift`)
- Player backend → AV player: uses AV player (evidence: `Unwatched/Unwatched/Controller/PlayerManager/PlayerManager+Playback.swift`)
- Playback manager → Video library: marks watched (evidence: `Unwatched/Unwatched/Controller/PlayerManager/PlayerManager.swift`)
- Playback manager → Queue: moves video (evidence: `Unwatched/Unwatched/Controller/PlayerManager/PlayerManager.swift`)
- Playback manager → Chapter service: controls chapters
- Chapter controls → Chapter service: shows chapters (evidence: `README.md`)
- Viewer → Playback manager: plays video (evidence: `README.md`)
- Subscriptions → Cloud sync: syncs library
- Cloud sync → iCloud: syncs data (evidence: `README.md`)
- Viewer → Podcast downloads: downloads podcasts
- Podcast downloads → Video library: tracks downloads
