# ifbars/vrchat-protvconvertor architecture

> Architecture diagram of the GitHub repository ifbars/vrchat-protvconvertor, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ifbars/vrchat-protvconvertor
- Repository: https://github.com/ifbars/vrchat-protvconvertor

## Overview

##### Project type and purpose
- ProTVConvertor is a Windows desktop application built with .NET (C#) and WinForms.
- Its purpose is to take YouTube video/playlist URLs (and other HTTP(S) video links), query the YouTube Data API to fetch metadata (including thumbnails), filter out invalid or duplicate entries, and output a properly formatted playlist file for the ProTV VRChat add-on.

##### File structure
- Top-level solution (`UrlArray.sln`) contains one WinForms project (`ProTVConvertor.csproj` under the UrlArray folder).
- The UrlArray project holds:
- Designer files (`Form1.Designer.cs`, `Form2.Designer.cs`) plus their code-behind (`.cs`) and resources (`.resx`) – this is the UI layer.
- `Program.cs` and `Version.cs` – application entry point and version management.
- `Properties` folder – assembly metadata, resources, and user settings.
- `App.config` – runtime configuration (e.g., API key placeholder).
- `packages.config` + `packages` folder – NuGet dependencies (Google.Apis.*, Newtonsoft.Json).
- `obj` and `bin` folders – build artifacts.

##### README for additional insights
- Confirms use of YouTube Data API (requires API key), multi-threading for performance, thumbnail downloading, automatic update checking, and invalid video removal.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% UI Layer
    subgraph "UI Layer"
        F1["Form1 (Main UI)"]:::frontend
        F2["Form2 (Settings/Update)"]:::frontend
        Prog["Program.cs"]:::frontend
        Ver["Version.cs"]:::frontend
    end

    %% Configuration & Metadata
    subgraph "Configuration & Metadata"
        AppConfig["App.config"]:::storage
        Settings["Settings.settings"]:::storage
        Assembly["AssemblyInfo.cs"]:::storage
        Res1["Resources.resx"]:::storage
        Res2["Resources.Designer.cs"]:::storage
    end

    %% Core Logic
    subgraph "Core Logic"
        URLMgr["URL Manager"]:::core
        YTClient["YouTube API Client"]:::core
        JSONSer["JSON Serializer"]:::core
        ThumbD["Thumbnail Downloader"]:::core
        LinkVal["Link Validator & Filter"]:::core
        Exporter["Exporter"]:::core
        UpCheck["Update Checker"]:::core
    end

    %% External Services
    subgraph "External Services"
        YouTubeAPI["YouTube Data API"]:::external
        GitHubAPI["GitHub Releases API"]:::external
    end

    %% Local Storage
    subgraph "Local Storage"
        FS["File System"]:::storage
        ObjDbg["obj/Debug"]:::storage
        ObjRel["obj/Release"]:::storage
    end

    %% Connections
    Prog -->|starts| F1
    Prog -->|starts| F2
    AppConfig -->|configures| URLMgr
    Settings -->|configures| URLMgr
    Assembly -->|metadata| F1
    F1 -->|invokes| URLMgr
    F2 -->|invokes| UpCheck
    URLMgr -->|calls| YTClient
    YTClient -->|HTTP GET| YouTubeAPI
    YouTubeAPI -->|JSON response| YTClient
    YTClient -->|parses JSON| JSONSer
    JSONSer -->|provides data| YTClient
    YTClient -->|downloads| ThumbD
    ThumbD -->|saves| FS
    URLMgr -->|validates| LinkVal
    LinkVal -->|returns valid list| URLMgr
    URLMgr -->|formats| Exporter
    Exporter -->|writes .txt| FS
    UpCheck -->|checks| GitHubAPI
    GitHubAPI -->|returns releases| UpCheck
    FS --> ObjDbg
    FS --> ObjRel

    %% Click Events
    click F1 "https://github.com/ifbars/vrchat-protvconvertor/blob/main/UrlArray/Form1.cs"
    click F2 "https://github.com/ifbars/vrchat-protvconvertor/blob/main/UrlArray/Form2.cs"
    click Prog "https://github.com/ifbars/vrchat-protvconvertor/blob/main/UrlArray/Program.cs"
    click Ver "https://github.com/ifbars/vrchat-protvconvertor/blob/main/UrlArray/Version.cs"
    click AppConfig "https://github.com/ifbars/vrchat-protvconvertor/blob/main/UrlArray/App.config"
    click Settings "https://github.com/ifbars/vrchat-protvconvertor/blob/main/UrlArray/Properties/Settings.settings"
    click Assembly "https://github.com/ifbars/vrchat-protvconvertor/blob/main/UrlArray/Properties/AssemblyInfo.cs"
    click Res1 "https://github.com/ifbars/vrchat-protvconvertor/blob/main/UrlArray/Properties/Resources.resx"
    click Res2 "https://github.com/ifbars/vrchat-protvconvertor/blob/main/UrlArray/Properties/Resources.Designer.cs"
    click URLMgr "https://github.com/ifbars/vrchat-protvconvertor/tree/main/UrlArray"
    click YTClient "https://github.com/ifbars/vrchat-protvconvertor/blob/main/packages/Google.Apis.YouTube.v3.1.58.0.2874/lib/net45/Google.Apis.YouTube.v3.dll"
    click JSONSer "https://github.com/ifbars/vrchat-protvconvertor/blob/main/packages/Newtonsoft.Json.13.0.2/lib/net45/Newtonsoft.Json.dll"
    click UpCheck "https://github.com/ifbars/vrchat-protvconvertor/blob/main/UrlArray/Form2.cs"
    click ObjDbg "https://github.com/ifbars/vrchat-protvconvertor/tree/main/UrlArray/obj/Debug"
    click ObjRel "https://github.com/ifbars/vrchat-protvconvertor/tree/main/UrlArray/obj/Release"

    %% Styles
    classDef frontend fill:#D6E9FF,stroke:#333,stroke-width:1px;
    classDef core fill:#DFFFD6,stroke:#333,stroke-width:1px;
    classDef external fill:#FFE4B2,stroke:#333,stroke-width:1px;
    classDef storage fill:#EBEBEB,stroke:#333,stroke-width:1px;
```
