# hoangviet24/film-library architecture

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

- Interactive diagram: https://gitdiagram.com/hoangviet24/film-library
- Repository: https://github.com/hoangviet24/film-library

## Overview

Fluent Media Player is a Windows desktop video player. Users open a file or scan a folder, browse grouped episodes, play and control video, and resume from saved progress; they can also use seek previews, floating playback, and Windows Open With. The graph combines sampled call wiring with README-documented capabilities. Some widget and integration internals were not sampled, so documented but unverified connections are dashed.

Main entry points: [`main_window.py`](https://github.com/hoangviet24/film-library/blob/main/main_window.py) (Main Window), [`widgets/controls_bar.py`](https://github.com/hoangviet24/film-library/blob/main/widgets/controls_bar.py) (Playback Controls), [`widgets/sidebar_widget.py`](https://github.com/hoangviet24/film-library/blob/main/widgets/sidebar_widget.py) (Episode Sidebar), [`app.py`](https://github.com/hoangviet24/film-library/blob/main/app.py) (App Startup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_app_entry["App Startup<br/>[app.py]"]
  node_main_window["Main Window<br/>[main_window.py]"]
  node_config["Runtime Config<br/>[config.py]"]
  node_styles["Fluent Styling<br/>[styles.py]"]
end

subgraph group_playback["Playback"]
  node_player["Player Controller"]
  node_vlc["libVLC"]
  node_controls["Playback Controls<br/>[controls_bar.py]"]
  node_overlay["Playback Overlay<br/>[overlay_panel.py]"]
  node_slider["Seek Slider"]
  node_floating["Floating Player<br/>[floating_window.py]"]
end

subgraph group_library["Library &amp; History"]
  node_sidebar["Episode Sidebar<br/>[sidebar_widget.py]"]
  node_episode["Episode Item<br/>[episode_item.py]"]
  node_landing["Landing Page<br/>[landing_widget.py]"]
  node_history[("Watch History<br/>[history.py]")]
  node_filesystem[("Video Files")]
end

subgraph group_preview["Preview &amp; Thumbnails"]
  node_preview_manager["Seek Preview Worker<br/>[preview_manager.py]"]
  node_preview_popup["Preview Popup<br/>[preview_popup.py]"]
  node_thumbnail["Thumbnail Generator<br/>[thumbnail.py]"]
end

subgraph group_integration["Windows Integration"]
  node_open_with["Open With Setup"]
  node_explorer(("Windows Explorer"))
  node_window_icon["Window Icon<br/>[window_icon.py]"]
end

node_user(("Viewer"))

node_user -->|"launches"| node_app_entry
node_app_entry -->|"starts"| node_main_window
node_app_entry -->|"imports"| node_config
node_user -->|"opens media"| node_main_window
node_main_window -->|"controls playback"| node_player
node_player -->|"drives playback"| node_vlc
node_main_window -.->|"updates controls"| node_controls
node_controls -->|"uses"| node_slider
node_main_window -.->|"shows modes"| node_overlay
node_overlay -->|"uses"| node_slider
node_overlay -->|"displays"| node_preview_popup
node_controls -->|"displays"| node_preview_popup
node_user -->|"selects episodes"| node_sidebar
node_main_window -.->|"routes playback"| node_sidebar
node_sidebar -->|"renders items"| node_episode
node_user -->|"chooses files"| node_landing
node_landing -->|"sends selections"| node_main_window
node_main_window -->|"opens and scans"| node_filesystem
node_main_window -.->|"loads and saves progress"| node_history
node_history -->|"uses data path"| node_config
node_user -->|"seeks timeline"| node_controls
node_controls -.->|"requests frames"| node_preview_manager
node_preview_manager -.->|"provides images"| node_preview_popup
node_sidebar -->|"requests thumbnails"| node_thumbnail
node_thumbnail -.->|"reads video"| node_filesystem
node_user -->|"chooses Open With"| node_explorer
node_explorer -.->|"invokes registration"| node_open_with
node_open_with -.->|"opens selected media"| node_main_window
node_main_window -->|"sets window icon"| node_window_icon
node_main_window -.->|"supports pop-out mode"| node_floating
node_main_window -->|"applies styling"| node_styles

click node_app_entry "https://github.com/hoangviet24/film-library/blob/main/app.py"
click node_main_window "https://github.com/hoangviet24/film-library/blob/main/main_window.py"
click node_config "https://github.com/hoangviet24/film-library/blob/main/config.py"
click node_styles "https://github.com/hoangviet24/film-library/blob/main/styles.py"
click node_player "https://github.com/hoangviet24/film-library/blob/main/player_controller.py"
click node_controls "https://github.com/hoangviet24/film-library/blob/main/widgets/controls_bar.py"
click node_overlay "https://github.com/hoangviet24/film-library/blob/main/widgets/overlay_panel.py"
click node_slider "https://github.com/hoangviet24/film-library/blob/main/widgets/clickable_slider.py"
click node_floating "https://github.com/hoangviet24/film-library/blob/main/widgets/floating_window.py"
click node_sidebar "https://github.com/hoangviet24/film-library/blob/main/widgets/sidebar_widget.py"
click node_episode "https://github.com/hoangviet24/film-library/blob/main/widgets/episode_item.py"
click node_landing "https://github.com/hoangviet24/film-library/blob/main/widgets/landing_widget.py"
click node_history "https://github.com/hoangviet24/film-library/blob/main/utils/history.py"
click node_preview_manager "https://github.com/hoangviet24/film-library/blob/main/utils/preview_manager.py"
click node_preview_popup "https://github.com/hoangviet24/film-library/blob/main/widgets/preview_popup.py"
click node_thumbnail "https://github.com/hoangviet24/film-library/blob/main/utils/thumbnail.py"
click node_open_with "https://github.com/hoangviet24/film-library/blob/main/utils/open_with_installer.py"
click node_window_icon "https://github.com/hoangviet24/film-library/blob/main/utils/window_icon.py"

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_app_entry,node_main_window,node_config,node_styles,node_user toneBlue
class node_player,node_vlc,node_controls,node_overlay,node_slider,node_floating toneAmber
class node_sidebar,node_episode,node_landing,node_history,node_filesystem toneMint
class node_preview_manager,node_preview_popup,node_thumbnail toneRose
class node_open_with,node_explorer,node_window_icon toneIndigo
```

## Components

### Application

- [App Startup](https://github.com/hoangviet24/film-library/blob/main/app.py): `app.py`
- [Main Window](https://github.com/hoangviet24/film-library/blob/main/main_window.py): `main_window.py`
- [Runtime Config](https://github.com/hoangviet24/film-library/blob/main/config.py): `config.py`
- [Fluent Styling](https://github.com/hoangviet24/film-library/blob/main/styles.py): `styles.py`

### Playback

- [Player Controller](https://github.com/hoangviet24/film-library/blob/main/player_controller.py): `player_controller.py`
- **libVLC**
- [Playback Controls](https://github.com/hoangviet24/film-library/blob/main/widgets/controls_bar.py): `widgets/controls_bar.py`
- [Playback Overlay](https://github.com/hoangviet24/film-library/blob/main/widgets/overlay_panel.py): `widgets/overlay_panel.py`
- [Seek Slider](https://github.com/hoangviet24/film-library/blob/main/widgets/clickable_slider.py): `widgets/clickable_slider.py`
- [Floating Player](https://github.com/hoangviet24/film-library/blob/main/widgets/floating_window.py): `widgets/floating_window.py`

### Library & History

- [Episode Sidebar](https://github.com/hoangviet24/film-library/blob/main/widgets/sidebar_widget.py): `widgets/sidebar_widget.py`
- [Episode Item](https://github.com/hoangviet24/film-library/blob/main/widgets/episode_item.py): `widgets/episode_item.py`
- [Landing Page](https://github.com/hoangviet24/film-library/blob/main/widgets/landing_widget.py): `widgets/landing_widget.py`
- [Watch History](https://github.com/hoangviet24/film-library/blob/main/utils/history.py): `utils/history.py`
- **Video Files**

### Preview & Thumbnails

- [Seek Preview Worker](https://github.com/hoangviet24/film-library/blob/main/utils/preview_manager.py): `utils/preview_manager.py`
- [Preview Popup](https://github.com/hoangviet24/film-library/blob/main/widgets/preview_popup.py): `widgets/preview_popup.py`
- [Thumbnail Generator](https://github.com/hoangviet24/film-library/blob/main/utils/thumbnail.py): `utils/thumbnail.py`

### Windows Integration

- [Open With Setup](https://github.com/hoangviet24/film-library/blob/main/utils/open_with_installer.py): `utils/open_with_installer.py`
- **Windows Explorer**
- [Window Icon](https://github.com/hoangviet24/film-library/blob/main/utils/window_icon.py): `utils/window_icon.py`

### Other components

- **Viewer**

## Connections

- Viewer → App Startup: launches (evidence: `README.md`)
- App Startup → Main Window: starts (evidence: `app.py`)
- App Startup → Runtime Config: imports (evidence: `app.py`)
- Viewer → Main Window: opens media (evidence: `README.md`)
- Main Window → Player Controller: controls playback (evidence: `main_window.py`)
- Player Controller → libVLC: drives playback (evidence: `player_controller.py`)
- Main Window → Playback Controls: updates controls
- Playback Controls → Seek Slider: uses (evidence: `widgets/controls_bar.py`)
- Main Window → Playback Overlay: shows modes
- Playback Overlay → Seek Slider: uses (evidence: `widgets/overlay_panel.py`)
- Playback Overlay → Preview Popup: displays (evidence: `widgets/overlay_panel.py`)
- Playback Controls → Preview Popup: displays (evidence: `widgets/controls_bar.py`)
- Viewer → Episode Sidebar: selects episodes (evidence: `README.md`)
- Main Window → Episode Sidebar: routes playback
- Episode Sidebar → Episode Item: renders items (evidence: `widgets/sidebar_widget.py`)
- Viewer → Landing Page: chooses files (evidence: `README.md`)
- Landing Page → Main Window: sends selections (evidence: `main_window.py`)
- Main Window → Video Files: opens and scans (evidence: `README.md`)
- Main Window → Watch History: loads and saves progress (evidence: `README.md`)
- Watch History → Runtime Config: uses data path (evidence: `utils/history.py`)
- Viewer → Playback Controls: seeks timeline (evidence: `README.md`)
- Playback Controls → Seek Preview Worker: requests frames
- Seek Preview Worker → Preview Popup: provides images
- Episode Sidebar → Thumbnail Generator: requests thumbnails (evidence: `widgets/sidebar_widget.py`)
- Thumbnail Generator → Video Files: reads video
- Viewer → Windows Explorer: chooses Open With (evidence: `README.md`)
- Windows Explorer → Open With Setup: invokes registration
- Open With Setup → Main Window: opens selected media
- Main Window → Window Icon: sets window icon (evidence: `main_window.py`)
- Main Window → Floating Player: supports pop-out mode
- Main Window → Fluent Styling: applies styling (evidence: `main_window.py`)
