# आर्किटेक्चर

How Volt Download Manager's pieces fit together.

## क्रेट्स

| पाथ | क्रेट | भूमिका |
|---|---|---|
| `crates/engine` | `vdm-engine` | HTTP(S) या FTP(S) पर एक फ़ाइल डाउनलोड करता है: जांच, सेगमेंट प्लानर, कनेक्शन वर्कर, फिर से शुरू करने की स्थिति, प्रति-होस्ट सीमाएं, गति सीमक, चेकसम, प्रॉक्सी स्क्रिप्ट |
| `crates/app` | `vdm-app` | डेस्कटॉप ऐप (`voltdownloadmanager.exe`, egui): सूची, श्रेणियां, कतारें, शेड्यूलर, डायलॉग, ट्रे, सेटिंग्स |
| `crates/cli` | `vdm-cli` | प्रगति (`get`, `resume`), वीडियो, टोरेंट और ऑटोमेशन API के कमांड के साथ हेडलेस डाउनलोड: एक लाइब्रेरी जिसे ऐप का प्रोग्राम चलाता है (`voltdownloadmanager --cli …`), और `voltdownloadmanager-cli`, एक छोटा लॉन्चर जो इसे समान आर्ग्यूमेंट्स, टर्मिनल और एग्जिट कोड के साथ शुरू करता है |
| `crates/mcp` | `vdm-mcp` | MCP सर्वर (`voltdownloadmanager-mcp`): AI असिस्टेंट चल रहे ऐप के डाउनलोड को ऑटोमेशन API के माध्यम से सूचीबद्ध करते हैं, जोड़ते हैं और नियंत्रित करते हैं |
| `crates/remote` | `vdm-remote` | रिमोट कंट्रोल (#141): HTTPS सर्वर जिसका उपयोग स्थानीय नेटवर्क पर एक युग्मित फ़ोन या कंप्यूटर करता है (इसका पेज, युग्मन कोड, डिवाइस टोकन, सेल्फ-साइन किया गया प्रमाणपत्र); प्रत्येक अनुरोध एक ऑटोमेशन API कमांड बन जाता है जिसका ऐप जवाब देता है |
| `crates/nmhost` | `vdm-nmhost` | ब्राउज़र का नेटिव मैसेजिंग होस्ट: एक्सटेंशन से कैप्चर किए गए डाउनलोड लेता है और उन्हें ऐप को सौंपता है |
| `crates/ipc` | `vdm-ipc` | सिंगल-इंस्टेंस चैनल (एक टोकन-सुरक्षित लोकल सॉकेट), डेटा फ़ोल्डर, ऐप और होस्ट द्वारा साझा किए गए कैप्चर नियम, और ऐप और कमांड लाइन द्वारा साझा किए गए साइट नियम (#1778: एक यूज़र-एजेंट, हेडर, कनेक्शन, ब्राउज़र जैसा कनेक्शन और, #1960, साइट पैटर्न द्वारा एक प्रॉक्सी) |
| `crates/debrid` | `vdm-debrid` | डीब्रिड खाते (#44): सेवाओं के आधिकारिक API (Real-Debrid, AllDebrid, Premiumize, TorBox, Mega-Debrid) एक फ़ाइल होस्ट के लिंक को एक डायरेक्ट लिंक में बदल देते हैं जिसे इंजन डाउनलोड करता है। |
| `crates/cnl` | `vdm-cnl` | Click'n'Load 2 (#37): 127.0.0.1:9666 पर सुनने वाला जो एक लिंक साइट के पोस्ट को लिंक ग्रैबर के लिए पैकेज में पढ़ता है, जिसमें यह क्या लेता है इसकी सीमाएँ होती हैं। |
| `crates/extract` | `vdm-extract` | आर्काइव एक्सट्रैक्शन (#37): ज़िप, टार, gz और xz प्रक्रिया में; 7z और RAR इंस्टॉल किए गए 7-ज़िप के माध्यम से, अपने प्रोग्राम के रूप में चलाए जाते हैं; अनुरोध करने पर HatchZip के माध्यम से। आर्काइव टेस्ट (`check.rs`, #1661): `7z t`, इसके बिना प्रक्रिया में एक ज़िप, और फ़ाइल में रखी गई ज़िप की क्षतिग्रस्त प्रविष्टियाँ |
| `crates/geo` | `vdm-geo` | डाउनलोड का सर्वर कहाँ है (#140): DB-IP के लाइट डेटा (`tools/geo/build.py`) से बनी एक IP-से-देश रेंज तालिका, केवल इस कंप्यूटर पर देखी जाती है, और देशों के झंडे। |
| `crates/tools` | `vdm-tools` | Video pages through yt-dlp and ffmpeg, image galleries through gallery-dl (run as separate programs); while a network adapter is chosen, their connections go through a proxy of VDM's on 127.0.0.1 that binds them to it (`relay.rs`); each runs in a folder it can write, also its TEMP (`workdir.rs`) |
| `crates/crash` | `vdm-crash` | क्रैश और फ्रीज़ रिपोर्ट: मॉनिटर प्रक्रिया, आउट-ऑफ-प्रोसेस मिनीडंप, सिंबॉलिकेटेड स्टैक, रिपोर्ट का टेक्स्ट और रिलीज़ लॉग ([crash-reports.md](https://vdm.mikaillab.com/hi/help/crash-reports.html)) |
| `crates/torrent` | `vdm-torrent` | librqbit के माध्यम से BitTorrent और मैग्नेट लिंक |
| `crates/labserver` | `vdm-labserver` | अनुरोध लॉग और फ़ॉल्ट इंजेक्शन के साथ एक HTTP रेंज सर्वर, और परीक्षण और बेंचमार्क के लिए अपनी स्वयं की त्रुटियों के साथ एक FTP/FTPS सर्वर |
| `extension/` | — | Chromium (MV3) और Firefox एक्सटेंशन |
| `docs/` | — | उपयोगकर्ता मार्गदर्शिका और ट्यूटोरियल, यह फ़ाइल, बेंचमार्क डेटा; वेबसाइट इस मार्गदर्शिका को अपने सहायता पृष्ठ बनाती है, जिसे सहायता खोलता है |
| `website/` | — | vdm.mikaillab.com's own pages (home, download, features, themes, FAQ); `tools/website/build.py` adds the help from `docs/` and the news from the CHANGELOG, in 22 languages, and GitHub Pages publishes it |

निर्भरताएँ अंदर की ओर इंगित करती हैं: `app`, `cli`, `mcp`, `nmhost` और `remote`, `engine` और `ipc` का उपयोग करते हैं; इंजन को UI के बारे में कुछ भी नहीं पता। ऐप इंजन को केवल उसकी घटनाओं (प्रगति, सेगमेंट तालिका स्नैपशॉट, समाप्त, विफल) के माध्यम से देखता है।

## इंजन

```
Download
 ├─ probe()              size, resumable?, validators (ETag / Last-Modified), file name
 ├─ Planner (pure)       segment table: when a connection is free, the largest remaining
 │                       part is split in half (planner.rs, tested by random simulation)
 ├─ Worker × N           one HTTP/1.1 connection each, reused across segments; slow ones
 │                       are dropped and their part re-split
 │    └─ writes at its offset into <name>.vdm.part (created sparse)
 ├─ HostLimits           learns how many connections each server accepts
 ├─ Limiter (shared)     per-download and global token buckets
 ├─ State                segment table saved atomically (craft-atomic) for crash-safe resume
 └─ events → channel     Progress, Done, Failed
```

जब हर सेगमेंट पूरा हो जाता है, तो पार्ट फ़ाइल की अपेक्षित आकार के विरुद्ध जांच की जाती है और उसे सही जगह पर नाम बदला जाता है; फ़ाइल की तारीख सर्वर के अनुसार हो सकती है।

बिना आकार और बिना रेंज वाला उत्तर एक कनेक्शन पर, क्रम से (`single_stream`) लिखा जाता है, और यह कभी खत्म नहीं हो सकता (एक इंटरनेट रेडियो, एक कैमरा फ़ीड: `Snapshot::endless`)। `Download::keep` इसे वहीं खत्म कर देता है जहाँ यह है, और जो कुछ भी आया वह पूरा हो जाता है जैसे कि सर्वर ने इसे वहीं खत्म कर दिया हो (#1780); केवल प्रगति विंडो का “रोकें और रखें” इसे कॉल करता है (`App::keep_by_hand`, `Job::keep`)। हर दूसरा स्टॉप इसे रद्द कर देता है, जैसे कोई भी डाउनलोड जिसे सर्वर फिर से शुरू नहीं कर सकता।

एक पूरी हुई फ़ाइल जिसका आर्काइव टेस्ट क्षतिग्रस्त पाया गया जिसे वह रख सकता था (एक ज़िप की प्रविष्टियाँ, #1661: ऐप का `archtest.rs`) फिर से एक पार्ट फ़ाइल बन जाती है (`repair.rs`): इसकी अंतिम रेज़्यूम स्थिति, जिसे रखने के लिए कहा गया डाउनलोड द्वारा वापस सौंप दिया गया (`Options::keep_state`, `Snapshot::kept`), केवल क्षतिग्रस्त रेंज को लाने के लिए वापस लिखा जाता है, प्रत्येक ओवरलैप चेक के लिए कुछ बाइट्स पहले शुरू होता है, और फ़ाइल का नाम बदलकर उसकी पार्ट फ़ाइल कर दिया जाता है। इसे रेज़्यूम करना एक सामान्य रेज़्यूम है: `If-Range` समान वैलिडेटर, ओवरलैप चेक, डाइजेस्ट के साथ; सर्वर पर बदली गई फ़ाइल `FileChanged` के रूप में विफल हो जाती है।

A download's first request (`get`) follows redirects and the pages that lead on to a file by themselves (a waiting page's refresh). Sites whose links aren't the file's address have a module in `sites/` (Google Drive: `sites/gdrive.rs`, its shared folders' pages read there and listed by `hub.rs`; MediaFire: `sites/mediafire.rs`; Rapidgator: `sites/rapidgator.rs`; LuluStream: `sites/lulustream.rs`): it turns the link into the file's address, reads the site's own pages (a confirmation form, a download button, an error page), names its refusals (`Error::Refused`) and, where the file's addresses expire, the page that gives a fresh one (`sites::origin`, asked again when a connection meets an expired address, at most once per expiry and never again at once for an address it then refused; Rapidgator's page is the browser's tab the download came from, `Options::page`), with pure functions tested without a network. A page whose file comes only once its form is sent back (LuluStream's quality page) says so with `PageSays::Form`: `get` posts that form's fields (`application/x-www-form-urlencoded`) with its next request only and reads the answer as a page; a site that answers with its form again is posted again after a short, growing pause (`FORM_REPOST_PAUSE`), up to `MAX_FORM_POSTS`, and then refuses in the site's name (`sites::form_refused`). The lab server plays such a site on its real host names for the end-to-end tests (`labserver/src/drive.rs`, `labserver/src/mediafire.rs`, `labserver/src/rapidgator.rs`, `labserver/src/lulustream.rs`).

FTP और FTPS (`ftp.rs`) उसी प्लानर, वर्कर और स्थिति से होकर गुजरते हैं: एक सेगमेंट एक रेंज्ड `GET` के बजाय एक कंट्रोल सेशन पर `REST` + `RETR` होता है, `SIZE` और `MDTM` हेडर के लिए होते हैं, और सेशन प्रति डाउनलोड पूल किए जाते हैं और सेगमेंट के बीच पुन: उपयोग किए जाते हैं।

लिंक ग्रैबर (#1774, `folder.rs`) को दिया गया एक फ़ोल्डर उसके सबफ़ोल्डर के साथ, चौड़ाई-पहले पढ़ा जाता है: `MLSD` द्वारा एक FTP फ़ोल्डर, अन्यथा `LIST` (`ftp::Lister`, हर फ़ोल्डर के लिए एक सत्र), एक वेब सर्वर का लिस्टिंग पेज (“Index of”, उसके शीर्षक से पहचाना गया) जैसे `page_links` एक पेज पढ़ता है। एक एंट्री फ़ोल्डर में एक नाम है, जो नाम से मेल खाता है: कहीं और का लिंक (एक और होस्ट, ऊपर का फ़ोल्डर, एक क्वेरी, एक गहरा पाथ) या एक ऐसा नाम जो सादा नहीं है, वह एंट्री नहीं है, और FTP के सिंबॉलिक लिंक का पालन नहीं किया जाता है। पूछी गई गहराई (अधिकतम `MAX_DEPTH`), `MAX_FOLDERS`, `MAX_FILES` और प्रत्येक लिस्टिंग का आकार इसे सीमित करता है। ऐप प्रत्येक फ़ोल्डर की फ़ाइलों को एक पैकेज बनाता है जिसका फ़ोल्डर डाउनलोड फ़ोल्डर के तहत ट्री का होता है (`grabber.rs`); लैब सर्वर HTTP और FTP पर एंड-टू-एंड परीक्षणों के लिए बनाए गए ट्री, एक शत्रुतापूर्ण और एक विशाल (`labserver/src/tree.rs`) को परोसता है।

लिंक ग्रैबर (#1772, `hub.rs`) को दिया गया एक Hugging Face मॉडल या डेटासेट (या उसका एक फ़ोल्डर, एक संशोधन पर) और एक GitHub रिलीज़ या टैग साइटों के सार्वजनिक API के माध्यम से सूचीबद्ध होते हैं: संशोधन को पहले उसकी कमिट बनाया जाता है, फिर ट्री को पेज दर पेज पढ़ा जाता है (`Link: rel="next"`, वही API का एकमात्र), प्रत्येक एंट्री का पाथ तभी लिया जाता है जब वह पूछे गए फ़ोल्डर के अंदर सादे नामों का एक सापेक्ष पाथ हो (`hub::relative_path`: कोई `..`, निरपेक्ष पाथ, ड्राइव या डिवाइस नाम नहीं), उसके नामों से मेल खाता हो; एक फ़ाइल का पता रिपॉजिटरी, कमिट और उन नामों से बनाया जाता है, कभी भी उत्तर से नहीं लिया जाता है। प्रत्येक फ़ाइल अपना आकार और SHA-256 रखती है जिसे साइट प्रकाशित करती है (एक LFS फ़ाइल का, एक रिलीज़ एसेट का `digest`), जो डाउनलोड का चेकसम बन जाता है। ऐप एक पैकेज बनाता है जिसका फ़ोल्डर डाउनलोड फ़ोल्डर के तहत पते का पाथ होता है, प्रत्येक फ़ाइल उसके अंदर अपने स्वयं के फ़ोल्डर में होती है (`Imported::within`), अनटिक की हुई; `huggingface.co` के लिए साइट लॉगिन का पासवर्ड Hugging Face के अपने होस्ट को ही एक्सेस टोकन (`Authorization: Bearer`) के रूप में जाता है। लैब सर्वर दोनों API (`labserver/src/hub.rs`) चलाता है: पेज, एक गेटेड रिपॉजिटरी, शत्रुतापूर्ण पाथ, एक गलत डाइजेस्ट और दर सीमाएँ।

सर्वर पर एक ZIP के अंदर की फ़ाइलें (#1775, `remotezip.rs`) उसकी सामग्री तालिका से, उसके अंत में पढ़ी जाती हैं: डाउनलोड फ़ाइल जानकारी की एक नज़र (`look`: अंतिम `TAIL` बाइट्स, जो बताती हैं कि सर्वर भाग भेजता है या नहीं, और अधिकांश अभिलेखागार की तालिका रखती हैं) पूर्वावलोकन को सक्षम करती है, और ZIP पूर्वावलोकन (`zippreview.rs`) तालिका को सूचीबद्ध करता है (`list`: ZIP64 रिकॉर्ड और तालिका जहाँ वे अंत में नहीं हैं, वहाँ के लिए पूछी गई)। पार्सर बाइट्स पर शुद्ध फ़ंक्शन हैं, फ़ज़्ड (`fuzz/fuzz_targets/zip_directory.rs`): तालिका अधिकतम `MAX_DIRECTORY` बाइट्स और `MAX_ENTRIES` एंट्री, प्रत्येक नाम अधिकतम `MAX_NAME`, ZIP64 के फ़ील्ड उनके अतिरिक्त फ़ील्ड के भीतर पढ़े जाते हैं, प्रत्येक एंट्री का डेटा तालिका से पहले और हर दूसरे से अलग (ओवरलैपिंग एंट्री संग्रह को अस्वीकार करती हैं), सादे सापेक्ष पाथ नहीं होने वाले नाम छोड़ दिए जाते हैं। चुनी गई फ़ाइलें एक डाउनलोड हैं (`Item::zip`, `Job::Zip`): `Fetch` तालिका को फिर से पूछता है, फिर प्रत्येक फ़ाइल के स्थानीय हेडर और डेटा को एक रेंज अनुरोध में (`If-Range` संग्रह के वैलिडेटर के साथ), संग्रहीत और डिफ्लेट डेटा को अनपैक करता है, उसे गिनता है और तालिका के CRC-32 के खिलाफ उसकी जाँच करता है, और बाइट्स को निष्कर्षण के लेखक को सौंपता है (`vdm_extract::put_file`: वही पाथ जाँच और स्टेजिंग फ़ोल्डर जैसे हर निष्कर्षित एंट्री)। लैब सर्वर बनाए गए ZIPs (`labserver/src/zip.rs`) को परोसता है: ZIP64, एक शत्रुतापूर्ण, ओवरलैपिंग एंट्री, एक बहुत बड़ी तालिका, और उनमें से कोई भी बिना रेंज के।

## ऐप

One egui window painted to fixed pixel coordinates, plus one immediate viewport per dialog. `app.rs` holds the state (downloads, queues, settings, the list's selection) and turns menu, toolbar, key and IPC commands into actions. Each dialog is its own module and returns an `Outcome` (open, closed, done with a value). Windows-only calls are confined to `win32.rs` and their Linux and macOS counterparts to `unix.rs` (starting with the session, the browsers' host, sounds, show in folder, the crash handler); every other file is safe, portable Rust. Fonts come from the system: Windows' Fonts folder, macOS's system fonts, fontconfig on Linux (`theme.rs`). The interface language's script fonts load at start; text in another script gets its font the first time it shows: from VDM's lists of the system's fonts for each script (the first file there that has the letter; on Windows one Han list in the interface language's order, `theme::han_files`, for the fonts loaded at start, those found later and DirectWrite's alike), then, on Windows and macOS, from the system's own fallback (DirectWrite's, CoreText's, through fontique: `egui_system_font_provider`) for what the lists don't name; Linux asks fontconfig for any letter. On Windows, Latin, Greek, Cyrillic and single-codepoint CJK text is drawn by DirectWrite (`win32.rs`, through egui's glyph rasterizer hook): View → Text → Smooth in its natural mode, anti-aliased at the size asked for and placed at quarter pixels with the font's own advances; Classic (the default) in GDI-classic mode, so each letter's hinted shape and whole-pixel width come together. CJK uses the interface language's system face; combining marks, multi-codepoint clusters and missing glyphs stay with egui, as do other scripts.

### थीम

एक कंट्रोल को जिस भी रंग और आकार में खींचा जाता है, वह सक्रिय थीम (#45) से आता है। एक थीम एक हल्की और एक गहरी पैलेट, मेट्रिक्स, कंट्रोल स्टाइल और एक आइकन स्टाइल (`palette.rs`) होती है:

- **पैलेट भूमिकाएँ।** `palette.rs` प्रत्येक भूमिका को एक स्थिर कुंजी (`"button.hot"`, `"list.row"`, `"caption"`…), एक विवरण और क्लासिक लुक के हल्के और गहरे मानों के साथ घोषित करता है, जो लिखे हुए होते हैं (क्लासिक लुक व्युत्पन्न नहीं है)। साझा पेंटर (`winui.rs`, `chrome.rs`, `list.rs`, `scrollbar.rs`) उन्हें `theme::colors()` और `theme::metrics()` के माध्यम से पढ़ते हैं और उनसे प्रत्येक कंट्रोल की स्थिति तय करते हैं; कोई भी पेंटिंग कोड अपना खुद का रंग नहीं रखता है।
- **व्युत्पन्न पैलेट।** `derive.rs` कुछ बीज (पृष्ठभूमि, सतह, टेक्स्ट, एक्सेंट…) से एक पूरा पैलेट बनाता है, OKLab में हर दूसरी भूमिका को मिलाता है और WCAG कंट्रास्ट (टेक्स्ट के लिए 4.5:1, किनारों के लिए 3:1) बनाए रखता है; उच्च कंट्रास्ट हर किनारे को ऊपर से मजबूत करता है। `native.rs` सिस्टम के एक्सेंट और कंट्रास्ट (Windows की सेटिंग्स, Linux पर freedesktop पोर्टल, macOS का एक्सेंट) से नेटिव थीम को बीजता है।
- **Control styles.** `palette::Controls` names each control's shape (text boxes, check boxes, buttons, progress bars, scroll bars, the focus mark, the title bar); the style themes (Metro, Adwaita, Breeze, Luna, Aero, Aqua, Emerald) pick theirs, and on Windows VDM then draws the title bar itself (the `caption.*` roles).
- **थीम फ़ाइलें।** `themefile.rs` डेटा फ़ोल्डर के `themes` से TOML या JSON पढ़ता है (एक फ़ाइल, या `<id>/theme.toml` जिसके बगल में आइकन होते हैं)। एक फ़ाइल केवल वही नाम देती है जो वह बदलती है; बाकी उस थीम से आता है जिसे वह `inherits` करता है (एक बिल्ट-इन की आईडी या कोई अन्य फ़ाइल, डिफ़ॉल्ट रूप से क्लासिक लुक), एक श्रृंखला में जिसमें एक चक्र को अस्वीकार कर दिया जाता है। अज्ञात कुंजियाँ चेतावनियाँ होती हैं, त्रुटियाँ नहीं। बिल्ट-इन स्टाइल थीम भी ऐसी फ़ाइलें होती हैं, जो प्रोग्राम में होती हैं (`crates/app/assets/themes`)।
- **आइकन सेट।** `themeicons.rs` एक थीम के आइकन खींचता है (उनके उद्देश्य से नामित: `tb-add-url`, `cat-music`…, SVG या PNG 16, 24, 32 और 48 px पर, `-symbolic` वाले टेक्स्ट रंग में रंगे हुए) जहाँ क्लासिक लुक अपने खुद के खींचता है; एक आवश्यकता जो सेट में नहीं होती है, वह क्लासिक आइकन को रखती है।

एक विंडो अपने कंट्रोल कहाँ रखती है, वह उसका लेआउट रहता है। फ़ाइल नामों से पहले के आइकन भी (`fileicons.rs`): Windows शेल की सिस्टम इमेज लिस्ट, macOS फाइंडर की (NSWorkspace), Linux डेस्कटॉप की आइकन थीम (`xdgicons.rs`, shared-mime-info और आइकन थीम स्पेसिफिकेशन)। प्रत्येक प्रकार को प्रति पिक्सेल आकार एक बार, एक बैकग्राउंड थ्रेड पर देखा जाता है। टैंगो के आइकन (बंडल किए गए) तब तक खड़े रहते हैं जब तक सिस्टम का आइकन तैयार नहीं हो जाता, और जहाँ भी सिस्टम में कोई नहीं होता।

### ड्राइंग

The windows are drawn with OpenGL (eframe's glow) or with the system's own graphics API through eframe's wgpu, with that one backend only: Direct3D 12 on Windows (the default there), Vulkan on Linux, Metal on macOS (choices there; OpenGL stays their default until real graphics cards have tried them, #206). View → Draw with picks one, from the next start. One code path does it on every system (`crates/app/src/renderer.rs`): when the chosen one can't start, the other one is tried, so the windows always open. A watched start with the system's API leaves a marker until its first frame is drawn: a start that ends before it (a crash inside the driver), one whose first frame doesn't come within 10 seconds (VDM then starts again with OpenGL), or a graphics card lost twice in 10 minutes is remembered with its reason, which the menu shows. A way that can't start within 10 minutes of a lost card isn't remembered: its driver may still be resetting (#1974: Direct3D 12 then finds only WARP), so the next start tries it again. With OpenGL, a window eframe can't paint (its context can't be made current on it, its frame can't be shown) is skipped and painted again 100 ms later; one whose paints keep failing for seconds is a lost device too (VDM starts again; twice in 10 minutes, OpenGL is remembered as failing on Windows). wgpu-core unwraps some of the driver's results instead of calling the device-lost callback (#2128: `PendingWrites::activate` on Direct3D 12's DXGI_ERROR_DEVICE_REMOVED): the panic hook (`crash.rs`) hands such a panic, from wgpu's own code, to the same loss handling (`renderer::lost_panic`), so it starts VDM again rather than end it with a report. On Windows, a freeze or a crash whose report shows the window's or the crashed thread inside OpenGL's driver is remembered too, by the crash report's window (`crashui.rs`), from the stack's modules (#847, #1659). The fork's eframe tells VDM through its viewport hooks (`gl_paint_failed`, #1448).

देखें → इंटरफ़ेस आकार (`scale.rs`, #262) डिस्प्ले के अपने स्केल पर egui का ज़ूम फैक्टर है: हर विंडो को पॉइंट्स में लेआउट किया जाता है, इसलिए वह उतनी ही बड़ी खुलती है; स्क्रीन से बड़ी वाली स्क्रॉल करती है।

देखें → फ़ॉन्ट (`theme.rs`, #1489) अलग है: फ़ॉन्ट फ़ाइल जिसमें इंटरफ़ेस का टेक्स्ट खींचा जाता है (`interface_font` में `settings.json`; Segoe UI, सिस्टम का अपना, जब तक चुना न जाए) और `interface_text_size`, थीम के आकार का प्रतिशत जिस पर टेक्स्ट खींचा जाता है। `theme::font_size` वह एक जगह है जहाँ से आकार आते हैं, egui की टेक्स्ट शैलियों और कस्टम-ड्रॉन Win32 नियंत्रणों दोनों के लिए (`winui::tahoma`); लेआउट के अपने माप नहीं बदलते हैं, इसलिए टेक्स्ट ओवरफ़्लो हो सकता है जहाँ एक विंडो तंग है, लेकिन कुछ भी नहीं हिलता है। Windows पर DirectWrite रास्टराइज़र (`win32::classic_text`) चुनी गई फ़ाइल को भी खींचता है, और जब फ़ॉन्ट बदलता है तो ग्लिफ़ एटलस का पुनर्निर्माण किया जाता है।

### डेटा

डाउनलोड सूची और सेटिंग्स को डेटा फ़ोल्डर (`downloads.json`) में परमाणु रूप से सहेजा जाता है: Windows पर `%APPDATA%\voltdownloadmanager\`, Linux पर `~/.local/share/voltdownloadmanager`, macOS पर `~/Library/Application Support/voltdownloadmanager`, एक पोर्टेबल कॉपी के बगल में एक `data` फ़ोल्डर, या `VDM_DATA_DIR` (`vdm_ipc::data_dir`)। ब्राउज़र होस्ट कैप्चर नियमों के लिए वही फ़ाइल पढ़ता है, इसलिए विकल्प में किया गया बदलाव अगले कैप्चर किए गए डाउनलोड पर लागू होता है।

Sign-in secrets (debrid accounts, Sites Logins' and the proxy's passwords) live in the system's keychain (`secrets.rs`, #44): Windows Credential Manager (`win32.rs`), the Secret Service on Linux or the macOS keychain (`unix.rs`). The settings keep a `keychain:<service>/<scope>/<key>` reference in their place, written only once the keychain has confirmed the secret; without a keychain (or with a locked one, never unlocked for VDM) the secret stays in the settings as before.

एक डाउनलोड का सर्वर स्थान (#140) उस पते का देश है जिससे वह जुड़ा था, इस कंप्यूटर पर `vdm-geo` की तालिका में देखा गया (`countries.rs` इसे इंटरफ़ेस भाषा में नाम देता है); रिलीज़ जॉब महीने के डेटा से तालिका को फिर से बनाता है (`tools/geo/build.py --release`)।

## ब्राउज़र एकीकरण

```
page ──► extension ──native messaging──► vdm-nmhost ──ipc──► app
```

एक्सटेंशन होस्ट से पूछता है कि कौन से फ़ाइल प्रकार लेने हैं, प्रत्येक डाउनलोड की उनके खिलाफ जाँच करता है, और ऐप द्वारा स्वीकार किए जाने के बाद ही ब्राउज़र के डाउनलोड को रद्द करता है; अन्यथा ब्राउज़र इसे रखता है, और एक्सटेंशन कारण बताता है।

होस्ट को एक संदेश अधिकतम 1 MB का होता है (`vdm_ipc::MAX_MESSAGE`; होस्ट इससे अधिक को अस्वीकार करता है, और ब्राउज़र भी होस्ट को इससे अधिक का उत्तर देने की अनुमति नहीं देता है)। इसके बाद एक पृष्ठ के लिंक भागों में जाते हैं, प्रत्येक को सबसे चौड़े ब्राउज़र के रूप में मापा जाता है (`wireSize` में `background.js`) और पृष्ठ के रेफ़रर और कुकीज़ और उसके स्थान (`vdm_ipc::LinksPart`) को ले जाता है; होस्ट प्रत्येक को आते ही सौंप देता है, और ऐप उन्हें (`linkparts.rs`) तब तक रखता है जब तक कि अंतिम नहीं आ जाता, फिर पूरी सूची के साथ लिंक ग्रैबर खोलता है।

The toolbar button's popup lists VDM's newest downloads (#1496). While it is open, `background.js` keeps one native port to the host (`connectNative`: one helper process, not one per question) and asks every second `{"recent": …}`; the host asks the running app (`vdm_ipc::RecentAsk`), which answers with `vdm_ipc::api::RecentAnswer`: the newest downloads that match the search and the filter, the counts of each filter, and the system's icons for the file types the popup lacks (`fileicons.rs`, PNG `data:` addresses, each type once per size), the whole within 512 KB. The popup's buttons send `{"downloadAct": …}` (`vdm_ipc::RecentAct`): the app opens the file or its folder, puts the file on the clipboard or opens the share sheet (`fileclip.rs`, each system's own calls in `win32.rs` and `unix.rs`). Neither question starts the app. The toolbar button's count of running downloads comes from the same answers, watched while any runs. With downloads sent to another VDM, the list is its remote control's (`api/list`), cut to the same view in `background.js`.

The host serves only VDM's own extension. Its IDs are in one place, `vdm_ipc::extension` (`crates/ipc/src/extension.rs`): the unpacked copy's (`UNPACKED_ID`, from the manifest's public key), the Chrome Web Store's (`STORE_ID`, signed with the store's own key: `pack.ps1` leaves the manifest's key out of the store's copy), the Firefox add-on's (`FIREFOX_ID`) and its addons.mozilla.org page; the Edge and Opera stores' are placeholders, never served, until the extension is listed there. The host writes each browser's manifest with those IDs, and the app offers the store's copy (Add to Chrome, Add to Firefox) before the unpacked one.

## रिमोट कंट्रोल

```
phone ──HTTPS (paired token)──► vdm-remote ──ipc::Sink──► app (answer, remote_add)
```

`--headless`(`headless.rs`, #157) eframe के बिना वही `App` चलाता है: एक लूप अपने `tick` को कॉल करता है (जो `logic` हर फ्रेम पर चलाता है) एक नंगे `egui::Context` पर, कमांड चैनल द्वारा जगाया जाता है, और कभी भी अपने `ui` को नहीं; कमांड वैसे ही जोड़े जाते हैं जैसे रिमोट कंट्रोल उन्हें जोड़ता है (कोई विंडो नहीं)। `Dockerfile` और `docker/` (Compose, Unraid का टेम्पलेट) इसे एक सर्वर पर चलाते हैं ([server.md](https://vdm.mikaillab.com/hi/help/server.html))।

सर्वर ऐप के टोक्यो रनटाइम पर चलता है, प्रति स्थानीय नेटवर्क पते पर एक श्रोता। प्रत्येक अनुरोध की जाँच की जाती है (`Host`, `Origin`, टोकन), उसे `vdm_ipc::Command` के रूप में चिह्नित `remote` (एक फ़ील्ड जिसे कोई अनुरोध लाइन सेट नहीं कर सकती) में बदल दिया जाता है और कमांड लाइन के समान चैनल के माध्यम से ऐप को सौंप दिया जाता है; ऐप अपने अगले फ्रेम पर इसका जवाब देता है, जैसे वह ऑटोमेशन API का जवाब देता है। इसका पेज `crates/remote/web` में बनाया गया है और इसके टेक्स्ट ऐप के कैटलॉग (`remote.rs`) से आते हैं।

## अनुवाद

UI द्वारा दिखाए गए हर टेक्स्ट `crate::i18n` (craft-i18n कैटलॉग, `i18n/<locale>.tsv`) के माध्यम से जाते हैं। `tools/i18n/extract.py` स्रोत से `i18n/en.tsv` को फिर से बनाता है, प्रत्येक टेक्स्ट पर अनुवादकों के लिए एक नोट के साथ (यह क्या है, यह कहाँ दिखाता है, इसके प्लेसहोल्डर)। `tools/i18n/translate.py` अन्य कैटलॉग में जो कमी है उसे भरता है (`#, machine` चिह्नित पंक्तियाँ), प्रत्येक भाषा की स्टाइल गाइड (`i18n/style/`) और शब्दावली का पालन करते हुए; एक पंक्ति जिसकी किसी व्यक्ति ने समीक्षा की है, उसे कभी नहीं बदला जाता है, और CI (`reviewed_guard.py`) एक ऐसे बदलाव को विफल करता है जो एक को छोड़ देता है। वेबसाइट के अपने कैटलॉग हैं (`i18n/site/`, `tools/website/translate_site.py`)।

## चित्र

The help pages' pictures (`docs/images/help/`) come from one list, `tools/shots/shots.toml`: `tools/shots/make.py` opens each window through VDM's own `/show <window>` command line in a test instance off the screen, crops and annotates it from the window's accessibility tree, and writes lossless WebP; `make.py check` (CI) keeps the list, the pages and the files in step. The published ones are taken on GitHub's Windows runner (`docs-shots.yml`).

## योगदानकर्ता

`tools/contributors.py`GitHub के सार्वजनिक API से यह पढ़ता है कि किसने पुल रिक्वेस्ट और इश्यू खोले, और किसने टिप्पणी की (रखरखावकर्ता, Claude और बॉट को छोड़कर), उन सभी जगहों के लिए जो उन्हें धन्यवाद देती हैं: वेबसाइट का होम पेज, `/contributors.html` और समाचार पेज पर प्रत्येक रिलीज़ (`build.py`, हर बिल्ड पर), प्रत्येक रिलीज़ के नोट्स (`release.yml`, पिछली रिलीज़ के बाद से सक्रिय लोग) और README (`python tools/contributors.py readme` प्रत्येक रिलीज़ की तैयारी में: इसकी गोल तस्वीरें `art/contributors/` में कमिट की जाती हैं, क्योंकि GitHub README में किसी तस्वीर को गोल नहीं कर सकता)।

## परीक्षण और बेंचमार्क

`cargo test`इंजेक्टेड फ़ॉल्ट्स (धीमे, छोड़े गए और अस्वीकृत कनेक्शन, बिना रेंज वाले सर्वर, बदलती फ़ाइलें) के साथ `vdm-labserver` के विरुद्ध यूनिट टेस्ट और एंड-टू-एंड डाउनलोड चलाता है। `tools/bench` प्रकाशित गति तुलना चलाता है; इसका कच्चा डेटा `docs/bench/` में है।

[इस पेज को GitHub पर संपादित करें](https://github.com/mikailhossenimran/voltdownloadmanager/edit/main/docs/ARCHITECTURE.md) [इस पेज से जुड़ी समस्या की रिपोर्ट करें](https://github.com/mikailhossenimran/voltdownloadmanager/issues/new?template=website.yml&title=Website%3A%20Architecture&page=https%3A//vdm.mikaillab.com/help/ARCHITECTURE.html) [पेज का इतिहास](https://github.com/mikailhossenimran/voltdownloadmanager/commits/main/docs/ARCHITECTURE.md)

मुफ़्त, ओपन सोर्स, कोई विज्ञापन नहीं, कोई ट्रायल नहीं।

[Download Volt Download Manager](https://vdm.mikaillab.com/hi/download.html)
