Merge pull request #287 from BinaryAlley/documentation/update-architecture-diagrams

Updates the architecture diagrams and documents PlantUML rendering
This commit is contained in:
BinaryAlley authored and GitHub committed 2026-11-15 18:35:14 +02:00
commit 98515dc5e8
17 files changed
+455 -125

No files matched your search

+1
View File
@@ -34,6 +34,7 @@ For those with technical curiosities, here are some goodies to browse through:
5. [4.1 Code media library scanning diagram](./docs/technical/architecture/4.1%20code-media-library-scanning-diagram.svg)
6. [4.2 Code book reading diagram](./docs/technical/architecture/4.2%20code-book-reading-diagram.svg)
7. [4.3 Code scheduled jobs diagram](./docs/technical/architecture/4.3%20code-scheduler-diagram.svg)
- To regenerate the diagrams after editing a `.puml` file, follow the [diagram rendering instructions](./docs/technical/architecture/README.md).
- Also for Software Architects, you might want to take a look at the Architecture Decision Log, where you may find important stories from the past of Lumina's development, like [this one](./docs/technical/architecture/architecture-knowledge-management/architecture-decision-log/architecture-decision-record-0001.md), and others like it.
## Telemetry and Observability
@@ -1,4 +1,5 @@
@startuml Lumina System Context Diagram
!pragma layout elk
!include <C4/C4_Context>
LAYOUT_WITH_LEGEND()
@@ -9,10 +10,10 @@ Person(admin, "Administrator", "A person who manages the media library system")
System(lumina, "Lumina 1.1", "Allows users to organize, manage, stream and read their personal media content [detailed in '2 container-diagram.puml']")
System_Ext(metadataProvider, "Media Metadata Services", "External services that provide media information and metadata (TMDB, TVDB, GoodReads, MusicBrainz, etc)")
System_Ext(metadataProvider, "Media Metadata and Artwork Services", "External services that provide media information and artwork (MusicBrainz, Open Library, Cover Art Archive)")
Rel(user, lumina, "Views, streams and reads media content")
Rel(admin, lumina, "Manages media library and system settings")
Rel(admin, lumina, "Manages media library, plugins, themes and system settings")
Rel(lumina, metadataProvider, "Retrieves media metadata and artwork")
caption [System Context] Lumina
@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" data-diagram-type="DESCRIPTION" style="width:541px;height:841px;background:#FFFFFF;" width="541px" height="841px" viewBox="0 0 541 841" zoomAndPan="magnify" preserveAspectRatio="none" contentStyleType="text/css"><?plantuml 1.2026.7?><defs/><g font-family="sans-serif" lengthAdjust="spacing"><g class="title" data-source-line="4"><text x="68.996" y="24.533" fill="#000" font-size="14" textLength="396.758" font-weight="700">System Context diagram for Lumina Media Library Manager</text></g><!--entity user--><g class="entity" data-qualified-name="user" id="ent0001" data-source-line="178"><rect x="7" y="45.609" width="216.116" height="162.255" fill="#08427B" style="stroke:#073B6F;stroke-width:0.5;"/><image width="52" height="52" x="89.212" y="55.609" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAGWElEQVR4Xu2YC0xTVxjHdWabBXQ63eZ0W9S5GeYwM9PNmDgNIKIwJejAFzIVx5xOMep0AkWQN/ISHxVUUEEUQRGhVMrLElEBgSsw3iBwpRRKoRQuD6Fn57iwmHMp3EJDi/Gf/NLmy73n/L/ennO+746bqG8/7k2CFhjr0AKqYM4vnjs2OV0nfCLSiTBuDhGVShCRyfmE3w0BYetzm9Dd5nt8khF7On6fKqAFRsISm6DDHtdS0wT5VZVltU1AJJGBVhkFZFQXaOvoAo0t7aCqvhlkl9SRwXFPHhodvHhtuonzInyckUALDIcpxk5zf/OOcU3ILK6uF0tBb18fGEqStg6Q9U+d7BiHK5i/xccQH3O40ALKgpI5xkkMIirqGzq7X+K+h1QFKQZuV1MEetv9jfGxhwMtoCy7vaK9i2saRb19ctwrY6G/IftiUvo8S+81+PjKQgsow4+2Z/ZkFtYIu3qUfzK4CqsawG6vGI6OkeM0fB5loAUYMn7yavbMywnZQml7J+5t2IpOe5a1aGegxQDzMYYWYALLwOHd73YE2MNdTIqbGomeCyXgyNmEEHw+ZaAFmKCzypFlH8yjpO1duKcRKzwpL36aifMCfE6m0AJM+GC1Eystt4Lq7unF/YxY/OxysGzPuRh8TqbQAkyAWzWroVlG9cmHv7MpUk4JCSzZEaOb0NQ1J1hUVw+Fm1GFiAoh2OF+621C/dACTEB/OVirUUxKHGWVWfAc/Hw0bHQTgmcQ646giBpOqTOUkrLKwFLbs6ObENq2j57nUqo8VJHQrnkxPmv0t214sE6Yv9lnfeWLZnHfCGo4XCU1jWCvb+zoH6z9nI99RLbIVPeUbqYQWXrWfqNf+vSDitP03Eoh3PFwb0orv7we/Ooepbbi9H+sXG94QzOinpfDrxpQd/vXOW767I2e6m0fEKjB2+cXy35cWFPd0dmNex1SBVVCcPwCT6C79ZRmNHj9bHWJPHL7QWH184YW0M3gaYla2sGDvKpnsHWP/2KDh+a04K+z0Nr/sP0FXlrSk7Ji2LB11opaQFNrO2hpo4BESoF6cRsoq2sCj4pqivyjMgSwBbGAR8AUfJyRQAuogllmbutW2YXwDp2JJ05HPyQu3csigu8+IZwv84ktzpHEZ+buxlqGDlr4faqAFhjr0AJMQV2rtqEjC1UNk4z+Q9vQYSJL334Cfq0itAwc3u+/H31qQ2DsPTjGePxaptACTEDJfL3Zm21uf7XxYNA9yiU0mXK/mkpZsCNK4ALfhl+vCAO7YB4qodC9sPWmNjldpxbbBN35cO0JPfxaptACgzHTzE33GIdLPi6qJYXiNqlYSslbYaWA3orKIHDh9xbXNEqi0wrI48E80oIdTq7YxyldvOs0d4lNEN/QLoT8MyCWDOflknBzIJtaOrpQPYjuRZ/NcPMQSdo7CyqFooCoDHKp7Rk+7mEoaIGB+HS9q4G1WxSRXVJXil7vDtZ69/b2ARnV/WpbrhW1gqp6SV8FKaYgnfA7EDa3vfoBBqsBX8IxJDC5Z5UNnX43BA8+MnX5Afp4B/c1ELQAzjfbfE1OhqUUlpNiRq94VSk0H/wBeiL5eTlfbfb5A65RbdwfDi3wOvO3+Jg5h/KfovNEXZLL5eiJyu9mFJXNs/RaCTeNibhPRgnNWOeqfyAw7j56Mpog9HbWKzwt9XNz9zm4V0YJGR+65MDPKmvDB1an6hpbwQb7a5dhAzgX9ztoQh+buixzvZKSIJZ24GOqXVEpBPjWym8l7nnQhJbv5XgmZJao9DWvqoTqQpMjob/Dg3gq7lthQgcC4kLKYRGpqdofcFcAj5KluG+FCfnfzAhBZ4mm6uztRwAeJ+a47wETQttiKDcnDB9EkxSTXgBgicQsoWlrTywMv5/LxQfRJAmIagDX+ZuTUG4pCfT3B79NSGP1xiWUAdfQT0zXEKxodTixj68M1iKoWxH8PLBoZyCzhBBWJ2+GPC19gY+jEero6gG23jFhn6w7qYv7VpjQ7I0ey//mJCaW1mpWtdAMa8ugmIf1C6x8TbUMHVi4b4UJIXS3+q7Y6X7LA3aMgiuJT0Fkcr7auJ6cLz93J/OFXWCci952v12TjdgzcL9DJoRABeAsMzfThdYBXvBkVhvf2wR5fmnptV/b0FEH94hDC4x1aIGxzr9XBgujsWOPcQAAAABJRU5ErkJggg=="/><text x="72.82" y="123.911" fill="#FFF" font-size="16" textLength="44.453" font-weight="700">Home</text><text x="117.273" y="123.911" fill="#FFF" font-size="16" font-weight="700"> </text><text x="121.718" y="123.911" fill="#FFF" font-size="16" textLength="35.578" font-weight="700">User</text><text x="113.113" y="141.96" fill="#FFF" font-size="14"> </text><text x="17" y="159.569" fill="#FFF" font-size="14">A</text><text x="26.338" y="159.569" fill="#FFF" font-size="14"> </text><text x="30.228" y="159.569" fill="#FFF" font-size="14" textLength="42.807">person</text><text x="73.034" y="159.569" fill="#FFF" font-size="14"> </text><text x="76.924" y="159.569" fill="#FFF" font-size="14" textLength="25.683">who</text><text x="102.606" y="159.569" fill="#FFF" font-size="14"> </text><text x="106.496" y="159.569" fill="#FFF" font-size="14" textLength="36.572">wants</text><text x="143.068" y="159.569" fill="#FFF" font-size="14"> </text><text x="146.958" y="159.569" fill="#FFF" font-size="14" textLength="11.676">to</text><text x="158.634" y="159.569" fill="#FFF" font-size="14"> </text><text x="162.523" y="159.569" fill="#FFF" font-size="14" textLength="50.593">manage</text><text x="35.683" y="177.179" fill="#FFF" font-size="14" textLength="23.358">and</text><text x="59.041" y="177.179" fill="#FFF" font-size="14"> </text><text x="62.931" y="177.179" fill="#FFF" font-size="14" textLength="42.786">stream</text><text x="105.717" y="177.179" fill="#FFF" font-size="14"> </text><text x="109.606" y="177.179" fill="#FFF" font-size="14" textLength="27.234">their</text><text x="136.841" y="177.179" fill="#FFF" font-size="14"> </text><text x="140.73" y="177.179" fill="#FFF" font-size="14" textLength="53.703">personal</text><text x="64.865" y="194.788" fill="#FFF" font-size="14" textLength="38.131">media</text><text x="102.996" y="194.788" fill="#FFF"Line truncated
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" data-diagram-type="DESCRIPTION" style="width:629px;height:830px;background:#FFFFFF;" width="629px" height="830px" viewBox="0 0 629 830" zoomAndPan="magnify" preserveAspectRatio="none" contentStyleType="text/css"><?plantuml 1.2026.7?><defs/><g font-family="sans-serif" lengthAdjust="spacing"><g class="title" data-source-line="5"><text x="112.665" y="24.533" fill="#000" font-size="14" textLength="396.758" font-weight="700">System Context diagram for Lumina Media Library Manager</text></g><!--entity user--><g class="entity" data-qualified-name="user" id="ent0001" data-source-line="178"><rect x="315.271" y="50.609" width="216.116" height="162.255" fill="#08427B" style="stroke:#073B6F;stroke-width:0.5;"/><image width="52" height="52" x="397.483" y="60.609" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAGWElEQVR4Xu2YC0xTVxjHdWabBXQ63eZ0W9S5GeYwM9PNmDgNIKIwJejAFzIVx5xOMep0AkWQN/ISHxVUUEEUQRGhVMrLElEBgSsw3iBwpRRKoRQuD6Fn57iwmHMp3EJDi/Gf/NLmy73n/L/ennO+746bqG8/7k2CFhjr0AKqYM4vnjs2OV0nfCLSiTBuDhGVShCRyfmE3w0BYetzm9Dd5nt8khF7On6fKqAFRsISm6DDHtdS0wT5VZVltU1AJJGBVhkFZFQXaOvoAo0t7aCqvhlkl9SRwXFPHhodvHhtuonzInyckUALDIcpxk5zf/OOcU3ILK6uF0tBb18fGEqStg6Q9U+d7BiHK5i/xccQH3O40ALKgpI5xkkMIirqGzq7X+K+h1QFKQZuV1MEetv9jfGxhwMtoCy7vaK9i2saRb19ctwrY6G/IftiUvo8S+81+PjKQgsow4+2Z/ZkFtYIu3qUfzK4CqsawG6vGI6OkeM0fB5loAUYMn7yavbMywnZQml7J+5t2IpOe5a1aGegxQDzMYYWYALLwOHd73YE2MNdTIqbGomeCyXgyNmEEHw+ZaAFmKCzypFlH8yjpO1duKcRKzwpL36aifMCfE6m0AJM+GC1Eystt4Lq7unF/YxY/OxysGzPuRh8TqbQAkyAWzWroVlG9cmHv7MpUk4JCSzZEaOb0NQ1J1hUVw+Fm1GFiAoh2OF+621C/dACTEB/OVirUUxKHGWVWfAc/Hw0bHQTgmcQ646giBpOqTOUkrLKwFLbs6ObENq2j57nUqo8VJHQrnkxPmv0t214sE6Yv9lnfeWLZnHfCGo4XCU1jWCvb+zoH6z9nI99RLbIVPeUbqYQWXrWfqNf+vSDitP03Eoh3PFwb0orv7we/Ooepbbi9H+sXG94QzOinpfDrxpQd/vXOW767I2e6m0fEKjB2+cXy35cWFPd0dmNex1SBVVCcPwCT6C79ZRmNHj9bHWJPHL7QWH184YW0M3gaYla2sGDvKpnsHWP/2KDh+a04K+z0Nr/sP0FXlrSk7Ji2LB11opaQFNrO2hpo4BESoF6cRsoq2sCj4pqivyjMgSwBbGAR8AUfJyRQAuogllmbutW2YXwDp2JJ05HPyQu3csigu8+IZwv84ktzpHEZ+buxlqGDlr4faqAFhjr0AJMQV2rtqEjC1UNk4z+Q9vQYSJL334Cfq0itAwc3u+/H31qQ2DsPTjGePxaptACTEDJfL3Zm21uf7XxYNA9yiU0mXK/mkpZsCNK4ALfhl+vCAO7YB4qodC9sPWmNjldpxbbBN35cO0JPfxaptACgzHTzE33GIdLPi6qJYXiNqlYSslbYaWA3orKIHDh9xbXNEqi0wrI48E80oIdTq7YxyldvOs0d4lNEN/QLoT8MyCWDOflknBzIJtaOrpQPYjuRZ/NcPMQSdo7CyqFooCoDHKp7Rk+7mEoaIGB+HS9q4G1WxSRXVJXil7vDtZ69/b2ARnV/WpbrhW1gqp6SV8FKaYgnfA7EDa3vfoBBqsBX8IxJDC5Z5UNnX43BA8+MnX5Afp4B/c1ELQAzjfbfE1OhqUUlpNiRq94VSk0H/wBeiL5eTlfbfb5A65RbdwfDi3wOvO3+Jg5h/KfovNEXZLL5eiJyu9mFJXNs/RaCTeNibhPRgnNWOeqfyAw7j56Mpog9HbWKzwt9XNz9zm4V0YJGR+65MDPKmvDB1an6hpbwQb7a5dhAzgX9ztoQh+buixzvZKSIJZ24GOqXVEpBPjWym8l7nnQhJbv5XgmZJao9DWvqoTqQpMjob/Dg3gq7lthQgcC4kLKYRGpqdofcFcAj5KluG+FCfnfzAhBZ4mm6uztRwAeJ+a47wETQttiKDcnDB9EkxSTXgBgicQsoWlrTywMv5/LxQfRJAmIagDX+ZuTUG4pCfT3B79NSGP1xiWUAdfQT0zXEKxodTixj68M1iKoWxH8PLBoZyCzhBBWJ2+GPC19gY+jEero6gG23jFhn6w7qYv7VpjQ7I0ey//mJCaW1mpWtdAMa8ugmIf1C6x8TbUMHVi4b4UJIXS3+q7Y6X7LA3aMgiuJT0Fkcr7auJ6cLz93J/OFXWCci952v12TjdgzcL9DJoRABeAsMzfThdYBXvBkVhvf2wR5fmnptV/b0FEH94hDC4x1aIGxzr9XBgujsWOPcQAAAABJRU5ErkJggg=="/><text x="381.091" y="128.911" fill="#FFF" font-size="16" textLength="44.453" font-weight="700">Home</text><text x="425.544" y="128.911" fill="#FFF" font-size="16" font-weight="700"> </text><text x="429.989" y="128.911" fill="#FFF" font-size="16" textLength="35.578" font-weight="700">User</text><text x="421.384" y="146.96" fill="#FFF" font-size="14"> </text><text x="325.271" y="164.569" fill="#FFF" font-size="14">A</text><text x="334.609" y="164.569" fill="#FFF" font-size="14"> </text><text x="338.499" y="164.569" fill="#FFF" font-size="14" textLength="42.807">person</text><text x="381.305" y="164.569" fill="#FFF" font-size="14"> </text><text x="385.195" y="164.569" fill="#FFF" font-size="14" textLength="25.683">who</text><text x="410.877" y="164.569" fill="#FFF" font-size="14"> </text><text x="414.767" y="164.569" fill="#FFF" font-size="14" textLength="36.572">wants</text><text x="451.339" y="164.569" fill="#FFF" font-size="14"> </text><text x="455.229" y="164.569" fill="#FFF" font-size="14" textLength="11.676">to</text><text x="466.905" y="164.569" fill="#FFF" font-size="14"> </text><text x="470.794" y="164.569" fill="#FFF" font-size="14" textLength="50.593">manage</text><text x="343.954" y="182.179" fill="#FFF" font-size="14" textLength="23.358">and</text><text x="367.312" y="182.179" fill="#FFF" font-size="14"> </text><text x="371.202" y="182.179" fill="#FFF" font-size="14" textLength="42.786">stream</text><text x="413.988" y="182.179" fill="#FFF" font-size="14"> </text><text x="417.877" y="182.179" fill="#FFF" font-size="14" textLength="27.234">their</text><text x="445.112" y="182.179" fill="#FFF" font-size="14"> </text><text x="449.001" y="182.179" fill="#FFF" font-size="14" textLength="53.703">personal</text><text x="373.136" y="199.788" fill="#FFF" font-size="14" textLength="38.131">media</text><text x="411.267"Line truncated

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

@@ -1,4 +1,5 @@
@startuml Lumina Container Diagram
!pragma layout elk
!include <C4/C4_Container>
LAYOUT_WITH_LEGEND()
@@ -8,26 +9,26 @@ Person(user, "Home User", "A person who wants to manage and stream their persona
Person(admin, "Administrator", "A person who manages the media library system")
System_Boundary(c1, "Lumina 1.1") {
Container(webapp, "Web Application Client 2.1", "ASP.NET Core MVC", "Delivers server-rendered views with dynamic client-side functionality for media management, playback, and the scheduled jobs dashboard [detailed in '3.1 component-web-client-diagram.puml']")
Container(api, "API Server 2.2", "ASP.NET Core", "Provides media management functionality via a REST API, processes media tasks, manages metadata synchronization, serves books for reading through format plugins, and runs the scheduled jobs that maintain the system [detailed in '3.2 component-api-server-diagram.puml']")
ContainerDb(db, "Database", "SQLite", "Stores user data, media metadata, library configuration, scheduled jobs and their executions, automated jobs information, etc")
Container(webapp, "Web Application Client 2.1", "ASP.NET Core + Razor", "Delivers server-rendered views with dynamic client-side functionality for media management, playback, reading, favorites, playlists, statistics, plugins, themes, and the scheduled jobs dashboard [detailed in '3.1 component-web-client-diagram.puml']")
Container(api, "API Server 2.2", "ASP.NET Core", "Provides media library management, plugin metadata and artwork, music playback, book reading, themes, favorites, playlists, consumption statistics, and scheduled maintenance through a REST API [detailed in '3.2 component-api-server-diagram.puml']")
ContainerDb(db, "Database", "SQLite", "Stores user data, media metadata, library configuration, favorites, playlists, media consumption, plugins, themes, scheduled jobs and their executions")
Container(filestore, "Media Store", "File System", "Stores the actual media files")
Container(readCache, "Reading Cache", "File System", "Temporary directory in the API output, wiped at startup, where the reader plugins extract the contents of the books")
Container(apiStorage, "API Local Storage", "File System", "API-private directories: the reading cache, the transcoding cache, the plugin store and the theme store")
}
System_Ext(metadata, "Media Information Services", "External services like TMDB, TVDB, GoodReads, MusicBrainz, that provide media metadata")
System_Ext(metadata, "Media Metadata and Artwork Services", "External services like MusicBrainz, Open Library and Cover Art Archive, that provide media metadata and artwork")
Rel(user, webapp, "Uses", "HTTPS")
Rel(admin, webapp, "Manages media library and system settings", "HTTPS")
Rel(admin, webapp, "Manages media library, plugins, themes and system settings", "HTTPS")
Rel(webapp, api, "Makes API calls to", "JSON/HTTPS")
Rel(api, db, "Reads from and writes to", "SQL")
Rel(api, filestore, "Reads from and writes to")
Rel(api, readCache, "Reads from and writes to", "File system")
Rel(api, metadata, "Retrieves metadata from", "HTTPS")
Rel(api, apiStorage, "Reads from and writes to", "File system")
Rel(api, metadata, "Retrieves metadata and artwork from", "HTTPS")
caption [Container] Lumina 1.1
@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" data-diagram-type="DESCRIPTION" style="width:980px;height:1400px;background:#FFFFFF;" width="980px" height="1400px" viewBox="0 0 980 1400" zoomAndPan="magnify" preserveAspectRatio="none" contentStyleType="text/css"><?plantuml 1.2026.7?><defs/><g font-family="sans-serif" lengthAdjust="spacing"><g class="title" data-source-line="4"><text x="375.219" y="24.533" fill="#000" font-size="14" textLength="223.262" font-weight="700">Container diagram for Lumina 1.1</text></g><!--cluster c1--><g class="cluster" data-qualified-name="c1" id="ent0003" data-source-line="1666"><rect x="7" y="300.609" width="722" height="889" fill="none" style="stroke:#444;stroke-width:1;stroke-dasharray:7,7;"/><text x="326.211" y="319.219" fill="#444" font-size="16" textLength="83.578" font-weight="700">Lumina 1.1</text><text x="343.323" y="335.191" fill="#444" font-size="12" textLength="49.354" font-weight="700">[system]</text></g><!--entity webapp--><g class="entity" data-qualified-name="c1.webapp" id="ent0004" data-source-line="71"><rect x="339.5" y="354.609" width="252.996" height="216.219" fill="#438DD5" style="stroke:#3C7FC0;stroke-width:0.5;"/><text x="378.889" y="381.219" fill="#FFF" font-size="16" textLength="33.773" font-weight="700">Web</text><text x="412.662" y="381.219" fill="#FFF" font-size="16" font-weight="700"> </text><text x="417.107" y="381.219" fill="#FFF" font-size="16" textLength="87.109" font-weight="700">Application</text><text x="504.217" y="381.219" fill="#FFF" font-size="16" font-weight="700"> </text><text x="508.662" y="381.219" fill="#FFF" font-size="16" textLength="44.445" font-weight="700">Client</text><text x="454.877" y="401.344" fill="#FFF" font-size="16" textLength="22.242" font-weight="700">2.1</text><text x="407.319" y="417.316" fill="#FFF" font-size="12" textLength="54.68" font-style="italic">[ASP.NET</text><text x="461.999" y="417.316" fill="#FFF" font-size="12" font-style="italic"> </text><text x="465.333" y="417.316" fill="#FFF" font-size="12" textLength="26.01" font-style="italic">Core</text><text x="491.343" y="417.316" fill="#FFF" font-size="12" font-style="italic"> </text><text x="494.677" y="417.316" fill="#FFF" font-size="12" textLength="30" font-style="italic">MVC]</text><text x="464.053" y="434.486" fill="#FFF" font-size="14"> </text><text x="369.522" y="452.096" fill="#FFF" font-size="14" textLength="50.565">Delivers</text><text x="420.088" y="452.096" fill="#FFF" font-size="14"> </text><text x="423.978" y="452.096" fill="#FFF" font-size="14" textLength="99.6">server-rendered</text><text x="523.577" y="452.096" fill="#FFF" font-size="14"> </text><text x="527.467" y="452.096" fill="#FFF" font-size="14" textLength="35.007">views</text><text x="392.081" y="469.705" fill="#FFF" font-size="14" textLength="24.896">with</text><text x="416.978" y="469.705" fill="#FFF" font-size="14"> </text><text x="420.867" y="469.705" fill="#FFF" font-size="14" textLength="52.131">dynamic</text><text x="472.998" y="469.705" fill="#FFF" font-size="14"> </text><text x="476.888" y="469.705" fill="#FFF" font-size="14" textLength="63.027">client-side</text><text x="397.909" y="487.314" fill="#FFF" font-size="14" textLength="73.931">functionality</text><text x="471.839" y="487.314" fill="#FFF" font-size="14"> </text><text x="475.729" y="487.314" fill="#FFF" font-size="14" textLength="16.338">for</text><text x="492.067" y="487.314" fill="#FFF" font-size="14"> </text><text x="495.957" y="487.314" fill="#FFF" font-size="14" textLength="38.131">media</text><text x="366.378" y="504.924" fill="#FFF" font-size="14" textLength="85.606">management,</text><text x="451.984" y="504.924" fill="#FFF" font-size="14"> </text><text x="455.874" y="504.924" fill="#FFF" font-size="14" textLength="59.145">playback,</text><text x="515.019" y="504.924" fill="#FFF" font-size="14"> </text><text x="518.908" y="504.924" fill="#FFF" font-size="14" textLength="23.358">and</text><text x="542.267" y="504.924" fill="#FFF" font-size="14"> </text><text x="546.156" y="504.924" fill="#FFF" font-size="14" textLength="19.462">the</text><text x="384.271" y="522.533" fill="#FFF" font-size="14" textLength="63.827">scheduled</text><text x="448.098" y="522.533" fill="#FFF" font-size="14"> </text><text x="451.988" y="522.533" fill="#FFF" font-size="14" textLength="25.683">jobs</text><text x="477.67" y="522.533" fill="#FFF" font-size="14"> </text><text x="481.56" y="522.533" fill="#FFF" font-size="14" textLength="66.165">dashboard</text><text x="419.127" y="540.143" fill="#FFF" font-size="14" textLength="52.931">[detailed</text><text x="472.058" y="540.143" fill="#FFF" font-size="14"> </text><text x="475.948" y="540.143" fill="#FFF" font-size="14" textLength="10.896">in</text><text x="486.844" y="540.143" fill="#FFF" font-size="14"> </text><text x="490.734" y="540.143" fill="#FFF" font-size="14" textLength="22.135">'3.1</text><text x="349.5" y="557.Line truncated
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" data-diagram-type="DESCRIPTION" style="width:860px;height:1663px;background:#FFFFFF;" width="860px" height="1663px" viewBox="0 0 860 1663" zoomAndPan="magnify" preserveAspectRatio="none" contentStyleType="text/css"><?plantuml 1.2026.7?><defs/><g font-family="sans-serif" lengthAdjust="spacing"><g class="title" data-source-line="5"><text x="315.007" y="24.533" fill="#000" font-size="14" textLength="223.262" font-weight="700">Container diagram for Lumina 1.1</text></g><rect x="12" y="307.145" width="744.176" height="903.609" fill="none" style="stroke:#181818;stroke-width:1;" rx="2.5" ry="2.5"/><text x="342.299" y="325.755" fill="#444" font-size="16" textLength="83.578" font-weight="700">Lumina 1.1</text><text x="359.411" y="341.727" fill="#444" font-size="12" textLength="49.354" font-weight="700">[system]</text><!--entity webapp--><g class="entity" data-qualified-name="c1.webapp" id="ent0004" data-source-line="71"><rect x="125.526" y="357.145" width="252.996" height="251.438" fill="#438DD5" style="stroke:#3C7FC0;stroke-width:0.5;"/><text x="164.915" y="383.755" fill="#FFF" font-size="16" textLength="33.773" font-weight="700">Web</text><text x="198.688" y="383.755" fill="#FFF" font-size="16" font-weight="700"> </text><text x="203.134" y="383.755" fill="#FFF" font-size="16" textLength="87.109" font-weight="700">Application</text><text x="290.243" y="383.755" fill="#FFF" font-size="16" font-weight="700"> </text><text x="294.688" y="383.755" fill="#FFF" font-size="16" textLength="44.445" font-weight="700">Client</text><text x="240.903" y="403.88" fill="#FFF" font-size="16" textLength="22.242" font-weight="700">2.1</text><text x="185.503" y="419.852" fill="#FFF" font-size="12" textLength="54.68" font-style="italic">[ASP.NET</text><text x="240.183" y="419.852" fill="#FFF" font-size="12" font-style="italic"> </text><text x="243.517" y="419.852" fill="#FFF" font-size="12" textLength="26.01" font-style="italic">Core</text><text x="269.526" y="419.852" fill="#FFF" font-size="12" font-style="italic"> </text><text x="272.86" y="419.852" fill="#FFF" font-size="12" font-style="italic">+</text><text x="279.868" y="419.852" fill="#FFF" font-size="12" font-style="italic"> </text><text x="283.202" y="419.852" fill="#FFF" font-size="12" textLength="35.344" font-style="italic">Razor]</text><text x="250.079" y="437.022" fill="#FFF" font-size="14"> </text><text x="155.549" y="454.632" fill="#FFF" font-size="14" textLength="50.565">Delivers</text><text x="206.114" y="454.632" fill="#FFF" font-size="14"> </text><text x="210.004" y="454.632" fill="#FFF" font-size="14" textLength="99.6">server-rendered</text><text x="309.603" y="454.632" fill="#FFF" font-size="14"> </text><text x="313.493" y="454.632" fill="#FFF" font-size="14" textLength="35.007">views</text><text x="178.107" y="472.241" fill="#FFF" font-size="14" textLength="24.896">with</text><text x="203.004" y="472.241" fill="#FFF" font-size="14"> </text><text x="206.893" y="472.241" fill="#FFF" font-size="14" textLength="52.131">dynamic</text><text x="259.024" y="472.241" fill="#FFF" font-size="14"> </text><text x="262.914" y="472.241" fill="#FFF" font-size="14" textLength="63.027">client-side</text><text x="183.935" y="489.851" fill="#FFF" font-size="14" textLength="73.931">functionality</text><text x="257.866" y="489.851" fill="#FFF" font-size="14"> </text><text x="261.755" y="489.851" fill="#FFF" font-size="14" textLength="16.338">for</text><text x="278.093" y="489.851" fill="#FFF" font-size="14"> </text><text x="281.983" y="489.851" fill="#FFF" font-size="14" textLength="38.131">media</text><text x="177.704" y="507.46" fill="#FFF" font-size="14" textLength="85.606">management,</text><text x="263.31" y="507.46" fill="#FFF" font-size="14"> </text><text x="267.2" y="507.46" fill="#FFF" font-size="14" textLength="59.145">playback,</text><text x="167.597" y="525.069" fill="#FFF" font-size="14" textLength="50.593">reading,</text><text x="218.19" y="525.069" fill="#FFF" font-size="14"> </text><text x="222.079" y="525.069" fill="#FFF" font-size="14" textLength="56.8">favorites,</text><text x="278.879" y="525.069" fill="#FFF" font-size="14"> </text><text x="282.769" y="525.069" fill="#FFF" font-size="14" textLength="53.683">playlists,</text><text x="156.701" y="542.679" fill="#FFF" font-size="14" textLength="57.565">statistics,</text><text x="214.266" y="542.679" fill="#FFF" font-size="14"> </text><text x="218.156" y="542.679" fill="#FFF" font-size="14" textLength="48.255">plugins,</text><text x="266.411" y="542.679" fill="#FFF" font-size="14"> </text><text x="270.3" y="542.679" fill="#FFF" font-size="14" textLength="49.8">themes,</text><text x="320.1" y="542.679" fill="#FFF" font-size="14"> </text><text x="323.99" y="542.679" fill="#FFF" font-size="14" textLength="23.358">and</text><text x="158.621" y="560.288" fill="#FFF" font-size="14" textLength="19.462">the</text><tLine truncated

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 43 KiB

@@ -1,4 +1,5 @@
@startuml Lumina Web Application Components
!pragma layout elk
!include <C4/C4_Component>
LAYOUT_WITH_LEGEND()
@@ -7,39 +8,61 @@ title Component diagram for Lumina Web Application Client 2.1
Container_Ext(api, "API Server 2.2", "Lumina.Presentation.Api", "Provides media management functionality via JSON/HTTPS API [detailed in '3.2 component-api-server-diagram.puml']")
Container_Boundary(wb, "Web Application 2.1") {
Component(fileSystem, "File System Management", "ASP.NET MVC Controllers", "Handles file system operations including drives, directories, and files browsing")
Component(library, "Library Management", "ASP.NET MVC Controllers", "Manages media libraries and their content (books, etc); the library edit page lets the owner enable or disable the reader plugins per library")
Component(fileSystem, "File System Management", "FastEndpoints + Razor views", "Handles file system operations including drives, directories, files browsing, path operations and thumbnails")
Component(library, "Library Management", "FastEndpoints + Razor views", "Manages media libraries and their content (books, music), their scan controls and their consumption statistics")
Component(favorites, "Favorites", "FastEndpoints + Razor views", "Lists, adds and removes the favorites of the current user")
Component(playlists, "Playlists", "FastEndpoints + Razor views", "Creates and edits playlists and their ordered entries")
Component(bookReader, "Book Reading", "FastEndpoints + JavaScript", "Serves the book reader view and proxies the reading manifest, section and resource endpoints to the API")
Component(scheduler, "Scheduler", "FastEndpoints + JavaScript", "Serves the scheduled jobs dashboard, proxies the scheduled job endpoints to the API, and plots the executions of the scheduled job tasks over time")
Component(admin, "Administration", "ASP.NET MVC Controllers", "Handles system administration and configuration")
Component(users, "User Management", "ASP.NET MVC Controllers", "Handles authentication and user management")
Component(clientJs, "Client-Side Logic", "JavaScript", "Handles dynamic page updates, persistent media playback, the book reader (table of contents, page navigation, font size), and the scheduled jobs dashboard (job type filters, execution graph, live hub updates)")
Component(httpClient, "API HTTP Client", "C# TypedHttpClient", "Handles communication with the API server")
Component(musicPlayback, "Music Playback", "FastEndpoints + JavaScript", "Serves the music player views and proxies track streams and normalized segments from the API without buffering them")
Component(mediaConsumption, "Media Consumption", "FastEndpoints", "Proxies playback and reading progress, resume points and completion events to the API")
Component(scheduler, "Scheduler", "FastEndpoints + JavaScript", "Serves the scheduled jobs dashboard, proxies the scheduled job and display preference endpoints to the API, and plots the executions of the scheduled job tasks over time")
Component(admin, "Administration", "FastEndpoints + Razor views", "Manages roles, permissions, users, plugins and themes")
Component(users, "User Management", "FastEndpoints + Razor views", "Handles authentication, registration, password recovery, the profile and user settings")
Component(themes, "Theming", "Razor views + theme engine", "Renders the active theme, its layouts, navigation, audio player and file system browser, and serves theme assets")
Component(clientJs, "Client-Side Logic", "JavaScript", "Handles dynamic page updates, persistent media playback, the book reader (table of contents, page navigation, font size), favorites and playlists, media library scan progress, and the scheduled jobs dashboard (job type filters, execution graph, live hub updates)")
Component(httpClient, "API HTTP Client", "C# TypedHttpClient", "Handles buffered communication with the API server")
Component(streamingClient, "Streaming API HTTP Client", "C# TypedHttpClient", "Streams track audio and segments from the API server without buffering them")
}
Rel(fileSystem, httpClient, "Uses")
Rel(library, httpClient, "Uses")
Rel(favorites, httpClient, "Uses")
Rel(playlists, httpClient, "Uses")
Rel(bookReader, httpClient, "Uses")
Rel(musicPlayback, streamingClient, "Uses")
Rel(mediaConsumption, httpClient, "Uses")
Rel(scheduler, httpClient, "Uses")
Rel(admin, httpClient, "Uses")
Rel(users, httpClient, "Uses")
Rel(themes, httpClient, "Uses")
Rel(httpClient, api, "Makes API calls to", "JSON/HTTPS")
Rel(streamingClient, api, "Streams track audio from", "JSON/HTTPS")
Rel(clientJs, fileSystem, "Makes AJAX calls to")
Rel(clientJs, library, "Makes AJAX calls to")
Rel(clientJs, favorites, "Makes AJAX calls to")
Rel(clientJs, playlists, "Makes AJAX calls to")
Rel(clientJs, bookReader, "Makes AJAX calls to")
Rel(clientJs, musicPlayback, "Makes AJAX calls to")
Rel(clientJs, mediaConsumption, "Makes AJAX calls to")
Rel(clientJs, scheduler, "Makes AJAX calls to")
Rel(clientJs, admin, "Makes AJAX calls to")
Rel(clientJs, users, "Makes AJAX calls to")
Rel(clientJs, api, "Receives scheduled jobs and execution updates from the scheduled jobs hub", "SignalR")
Rel(clientJs, api, "Receives media library scan progress and scheduled job updates from the SignalR hubs", "SignalR")
caption [Component] Lumina - Web Application Client 2.1 (Lumina.Presentation.Web)
footer The component diagram for the Lumina Web Application Client 2.1 - created with PlantUML
@enduml
@enduml
@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" data-diagram-type="DESCRIPTION" style="width:1697px;height:1281px;background:#FFFFFF;" width="1697px" height="1281px" viewBox="0 0 1697 1281" zoomAndPan="magnify" preserveAspectRatio="none" contentStyleType="text/css"><?plantuml 1.2026.7?><defs/><g font-family="sans-serif" lengthAdjust="spacing"><g class="title" data-source-line="4"><text x="649.188" y="24.533" fill="#000" font-size="14" textLength="392.021" font-weight="700">Component diagram for Lumina Web Application Client 2.1</text></g><!--cluster wb--><g class="cluster" data-qualified-name="wb" id="ent0002" data-source-line="1666"><rect x="7" y="45.609" width="1468" height="769" fill="none" style="stroke:#444;stroke-width:1;stroke-dasharray:7,7;"/><text x="664.992" y="64.219" fill="#444" font-size="16" textLength="152.016" font-weight="700">Web Application 2.1</text><text x="709.998" y="80.191" fill="#444" font-size="12" textLength="62.004" font-weight="700">[container]</text></g><!--entity fileSystem--><g class="entity" data-qualified-name="wb.fileSystem" id="ent0003" data-source-line="78"><rect x="23" y="416.609" width="219.992" height="125.656" fill="#85BBF0" style="stroke:#78A8D8;stroke-width:0.5;"/><text x="37.41" y="443.219" fill="#000" font-size="16" textLength="27.563" font-weight="700">File</text><text x="64.973" y="443.219" fill="#000" font-size="16" font-weight="700"> </text><text x="69.418" y="443.219" fill="#000" font-size="16" textLength="56.922" font-weight="700">System</text><text x="126.34" y="443.219" fill="#000" font-size="16" font-weight="700"> </text><text x="130.785" y="443.219" fill="#000" font-size="16" textLength="97.797" font-weight="700">Management</text><text x="58.313" y="459.191" fill="#000" font-size="12" textLength="54.68" font-style="italic">[ASP.NET</text><text x="112.992" y="459.191" fill="#000" font-size="12" font-style="italic"> </text><text x="116.326" y="459.191" fill="#000" font-size="12" textLength="26.666" font-style="italic">MVC</text><text x="142.992" y="459.191" fill="#000" font-size="12" font-style="italic"> </text><text x="146.326" y="459.191" fill="#000" font-size="12" textLength="61.354" font-style="italic">Controllers]</text><text x="131.051" y="476.361" fill="#000" font-size="14"> </text><text x="37.672" y="493.971" fill="#000" font-size="14" textLength="51.365">Handles</text><text x="89.038" y="493.971" fill="#000" font-size="14"> </text><text x="92.927" y="493.971" fill="#000" font-size="14" textLength="17.896">file</text><text x="110.824" y="493.971" fill="#000" font-size="14"> </text><text x="114.713" y="493.971" fill="#000" font-size="14" textLength="44.338">system</text><text x="159.051" y="493.971" fill="#000" font-size="14"> </text><text x="162.941" y="493.971" fill="#000" font-size="14" textLength="65.379">operations</text><text x="33" y="511.58" fill="#000" font-size="14" textLength="55.262">including</text><text x="88.262" y="511.58" fill="#000" font-size="14"> </text><text x="92.151" y="511.58" fill="#000" font-size="14" textLength="41.234">drives,</text><text x="133.386" y="511.58" fill="#000" font-size="14"> </text><text x="137.275" y="511.58" fill="#000" font-size="14" textLength="68.469">directories,</text><text x="205.744" y="511.58" fill="#000" font-size="14"> </text><text x="209.634" y="511.58" fill="#000" font-size="14" textLength="23.358">and</text><text x="90.589" y="529.189" fill="#000" font-size="14" textLength="24.896">files</text><text x="115.486" y="529.189" fill="#000" font-size="14"> </text><text x="119.375" y="529.189" fill="#000" font-size="14" textLength="56.027">browsing</text></g><!--entity library--><g class="entity" data-qualified-name="wb.library" id="ent0004" data-source-line="78"><rect x="278.5" y="399.109" width="210.661" height="160.875" fill="#85BBF0" style="stroke:#78A8D8;stroke-width:0.5;"/><text x="305.588" y="425.719" fill="#000" font-size="16" textLength="54.242" font-weight="700">Library</text><text x="359.831" y="425.719" fill="#000" font-size="16" font-weight="700"> </text><text x="364.276" y="425.719" fill="#000" font-size="16" textLength="97.797" font-weight="700">Management</text><text x="309.147" y="441.691" fill="#000" font-size="12" textLength="54.68" font-style="italic">[ASP.NET</text><text x="363.827" y="441.691" fill="#000" font-size="12" font-style="italic"> </text><text x="367.161" y="441.691" fill="#000" font-size="12" textLength="26.666" font-style="italic">MVC</text><text x="393.827" y="441.691" fill="#000" font-size="12" font-style="italic"> </text><text x="397.161" y="441.691" fill="#000" font-size="12" textLength="61.354" font-style="italic">Controllers]</text><text x="381.886" y="458.861" fill="#000" font-size="14"> </text><text x="293.948" y="476.471" fill="#000" font-size="14" textLength="57.593">Manages</text><text x="351.541" y="476.471" fill="#000" font-size="14"> </text><text x="355.431" y="476.471" fill="#000" fontLine truncated
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" data-diagram-type="DESCRIPTION" style="width:2738px;height:1452px;background:#FFFFFF;" width="2738px" height="1452px" viewBox="0 0 2738 1452" zoomAndPan="magnify" preserveAspectRatio="none" contentStyleType="text/css"><?plantuml 1.2026.7?><defs/><g font-family="sans-serif" lengthAdjust="spacing"><g class="title" data-source-line="5"><text x="1169.838" y="24.533" fill="#000" font-size="14" textLength="392.021" font-weight="700">Component diagram for Lumina Web Application Client 2.1</text></g><rect x="180.346" y="50.609" width="2545.352" height="903.984" fill="none" style="stroke:#181818;stroke-width:1;" rx="2.5" ry="2.5"/><text x="1377.014" y="69.219" fill="#444" font-size="16" textLength="152.016" font-weight="700">Web Application 2.1</text><text x="1422.02" y="85.191" fill="#444" font-size="12" textLength="62.004" font-weight="700">[container]</text><!--entity fileSystem--><g class="entity" data-qualified-name="wb.fileSystem" id="ent0003" data-source-line="78"><rect x="686.181" y="525.039" width="211.172" height="143.266" fill="#85BBF0" style="stroke:#78A8D8;stroke-width:0.5;"/><text x="696.181" y="551.648" fill="#000" font-size="16" textLength="27.563" font-weight="700">File</text><text x="723.743" y="551.648" fill="#000" font-size="16" font-weight="700"> </text><text x="728.188" y="551.648" fill="#000" font-size="16" textLength="56.922" font-weight="700">System</text><text x="785.11" y="551.648" fill="#000" font-size="16" font-weight="700"> </text><text x="789.556" y="551.648" fill="#000" font-size="16" textLength="97.797" font-weight="700">Management</text><text x="710.564" y="567.621" fill="#000" font-size="12" textLength="80.045" font-style="italic">[FastEndpoints</text><text x="790.609" y="567.621" fill="#000" font-size="12" font-style="italic"> </text><text x="793.943" y="567.621" fill="#000" font-size="12" font-style="italic">+</text><text x="800.951" y="567.621" fill="#000" font-size="12" font-style="italic"> </text><text x="804.285" y="567.621" fill="#000" font-size="12" textLength="32.01" font-style="italic">Razor</text><text x="836.295" y="567.621" fill="#000" font-size="12" font-style="italic"> </text><text x="839.629" y="567.621" fill="#000" font-size="12" textLength="33.34" font-style="italic">views]</text><text x="789.822" y="584.791" fill="#000" font-size="14"> </text><text x="696.443" y="602.4" fill="#000" font-size="14" textLength="51.365">Handles</text><text x="747.808" y="602.4" fill="#000" font-size="14"> </text><text x="751.698" y="602.4" fill="#000" font-size="14" textLength="17.896">file</text><text x="769.594" y="602.4" fill="#000" font-size="14"> </text><text x="773.484" y="602.4" fill="#000" font-size="14" textLength="44.338">system</text><text x="817.822" y="602.4" fill="#000" font-size="14"> </text><text x="821.711" y="602.4" fill="#000" font-size="14" textLength="65.379">operations</text><text x="705.395" y="620.01" fill="#000" font-size="14" textLength="55.262">including</text><text x="760.656" y="620.01" fill="#000" font-size="14"> </text><text x="764.546" y="620.01" fill="#000" font-size="14" textLength="41.234">drives,</text><text x="805.78" y="620.01" fill="#000" font-size="14"> </text><text x="809.67" y="620.01" fill="#000" font-size="14" textLength="68.469">directories,</text><text x="697.212" y="637.619" fill="#000" font-size="14" textLength="24.896">files</text><text x="722.108" y="637.619" fill="#000" font-size="14"> </text><text x="725.998" y="637.619" fill="#000" font-size="14" textLength="59.917">browsing,</text><text x="785.915" y="637.619" fill="#000" font-size="14"> </text><text x="789.805" y="637.619" fill="#000" font-size="14" textLength="27.248">path</text><text x="817.053" y="637.619" fill="#000" font-size="14"> </text><text x="820.942" y="637.619" fill="#000" font-size="14" textLength="65.379">operations</text><text x="744.291" y="655.229" fill="#000" font-size="14" textLength="23.358">and</text><text x="767.649" y="655.229" fill="#000" font-size="14"> </text><text x="771.539" y="655.229" fill="#000" font-size="14" textLength="67.703">thumbnails</text></g><!--entity library--><g class="entity" data-qualified-name="wb.library" id="ent0004" data-source-line="78"><rect x="917.353" y="525.039" width="199.765" height="143.266" fill="#85BBF0" style="stroke:#78A8D8;stroke-width:0.5;"/><text x="938.993" y="551.648" fill="#000" font-size="16" textLength="54.242" font-weight="700">Library</text><text x="993.235" y="551.648" fill="#000" font-size="16" font-weight="700"> </text><text x="997.68" y="551.648" fill="#000" font-size="16" textLength="97.797" font-weight="700">Management</text><text x="936.033" y="567.621" fill="#000" font-size="12" textLength="80.045" font-style="italic">[FastEndpoints</text><text x="1016.078" y="567.621" fill="#000" font-size="12" font-style="italic"> </text><text x="1019.412" y="567.621" fill="#000" font-size="12" font-stylLine truncated

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 74 KiB

@@ -1,4 +1,5 @@
@startuml Lumina API Server Components
!pragma layout elk
!include <C4/C4_Component>
LAYOUT_WITH_LEGEND()
@@ -7,50 +8,94 @@ title Component diagram for Lumina API Server 2.2
Container_Ext(webapp, "Web Application Client 2.1", "Lumina.Presentation.Web", "Provides the user interface [detailed in '3.1 component-web-client-diagram.puml']")
Container_Boundary(api, "API Server 2.2") {
Component(endpoints, "API Endpoints", "FastEndpoints", "Provides REST API endpoints for media management and streaming")
Component(mediaManagement, "Media Library Management", "Domain Services", "Handles media libraries operations and metadata management")
Component(userManagement, "User Management", "Domain Services", "Handles user authentication and authorization")
Component(fileSystem, "File System Management", "Domain Services", "Manages file system operations and media access")
Component(backgroundServices, "Background Services 3.2.1", ".NET Worker Services", "Handles media scanning, metadata synchronization and other maintenance tasks [detailed in '4.1 code-media-library-scanning-diagram.puml']")
Component(endpoints, "API Endpoints", "FastEndpoints", "Provides REST API endpoints for libraries, media items, playback, reading, favorites, playlists, statistics, plugins, themes, scheduling, users, administration and maintenance")
Component(mediaManagement, "Media Library Management", "Application + Domain services", "Handles media libraries and their books and music, and owns the lifecycle and queueing of their scans")
Component(mediaConsumption, "Media Consumption", "Application + Domain services", "Tracks playback and reading progress, resume points and per-user consumption statistics")
Component(favorites, "Favorites", "Application + Domain services", "Tracks the favorite library items of each user")
Component(playlists, "Playlists", "Application + Domain services", "Creates playlists and orders their entries")
Component(fileSystem, "File System Management", "Application + Domain services", "Manages drives, directories, files, paths and thumbnails")
Component(userManagement, "User Management", "Application + Domain services", "Handles authentication, roles, permissions and user settings")
Component(backgroundServices, "Media Library Scanning 3.2.1", ".NET Worker Services", "Executes the queued media library scans, owns their metadata and artwork enrichment, and publishes their progress notifications [detailed in '4.1 code-media-library-scanning-diagram.puml']")
Component(bookReading, "Book Reading 3.2.2", "Application + Infrastructure services", "Resolves the reader plugin of a book, checks its per-library enablement, extracts the book into the reading cache on first access, sanitizes every section, and serves the reading manifest, sections and resources [detailed in '4.2 code-book-reading-diagram.puml']")
Component(readerPlugins, "Book Reader Plugins", "Lumina.Plugins.Epub, Lumina.Plugins.Pdf", "Decode a book format into a normalized reading document (spine, table of contents, sections, resources), loaded into the host by the plugin loader [detailed in '4.2 code-book-reading-diagram.puml']")
Component(scheduledJobs, "Scheduled Jobs 3.2.3", "Application + Infrastructure services", "Lets administrators schedule the one off or recurring execution of maintenance tasks (media library scans, temporary files cleanup); a background scheduler runs the tasks on their schedules and the scheduled jobs hub broadcasts the jobs and their executions [detailed in '4.3 code-scheduler-diagram.puml']")
Component(repositories, "Repositories", "EF Core", "Provides data access abstraction for domain entities")
Component(musicPlayback, "Music Playback", "Application + Infrastructure services", "Decides how a track is delivered, normalizes audio with ffmpeg, caches it as segments and serves the track stream and segment endpoints")
Component(plugins, "Plugin Hosting", "Plugin loader + Application services", "Loads metadata, artwork and book reader plugins, installs them, stores their settings and applies the per-library provider configurations; the hosted metadata and artwork providers call the external services")
Component(themes, "Themes", "Application + Infrastructure services", "Installs, repairs and serves theme packs and their assets")
Component(scheduledJobs, "Scheduled Jobs 3.2.3", "Application + Infrastructure services", "Lets administrators schedule the one off or recurring execution of maintenance tasks (media library scans, temporary files cleanup, theme repair, execution history cleanup, technical data cleanup), stores the display preferences of the scheduler page, and broadcasts the jobs and their executions; a background scheduler runs the tasks on their schedules [detailed in '4.3 code-scheduler-diagram.puml']")
Component(repositories, "Repositories", "EF Core + Dapper", "Provides data access for the domain entities and the consumption statistics")
}
ContainerDb(db, "Database", "SQLite", "Stores user data, media metadata, and system configuration")
ContainerDb_Ext(db, "Database", "SQLite", "Stores user data, media metadata, library configuration, favorites, playlists, media consumption, plugins, themes, scheduled jobs and their executions")
Container(readCache, "Reading Cache", "File System", "Temporary directory in the API output, wiped at startup, where the reader plugins extract the contents of the books")
Container_Ext(filestore, "Media Store", "File System", "Stores the actual media files")
System_Ext(metadataServices, "External Metadata Services", "Provides media information (TMDB, TVDB, GoodReads, MusicBrainz, etc)")
Container_Ext(readCache, "Reading Cache", "File System", "Temporary directory in the API output, wiped at startup, where the reader plugins extract the contents of the books")
Container_Ext(transcodingCache, "Transcoding Cache", "File System", "Normalized audio cache. By default a private directory under the system temporary directory, scoped to the API account; a configured relative TranscodingSettings:CacheDirectory resolves under the API base directory. It must never overlap the media root: it must neither sit inside it nor contain it.")
Container_Ext(pluginStore, "Plugin Store", "File System", "Plugin assemblies and their dependencies, installed into this directory on upload and loaded from it when the API starts")
Container_Ext(themeStore, "Theme Store", "File System", "Installed and bundled theme packs served by the API")
System_Ext(metadataServices, "Media Metadata and Artwork Services", "Provides media information and artwork (MusicBrainz, Open Library, Cover Art Archive)")
Rel(webapp, endpoints, "Makes API calls to", "JSON/HTTPS")
Rel(endpoints, mediaManagement, "Uses")
Rel(endpoints, userManagement, "Uses")
Rel(endpoints, mediaConsumption, "Uses")
Rel(endpoints, favorites, "Uses")
Rel(endpoints, playlists, "Uses")
Rel(endpoints, fileSystem, "Uses")
Rel(endpoints, userManagement, "Uses")
Rel(endpoints, bookReading, "Uses")
Rel(endpoints, musicPlayback, "Uses")
Rel(endpoints, plugins, "Uses")
Rel(endpoints, themes, "Uses")
Rel(endpoints, scheduledJobs, "Uses")
Rel(mediaManagement, repositories, "Uses")
Rel(mediaManagement, filestore, "Reads from and writes to")
Rel(mediaManagement, plugins, "Configures the metadata and artwork providers")
Rel(mediaConsumption, repositories, "Uses")
Rel(favorites, repositories, "Uses")
Rel(playlists, repositories, "Uses")
Rel(userManagement, repositories, "Uses")
Rel(fileSystem, repositories, "Uses")
Rel(backgroundServices, mediaManagement, "Uses")
Rel(scheduledJobs, repositories, "Uses")
Rel(repositories, db, "Reads from and writes to", "SQL")
Rel(mediaManagement, metadataServices, "Retrieves metadata from", "HTTPS")
Rel(bookReading, readerPlugins, "Resolves and invokes")
Rel(bookReading, repositories, "Reads the per-library reader enablement")
Rel(bookReading, readerPlugins, "Resolves and invokes")
Rel(bookReading, readCache, "Extracts into and serves from", "File system")
Rel(readerPlugins, readCache, "Extracts into", "File system")
Rel(scheduledJobs, backgroundServices, "Queues the media library scans of its ScanMediaLibraries task")
Rel(musicPlayback, repositories, "Reads the track locations")
Rel(musicPlayback, filestore, "Reads the source tracks")
Rel(musicPlayback, transcodingCache, "Reads from and writes to", "File system")
Rel(plugins, readerPlugins, "Loads and registers")
Rel(plugins, repositories, "Stores plugin settings and provider configurations")
Rel(plugins, pluginStore, "Installs into and loads plugin assemblies from", "File system")
Rel(plugins, metadataServices, "Retrieves metadata and artwork from", "HTTPS")
Rel(themes, repositories, "Reads and updates the current theme")
Rel(themes, themeStore, "Reads and writes theme packs", "File system")
Rel(backgroundServices, mediaManagement, "Prepares the scan job graph")
Rel(backgroundServices, fileSystem, "Reads and writes media files")
Rel(backgroundServices, plugins, "Uses the enabled metadata and artwork providers")
Rel(backgroundServices, repositories, "Reads and writes the scan staging data")
Rel(mediaManagement, backgroundServices, "Queues and cancels scans")
Rel(fileSystem, filestore, "Browses")
Rel(scheduledJobs, repositories, "Uses")
Rel(scheduledJobs, mediaManagement, "Queues the media library scans of its ScanMediaLibraries task")
Rel(scheduledJobs, themes, "Repairs the installed themes of its RepairThemes task")
Rel(scheduledJobs, readCache, "Empties with its CleanTemporaryFiles task", "File system")
Rel(repositories, db, "Reads from and writes to", "SQL")
caption [Component] Lumina - API Server 2.2 (Lumina.Presentation.Api)
@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" data-diagram-type="DESCRIPTION" style="width:1223px;height:2192px;background:#FFFFFF;" width="1223px" height="2192px" viewBox="0 0 1223 2192" zoomAndPan="magnify" preserveAspectRatio="none" contentStyleType="text/css"><?plantuml 1.2026.7?><defs/><g font-family="sans-serif" lengthAdjust="spacing"><g class="title" data-source-line="4"><text x="453.259" y="24.533" fill="#000" font-size="14" textLength="310.399" font-weight="700">Component diagram for Lumina API Server 2.2</text></g><!--cluster api--><g class="cluster" data-qualified-name="api" id="ent0002" data-source-line="1666"><rect x="25.19" y="269.609" width="780" height="1444.5" fill="none" style="stroke:#444;stroke-width:1;stroke-dasharray:7,7;"/><text x="361.378" y="288.219" fill="#444" font-size="16" textLength="107.625" font-weight="700">API Server 2.2</text><text x="384.188" y="304.191" fill="#444" font-size="12" textLength="62.004" font-weight="700">[container]</text></g><!--entity endpoints--><g class="entity" data-qualified-name="api.endpoints" id="ent0003" data-source-line="78"><rect x="163.69" y="323.609" width="206.758" height="125.656" fill="#85BBF0" style="stroke:#78A8D8;stroke-width:0.5;"/><text x="212.405" y="350.219" fill="#000" font-size="16" textLength="26.672" font-weight="700">API</text><text x="239.077" y="350.219" fill="#000" font-size="16" font-weight="700"> </text><text x="243.522" y="350.219" fill="#000" font-size="16" textLength="78.211" font-weight="700">Endpoints</text><text x="225.379" y="366.191" fill="#000" font-size="12" textLength="83.379" font-style="italic">[FastEndpoints]</text><text x="265.124" y="383.361" fill="#000" font-size="14"> </text><text x="173.69" y="400.971" fill="#000" font-size="14" textLength="54.469">Provides</text><text x="228.159" y="400.971" fill="#000" font-size="14"> </text><text x="232.048" y="400.971" fill="#000" font-size="14" textLength="37.338">REST</text><text x="269.386" y="400.971" fill="#000" font-size="14"> </text><text x="273.276" y="400.971" fill="#000" font-size="14" textLength="22.565">API</text><text x="295.841" y="400.971" fill="#000" font-size="14"> </text><text x="299.731" y="400.971" fill="#000" font-size="14" textLength="60.717">endpoints</text><text x="181.462" y="418.58" fill="#000" font-size="14" textLength="16.338">for</text><text x="197.8" y="418.58" fill="#000" font-size="14"> </text><text x="201.69" y="418.58" fill="#000" font-size="14" textLength="38.131">media</text><text x="239.821" y="418.58" fill="#000" font-size="14"> </text><text x="243.711" y="418.58" fill="#000" font-size="14" textLength="81.717">management</text><text x="325.427" y="418.58" fill="#000" font-size="14"> </text><text x="329.317" y="418.58" fill="#000" font-size="14" textLength="23.358">and</text><text x="236.335" y="436.189" fill="#000" font-size="14" textLength="61.469">streaming</text></g><!--entity mediaManagement--><g class="entity" data-qualified-name="api.mediaManagement" id="ent0004" data-source-line="78"><rect x="317.69" y="1340.609" width="174.889" height="145.781" fill="#85BBF0" style="stroke:#78A8D8;stroke-width:0.5;"/><text x="353.119" y="1367.219" fill="#000" font-size="16" textLength="45.344" font-weight="700">Media</text><text x="398.462" y="1367.219" fill="#000" font-size="16" font-weight="700"> </text><text x="402.908" y="1367.219" fill="#000" font-size="16" textLength="54.242" font-weight="700">Library</text><text x="356.236" y="1387.344" fill="#000" font-size="16" textLength="97.797" font-weight="700">Management</text><text x="356.452" y="1403.316" fill="#000" font-size="12" textLength="44.684" font-style="italic">[Domain</text><text x="401.135" y="1403.316" fill="#000" font-size="12" font-style="italic"> </text><text x="404.469" y="1403.316" fill="#000" font-size="12" textLength="49.348" font-style="italic">Services]</text><text x="403.19" y="1420.486" fill="#000" font-size="14"> </text><text x="331.99" y="1438.096" fill="#000" font-size="14" textLength="51.365">Handles</text><text x="383.355" y="1438.096" fill="#000" font-size="14"> </text><text x="387.245" y="1438.096" fill="#000" font-size="14" textLength="38.131">media</text><text x="425.376" y="1438.096" fill="#000" font-size="14"> </text><text x="429.265" y="1438.096" fill="#000" font-size="14" textLength="49.014">libraries</text><text x="327.69" y="1455.705" fill="#000" font-size="14" textLength="65.379">operations</text><text x="393.069" y="1455.705" fill="#000" font-size="14"> </text><text x="396.959" y="1455.705" fill="#000" font-size="14" textLength="23.358">and</text><text x="420.317" y="1455.705" fill="#000" font-size="14"> </text><text x="424.207" y="1455.705" fill="#000" font-size="14" textLength="58.372">metadata</text><text x="364.276" y="1473.314" fill="#000" font-size="14" textLength="81.717">management</text></g><!--entity userManagement--><g class="entity" data-qualified-name="api.userManagement" Line truncated
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" data-diagram-type="DESCRIPTION" style="width:3333px;height:2688px;background:#FFFFFF;" width="3333px" height="2688px" viewBox="0 0 3333 2688" zoomAndPan="magnify" preserveAspectRatio="none" contentStyleType="text/css"><?plantuml 1.2026.7?><defs/><g font-family="sans-serif" lengthAdjust="spacing"><g class="title" data-source-line="5"><text x="1508.296" y="24.533" fill="#000" font-size="14" textLength="310.399" font-weight="700">Component diagram for Lumina API Server 2.2</text></g><rect x="12" y="275.578" width="3106.893" height="1774.25" fill="none" style="stroke:#181818;stroke-width:1;" rx="2.5" ry="2.5"/><text x="1511.634" y="294.188" fill="#444" font-size="16" textLength="107.625" font-weight="700">API Server 2.2</text><text x="1534.445" y="310.16" fill="#444" font-size="12" textLength="62.004" font-weight="700">[container]</text><!--entity endpoints--><g class="entity" data-qualified-name="api.endpoints" id="ent0003" data-source-line="78"><rect x="2776.252" y="325.578" width="218.454" height="178.484" fill="#85BBF0" style="stroke:#78A8D8;stroke-width:0.5;"/><text x="2830.815" y="352.188" fill="#000" font-size="16" textLength="26.672" font-weight="700">API</text><text x="2857.487" y="352.188" fill="#000" font-size="16" font-weight="700"> </text><text x="2861.933" y="352.188" fill="#000" font-size="16" textLength="78.211" font-weight="700">Endpoints</text><text x="2843.79" y="368.16" fill="#000" font-size="12" textLength="83.379" font-style="italic">[FastEndpoints]</text><text x="2883.535" y="385.33" fill="#000" font-size="14"> </text><text x="2792.101" y="402.939" fill="#000" font-size="14" textLength="54.469">Provides</text><text x="2846.569" y="402.939" fill="#000" font-size="14"> </text><text x="2850.459" y="402.939" fill="#000" font-size="14" textLength="37.338">REST</text><text x="2887.797" y="402.939" fill="#000" font-size="14"> </text><text x="2891.687" y="402.939" fill="#000" font-size="14" textLength="22.565">API</text><text x="2914.252" y="402.939" fill="#000" font-size="14"> </text><text x="2918.142" y="402.939" fill="#000" font-size="14" textLength="60.717">endpoints</text><text x="2807.29" y="420.549" fill="#000" font-size="14" textLength="16.338">for</text><text x="2823.628" y="420.549" fill="#000" font-size="14"> </text><text x="2827.518" y="420.549" fill="#000" font-size="14" textLength="52.903">libraries,</text><text x="2880.421" y="420.549" fill="#000" font-size="14"> </text><text x="2884.311" y="420.549" fill="#000" font-size="14" textLength="38.131">media</text><text x="2922.441" y="420.549" fill="#000" font-size="14"> </text><text x="2926.331" y="420.549" fill="#000" font-size="14" textLength="37.338">items,</text><text x="2798.321" y="438.158" fill="#000" font-size="14" textLength="59.145">playback,</text><text x="2857.466" y="438.158" fill="#000" font-size="14"> </text><text x="2861.355" y="438.158" fill="#000" font-size="14" textLength="50.593">reading,</text><text x="2911.948" y="438.158" fill="#000" font-size="14"> </text><text x="2915.838" y="438.158" fill="#000" font-size="14" textLength="56.8">favorites,</text><text x="2801.838" y="455.768" fill="#000" font-size="14" textLength="53.683">playlists,</text><text x="2855.521" y="455.768" fill="#000" font-size="14"> </text><text x="2859.411" y="455.768" fill="#000" font-size="14" textLength="57.565">statistics,</text><text x="2916.976" y="455.768" fill="#000" font-size="14"> </text><text x="2920.866" y="455.768" fill="#000" font-size="14" textLength="48.255">plugins,</text><text x="2802.214" y="473.377" fill="#000" font-size="14" textLength="49.8">themes,</text><text x="2852.014" y="473.377" fill="#000" font-size="14"> </text><text x="2855.904" y="473.377" fill="#000" font-size="14" textLength="70.827">scheduling,</text><text x="2926.731" y="473.377" fill="#000" font-size="14"> </text><text x="2930.621" y="473.377" fill="#000" font-size="14" textLength="38.124">users,</text><text x="2786.252" y="490.986" fill="#000" font-size="14" textLength="87.151">administration</text><text x="2873.404" y="490.986" fill="#000" font-size="14"> </text><text x="2877.293" y="490.986" fill="#000" font-size="14" textLength="23.358">and</text><text x="2900.652" y="490.986" fill="#000" font-size="14"> </text><text x="2904.542" y="490.986" fill="#000" font-size="14" textLength="80.165">maintenance</text></g><!--entity mediaManagement--><g class="entity" data-qualified-name="api.mediaManagement" id="ent0004" data-source-line="78"><rect x="1636.311" y="1116.703" width="218.468" height="163.391" fill="#85BBF0" style="stroke:#78A8D8;stroke-width:0.5;"/><text x="1693.53" y="1143.313" fill="#000" font-size="16" textLength="45.344" font-weight="700">Media</text><text x="1738.873" y="1143.313" fill="#000" font-size="16" font-weight="700"> </text><text x="1743.319" y="1143.313" fill="#000" font-size="16" textLength="54.242" font-weight="700">LibraryLine truncated

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 141 KiB

@@ -1,8 +1,9 @@
@startuml Media Library Scanning System Code
!pragma layout elk
!include <C4/C4_Component>
LAYOUT_WITH_LEGEND()
title Code diagram for Background Services 3.2.1
title Code diagram for Media Library Scanning 3.2.1
skinparam class {
BackgroundColor White
@@ -23,6 +24,9 @@ interface IMediaLibraryScanJob {
+ ExecuteAsync<TInput>(id: Guid, input: TInput, token: CancellationToken): Task
}
interface IMediaLibraryScanDiscoveryJob {
}
abstract class MediaLibraryScanJob {
# parentsPayloadsExecuted: int
+ {abstract} ExecuteAsync<TInput>(id: Guid, input: TInput, token: CancellationToken): Task
@@ -148,16 +152,16 @@ class MediaLibraryScanJobFactory {
}
interface IMediaLibraryScannerFactory {
+ CreateLibraryScanner(libraryType: LibraryType): IMediaTypeScanner
+ CreateLibraryScanner(libraryType: LibraryType): Result<IMediaTypeScanner>
}
class MediaLibraryScannerFactory {
+ CreateLibraryScanner(libraryType: LibraryType): IMediaTypeScanner
+ CreateLibraryScanner(libraryType: LibraryType): Result<IMediaTypeScanner>
}
interface IMediaTypeScanner {
+ SupportedLibraryType: LibraryType
+ CreateScanJobsForLibrary(libraryId: LibraryId): IEnumerable<IMediaLibraryScanJob>
+ CreateScanJobsForLibrary(libraryId: LibraryId): IMediaLibraryScanDiscoveryJob
}
interface IBookLibraryTypeScanner {
@@ -169,13 +173,13 @@ interface IMusicLibraryTypeScanner {
class BookLibraryTypeScanner {
- _mediaScanJobFactory: IMediaLibraryScanJobFactory
+ SupportedLibraryType: LibraryType
+ CreateScanJobsForLibrary(libraryId: LibraryId): IEnumerable<IMediaLibraryScanJob>
+ CreateScanJobsForLibrary(libraryId: LibraryId): IMediaLibraryScanDiscoveryJob
}
class MusicLibraryTypeScanner {
- _mediaScanJobFactory: IMediaLibraryScanJobFactory
+ SupportedLibraryType: LibraryType
+ CreateScanJobsForLibrary(libraryId: LibraryId): IEnumerable<IMediaLibraryScanJob>
+ CreateScanJobsForLibrary(libraryId: LibraryId): IMediaLibraryScanDiscoveryJob
}
' ============================== MEDIA TYPE STRATEGIES ==============================
@@ -183,7 +187,8 @@ class MusicLibraryTypeScanner {
interface IMediaLibraryScanItemMaterializer {
+ SupportedLibraryType: LibraryType
+ ResetEnrichmentStateForChangedPathsAsync(unitOfWork: IUnitOfWork, libraryId: Guid, paths: IReadOnlyCollection<string>, token: CancellationToken): Task<Result<Updated>>
+ MaterializeItemsAsync(unitOfWork: IUnitOfWork, libraryId: Guid, scanId: Guid, paths: IReadOnlyList<string>, token: CancellationToken): Task<Result<Success>>
+ MaterializeItemsAsync(unitOfWork: IUnitOfWork, libraryId: Guid, scanId: Guid, paths: IReadOnlySet<string>, token: CancellationToken): Task<Result<Success>>
+ ClearStagedDataAsync(unitOfWork: IUnitOfWork, libraryId: Guid, scanId: Guid, token: CancellationToken): Task<Result<Deleted>>
+ ResetMetadataStatusForLibraryAsync(unitOfWork: IUnitOfWork, libraryId: Guid, token: CancellationToken): Task<Result<Updated>>
+ ResetArtworkStatusForLibraryAsync(unitOfWork: IUnitOfWork, libraryId: Guid, token: CancellationToken): Task<Result<Updated>>
}
@@ -263,6 +268,7 @@ class LibraryScan {
+ UserId: UserId
+ Status: LibraryScanJobStatus
+ {static} Create(libraryId: LibraryId, userId: UserId, pastScans: List<LibraryScan>): Result<LibraryScan>
+ {static} Create(id: ScanId, libraryId: LibraryId, userId: UserId, status: LibraryScanJobStatus, pastScans: List<LibraryScan>): Result<LibraryScan>
+ QueueScan(): Result<Success>
+ StartScan(): Result<Success>
+ FinishScan(): Result<Success>
@@ -276,56 +282,62 @@ note right of LibraryScan
end note
interface IMediaLibraryScanningService {
+ StartScanAsync(scan: LibraryScan, libraryType: LibraryType, token: CancellationToken): Task<Result<Success>>
+ StartScanAsync(scan: LibraryScan, libraryType: LibraryType, token: CancellationToken): Task<Result<IMediaLibraryScanDiscoveryJob>>
+ CancelScan(scan: LibraryScan): Result<Success>
}
class MediaLibraryScanningService {
- _mediaLibrariesScanQueue: IMediaLibrariesScanQueue
- _mediaLibraryScannerFactory: IMediaLibraryScannerFactory
- _mediaLibrariesScanCancellationTracker: IMediaLibrariesScanCancellationTracker
- _mediaLibrariesScanProgressTracker: IMediaLibrariesScanProgressTracker
- _domainEventPublisher: IDomainEventPublisher
+ StartScanAsync(scan: LibraryScan, libraryType: LibraryType, token: CancellationToken): Task<Result<Success>>
+ StartScanAsync(scan: LibraryScan, libraryType: LibraryType, token: CancellationToken): Task<Result<IMediaLibraryScanDiscoveryJob>>
+ CancelScan(scan: LibraryScan): Result<Success>
}
note top of MediaLibraryScanningService
Central service that starts a scan by building its job graph,
registering it in the cancellation and progress trackers and
enqueueing the root jobs, and that cancels a running scan.
Central service that resolves the scanner of the library type,
builds the scan job graph, registers the scan in the cancellation
and progress trackers, and publishes the scan started events.
It returns the file system discovery job, which is the root of
the graph and whose execution completes the entire scan.
end note
' ============================== QUEUE AND PROCESSING ==============================
interface IMediaLibrariesScanQueue {
+ Writer: ChannelWriter<IMediaLibraryScanJob>
+ Reader: ChannelReader<IMediaLibraryScanJob>
+ Writer: ChannelWriter<MediaLibraryScanCompositeId>
+ Reader: ChannelReader<MediaLibraryScanCompositeId>
}
class MediaLibrariesScanQueue {
- _channel: Channel<IMediaLibraryScanJob>
+ Writer: ChannelWriter<IMediaLibraryScanJob>
+ Reader: ChannelReader<IMediaLibraryScanJob>
- _channel: Channel<MediaLibraryScanCompositeId>
+ Writer: ChannelWriter<MediaLibraryScanCompositeId>
+ Reader: ChannelReader<MediaLibraryScanCompositeId>
}
note bottom of MediaLibrariesScanQueue
In-memory queue that receives only the root scan jobs of a
scan. Children are triggered directly by their parents, and
are never placed on this queue.
In-memory queue of scan composite ids. The scan processor
prepares and executes one scan at a time, so the scans run
consecutively, in the order in which they were queued. The
jobs of a scan are never placed on this queue.
end note
class MediaLibraryScanJobProcessorJob {
- _mediaScanQueue: IMediaLibrariesScanQueue
class MediaLibraryScanProcessorJob {
- _mediaLibrariesScanQueue: IMediaLibrariesScanQueue
- _mediaLibrariesScanCancellationTracker: IMediaLibrariesScanCancellationTracker
- _serviceScopeFactory: IServiceScopeFactory
- _logger: ILogger<MediaLibraryScanProcessorJob>
# ExecuteAsync(token: CancellationToken): Task
- ProcessScanAsync(compositeId: MediaLibraryScanCompositeId, token: CancellationToken): Task
- ReportScanFailureAsync(compositeId: MediaLibraryScanCompositeId, libraryId: LibraryId, exception: Exception, token: CancellationToken): Task
}
note top of MediaLibraryScanJobProcessorJob
Background service that launches the payload execution of the
root scan jobs that arrive on the in-memory queue, firing them
in a fire-and-forget manner without awaiting their long running
payload execution (see ADR-0001, ADR-0009).
note top of MediaLibraryScanProcessorJob
Background service that consumes the queued scan ids one at a
time, reads the pending scan, prepares its job graph through the
scanning service and executes the discovery job. A failing scan
is reported and does not stop the scans queued behind it.
end note
' ============================== TRACKERS ==============================
@@ -342,6 +354,7 @@ class MediaLibrariesScanCancellationTracker {
}
interface IMediaLibrariesScanProgressTracker {
+ InitializeQueuedScanProgress(libraryId: LibraryId, compositeKey: MediaLibraryScanCompositeId): Result<Created>
+ InitializeScanProgress(libraryId: LibraryId, compositeKey: MediaLibraryScanCompositeId, totalJobs: int): Result<Created>
+ UpdateScanProgress(libraryId: LibraryId, compositeKey: MediaLibraryScanCompositeId): Result<Updated>
+ UpdateScanJobProgress(libraryId: LibraryId, compositeKey: MediaLibraryScanCompositeId, progress: MediaLibraryScanJobProgress): Result<Updated>
@@ -382,6 +395,12 @@ class LibraryScanQueuedDomainEventHandler {
+ HandleAsync(domainEvent: LibraryScanQueuedDomainEvent, token: CancellationToken): ValueTask
}
note right of LibraryScanQueuedDomainEventHandler
Registers the scan for cancellation, reports it as queued,
and writes its composite id to the scan queue. The scan
processor prepares and executes the job graph later.
end note
class LibraryScanStartedDomainEventHandler {
+ HandleAsync(domainEvent: LibraryScanStartedDomainEvent, token: CancellationToken): ValueTask
}
@@ -410,8 +429,9 @@ class LibraryScanJobProgressChangedDomainEventHandler {
IMediaLibraryScanJob <|.. MediaLibraryScanJob : implements
IMediaLibraryScanJob <|-- IBooksFileSystemDiscoveryJob
IMediaLibraryScanJob <|-- IMusicFileSystemDiscoveryJob
IMediaLibraryScanJob <|-- IMediaLibraryScanDiscoveryJob
IMediaLibraryScanDiscoveryJob <|-- IBooksFileSystemDiscoveryJob
IMediaLibraryScanDiscoveryJob <|-- IMusicFileSystemDiscoveryJob
IMediaLibraryScanJob <|-- IMusicMetadataExtractionJob
IMediaLibraryScanJob <|-- IMediaLibraryScanDiffJob
IMediaLibraryScanJob <|-- IMediaLibraryScanHashJob
@@ -442,12 +462,12 @@ IMediaLibraryScanResultsSaveJob <|.. MediaLibraryScanResultsSaveJob : implements
' ============================== JOB TRIGGER CHAIN ==============================
BooksFileSystemDiscoveryJob ..> MediaLibraryScanDiffJob : triggers
MusicFileSystemDiscoveryJob ..> MediaLibraryScanDiffJob : triggers
BooksFileSystemDiscoveryJob ..> MediaLibraryScanDiffJob : triggers (books)
MusicFileSystemDiscoveryJob ..> MediaLibraryScanDiffJob : triggers (music)
MediaLibraryScanDiffJob ..> MediaLibraryScanHashJob : triggers
MediaLibraryScanHashJob ..> MediaLibraryScanResultsSaveJob : triggers
MediaLibraryScanHashJob ..> MusicMetadataExtractionJob : triggers
MusicMetadataExtractionJob ..> MediaLibraryScanResultsSaveJob : triggers
MediaLibraryScanHashJob ..> MediaLibraryScanResultsSaveJob : triggers (books)
MediaLibraryScanHashJob ..> MusicMetadataExtractionJob : triggers (music)
MusicMetadataExtractionJob ..> MediaLibraryScanResultsSaveJob : triggers (music)
MediaLibraryScanResultsSaveJob ..> MediaLibraryScanProviderConfigurationInvalidationJob : triggers
MediaLibraryScanProviderConfigurationInvalidationJob ..> MediaLibraryScanMetadataEnrichmentJob : triggers
MediaLibraryScanMetadataEnrichmentJob ..> MediaLibraryScanArtworkEnrichmentJob : triggers
@@ -507,7 +527,6 @@ MediaLibraryScanJobFactory ..> IMediaLibraryScanJob : creates
IMediaLibraryScanningService <|.. MediaLibraryScanningService : implements
MediaLibraryScanningService --> IMediaLibraryScannerFactory : uses
MediaLibraryScanningService --> IMediaLibrariesScanQueue : writes root jobs to
MediaLibraryScanningService --> IMediaLibrariesScanCancellationTracker : registers scan
MediaLibraryScanningService --> IMediaLibrariesScanProgressTracker : initializes progress
MediaLibraryScanningService ..> LibraryScan : starts and cancels
@@ -516,9 +535,10 @@ MediaLibraryScanningService ..> LibraryScan : starts and cancels
IMediaLibrariesScanQueue <|.. MediaLibrariesScanQueue : implements
MediaLibraryScanJobProcessorJob --> IMediaLibrariesScanQueue : reads from
MediaLibraryScanJobProcessorJob --> IMediaLibrariesScanCancellationTracker : links scan token
MediaLibraryScanJobProcessorJob ..> IMediaLibraryScanJob : triggers root job
MediaLibraryScanProcessorJob --> IMediaLibrariesScanQueue : reads queued scans from
MediaLibraryScanProcessorJob --> IMediaLibrariesScanCancellationTracker : links the scan token
MediaLibraryScanProcessorJob --> IMediaLibraryScanningService : prepares the job graph
MediaLibraryScanProcessorJob ..> IMediaLibraryScanDiscoveryJob : executes the discovery job
' ============================== TRACKER RELATIONSHIPS ==============================
@@ -534,7 +554,9 @@ DebouncedMediaLibraryScanProgressNotifier --> IMediaLibrariesScanProgressTracker
' ============================== DOMAIN EVENT RELATIONSHIPS ==============================
LibraryScanQueuedDomainEventHandler --> IMediaLibraryScanningService : starts scan
LibraryScanQueuedDomainEventHandler --> IMediaLibrariesScanQueue : writes the scan to
LibraryScanQueuedDomainEventHandler --> IMediaLibrariesScanCancellationTracker : registers the scan
LibraryScanQueuedDomainEventHandler --> IMediaLibrariesScanProgressTracker : reports the queued scan
LibraryScanCancelledDomainEventHandler --> IMediaLibraryScanningService : cancels scan
LibraryScanFinishedDomainEventHandler --> IMediaLibrariesScanCancellationTracker : removes scan
@@ -554,7 +576,7 @@ LibraryScanProgressChangedDomainEventHandler --> IMediaLibraryScanProgressNotifi
LibraryScanJobProgressChangedDomainEventHandler --> IMediaLibrariesScanProgressTracker : updates job progress
LibraryScanJobProgressChangedDomainEventHandler --> IMediaLibraryScanProgressNotifier : notifies update
caption [Code] Lumina - Background Services 3.2.1
caption [Code] Lumina - Media Library Scanning 3.2.1
footer The code diagram for the Background Services 3.2.1 - created with PlantUML
footer The code diagram for the Media Library Scanning 3.2.1 - created with PlantUML
@enduml
@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" data-diagram-type="CLASS" style="width:4278px;height:5609px;background:#FFFFFF;" width="4278px" height="5609px" viewBox="0 0 4278 5609" zoomAndPan="magnify" preserveAspectRatio="none" contentStyleType="text/css"><?plantuml 1.2026.7?><defs/><g font-family="sans-serif" lengthAdjust="spacing"><g class="title" data-source-line="4"><text x="1986.931" y="24.533" fill="#000" font-size="14" textLength="297.992" font-weight="700">Code diagram for Background Services 3.2.1</text></g><!--class IMediaLibraryScanJob--><g class="entity" data-qualified-name="IMediaLibraryScanJob" id="ent0001" data-source-line="13"><rect x="2288.5" y="2658.609" width="210.434" height="312.141" fill="#FFF" style="stroke:#000;stroke-width:0.5;" rx="2.5" ry="2.5"/><ellipse cx="2321.112" cy="2674.609" rx="11" ry="11" fill="#B4A7E5" style="stroke:#181818;stroke-width:1;"/><path d="M2322.065,2671.25 L2322.065,2677.906 L2323.784,2677.906 Q2324.393,2677.906 2324.659,2678.141 Q2324.924,2678.375 2324.924,2678.766 Q2324.924,2679.141 2324.659,2679.375 Q2324.393,2679.609 2323.784,2679.609 L2318.643,2679.609 Q2318.034,2679.609 2317.768,2679.375 Q2317.503,2679.141 2317.503,2678.75 Q2317.503,2678.375 2317.768,2678.141 Q2318.034,2677.906 2318.643,2677.906 L2320.362,2677.906 L2320.362,2671.25 L2318.643,2671.25 Q2318.034,2671.25 2317.768,2671.016 Q2317.503,2670.781 2317.503,2670.391 Q2317.503,2670.016 2317.768,2669.781 Q2318.034,2669.547 2318.643,2669.547 L2323.784,2669.547 Q2324.393,2669.547 2324.659,2669.781 Q2324.924,2670.016 2324.924,2670.391 Q2324.924,2670.781 2324.659,2671.016 Q2324.393,2671.25 2323.784,2671.25 L2322.065,2671.25 Z " fill="#000"/><text x="2339.026" y="2680.338" fill="#000" font-size="14" textLength="139.296" font-style="italic">IMediaLibraryScanJob</text><line x1="2289.5" y1="2690.609" x2="2497.934" y2="2690.609" style="stroke:#000;stroke-width:0.5;"/><g data-visibility-modifier="PUBLIC_FIELD"><ellipse cx="2299.5" cy="2704.914" rx="3" ry="3" fill="none" style="stroke:#038048;stroke-width:1;"/></g><text x="2308.5" y="2709.143" fill="#000" font-size="14" textLength="47.476">ScanId:</text><text x="2355.976" y="2709.143" fill="#000" font-size="14"> </text><text x="2359.865" y="2709.143" fill="#000" font-size="14" textLength="43.586">ScanId</text><g data-visibility-modifier="PUBLIC_FIELD"><ellipse cx="2299.5" cy="2722.523" rx="3" ry="3" fill="none" style="stroke:#038048;stroke-width:1;"/></g><text x="2308.5" y="2726.752" fill="#000" font-size="14" textLength="45.124">UserId:</text><text x="2353.624" y="2726.752" fill="#000" font-size="14"> </text><text x="2357.514" y="2726.752" fill="#000" font-size="14" textLength="41.234">UserId</text><g data-visibility-modifier="PUBLIC_FIELD"><ellipse cx="2299.5" cy="2740.133" rx="3" ry="3" fill="none" style="stroke:#038048;stroke-width:1;"/></g><text x="2308.5" y="2744.361" fill="#000" font-size="14" textLength="58.358">LibraryId:</text><text x="2366.858" y="2744.361" fill="#000" font-size="14"> </text><text x="2370.748" y="2744.361" fill="#000" font-size="14" textLength="54.469">LibraryId</text><g data-visibility-modifier="PUBLIC_FIELD"><ellipse cx="2299.5" cy="2766.547" rx="3" ry="3" fill="none" style="stroke:#038048;stroke-width:1;"/></g><text x="2308.5" y="2761.971" fill="#000" font-size="14" textLength="56.027">Children:</text><text x="2308.5" y="2779.58" fill="#000" font-size="14" textLength="177.434">List&lt;IMediaLibraryScanJob></text><g data-visibility-modifier="PUBLIC_FIELD"><ellipse cx="2299.5" cy="2801.766" rx="3" ry="3" fill="none" style="stroke:#038048;stroke-width:1;"/></g><text x="2308.5" y="2797.189" fill="#000" font-size="14" textLength="52.138">Parents:</text><text x="2308.5" y="2814.799" fill="#000" font-size="14" textLength="177.434">List&lt;IMediaLibraryScanJob></text><g data-visibility-modifier="PUBLIC_FIELD"><ellipse cx="2299.5" cy="2828.18" rx="3" ry="3" fill="none" style="stroke:#038048;stroke-width:1;"/></g><text x="2308.5" y="2832.408" fill="#000" font-size="14" textLength="43.579">Status:</text><text x="2352.079" y="2832.408" fill="#000" font-size="14"> </text><text x="2355.969" y="2832.408" fill="#000" font-size="14" textLength="136.965">LibraryScanJobStatus</text><line x1="2289.5" y1="2839.484" x2="2497.934" y2="2839.484" style="stroke:#000;stroke-width:0.5;"/><g data-visibility-modifier="PUBLIC_METHOD"><ellipse cx="2299.5" cy="2862.594" rx="3" ry="3" fill="#84BE84" style="stroke:#038048;stroke-width:1;"/></g><text x="2308.5" y="2858.018" fill="#000" font-size="14" textLength="84.048">AddChild(job:</text><text x="2308.5" y="2875.627" fill="#000" font-size="14" textLength="143.958">IMediaLibraryScanJob)</text><g data-visibility-modifier="PUBLIC_METHOD"><ellipse cx="2299.5" cy="2897.813" rx="3" ry="3" fill="#84BE84" style="stroke:#038048;stroke-width:1;"/></g><text x="2308.5" y="2893.236" fill="#000" font-size="14" textLength="93.393">AddParent(job:</text><text x="2308.5" y="Line truncated
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" data-diagram-type="CLASS" style="width:4563px;height:6440px;background:#FFFFFF;" width="4563px" height="6440px" viewBox="0 0 4563 6440" zoomAndPan="magnify" preserveAspectRatio="none" contentStyleType="text/css"><?plantuml 1.2026.7?><defs/><g font-family="sans-serif" lengthAdjust="spacing"><g class="title" data-source-line="5"><text x="2122.046" y="24.533" fill="#000" font-size="14" textLength="312.744" font-weight="700">Code diagram for Media Library Scanning 3.2.1</text></g><!--class IMediaLibraryScanJob--><g class="entity" data-qualified-name="IMediaLibraryScanJob" id="ent0001" data-source-line="14"><rect x="2721.682" y="3260" width="210.434" height="312.141" fill="#FFF" style="stroke:#000;stroke-width:0.5;" rx="2.5" ry="2.5"/><ellipse cx="2754.294" cy="3276" rx="11" ry="11" fill="#B4A7E5" style="stroke:#181818;stroke-width:1;"/><path d="M2755.247,3272.641 L2755.247,3279.297 L2756.966,3279.297 Q2757.575,3279.297 2757.841,3279.531 Q2758.107,3279.766 2758.107,3280.156 Q2758.107,3280.531 2757.841,3280.766 Q2757.575,3281 2756.966,3281 L2751.825,3281 Q2751.216,3281 2750.95,3280.766 Q2750.685,3280.531 2750.685,3280.141 Q2750.685,3279.766 2750.95,3279.531 Q2751.216,3279.297 2751.825,3279.297 L2753.544,3279.297 L2753.544,3272.641 L2751.825,3272.641 Q2751.216,3272.641 2750.95,3272.406 Q2750.685,3272.172 2750.685,3271.781 Q2750.685,3271.406 2750.95,3271.172 Q2751.216,3270.938 2751.825,3270.938 L2756.966,3270.938 Q2757.575,3270.938 2757.841,3271.172 Q2758.107,3271.406 2758.107,3271.781 Q2758.107,3272.172 2757.841,3272.406 Q2757.575,3272.641 2756.966,3272.641 L2755.247,3272.641 Z " fill="#000"/><text x="2772.208" y="3281.729" fill="#000" font-size="14" textLength="139.296" font-style="italic">IMediaLibraryScanJob</text><line x1="2722.682" y1="3292" x2="2931.116" y2="3292" style="stroke:#000;stroke-width:0.5;"/><g data-visibility-modifier="PUBLIC_FIELD"><ellipse cx="2732.682" cy="3306.305" rx="3" ry="3" fill="none" style="stroke:#038048;stroke-width:1;"/></g><text x="2741.682" y="3310.533" fill="#000" font-size="14" textLength="47.476">ScanId:</text><text x="2789.158" y="3310.533" fill="#000" font-size="14"> </text><text x="2793.047" y="3310.533" fill="#000" font-size="14" textLength="43.586">ScanId</text><g data-visibility-modifier="PUBLIC_FIELD"><ellipse cx="2732.682" cy="3323.914" rx="3" ry="3" fill="none" style="stroke:#038048;stroke-width:1;"/></g><text x="2741.682" y="3328.143" fill="#000" font-size="14" textLength="45.124">UserId:</text><text x="2786.806" y="3328.143" fill="#000" font-size="14"> </text><text x="2790.696" y="3328.143" fill="#000" font-size="14" textLength="41.234">UserId</text><g data-visibility-modifier="PUBLIC_FIELD"><ellipse cx="2732.682" cy="3341.523" rx="3" ry="3" fill="none" style="stroke:#038048;stroke-width:1;"/></g><text x="2741.682" y="3345.752" fill="#000" font-size="14" textLength="58.358">LibraryId:</text><text x="2800.04" y="3345.752" fill="#000" font-size="14"> </text><text x="2803.93" y="3345.752" fill="#000" font-size="14" textLength="54.469">LibraryId</text><g data-visibility-modifier="PUBLIC_FIELD"><ellipse cx="2732.682" cy="3367.938" rx="3" ry="3" fill="none" style="stroke:#038048;stroke-width:1;"/></g><text x="2741.682" y="3363.361" fill="#000" font-size="14" textLength="56.027">Children:</text><text x="2741.682" y="3380.971" fill="#000" font-size="14" textLength="177.434">List&lt;IMediaLibraryScanJob></text><g data-visibility-modifier="PUBLIC_FIELD"><ellipse cx="2732.682" cy="3403.156" rx="3" ry="3" fill="none" style="stroke:#038048;stroke-width:1;"/></g><text x="2741.682" y="3398.58" fill="#000" font-size="14" textLength="52.138">Parents:</text><text x="2741.682" y="3416.189" fill="#000" font-size="14" textLength="177.434">List&lt;IMediaLibraryScanJob></text><g data-visibility-modifier="PUBLIC_FIELD"><ellipse cx="2732.682" cy="3429.57" rx="3" ry="3" fill="none" style="stroke:#038048;stroke-width:1;"/></g><text x="2741.682" y="3433.799" fill="#000" font-size="14" textLength="43.579">Status:</text><text x="2785.261" y="3433.799" fill="#000" font-size="14"> </text><text x="2789.151" y="3433.799" fill="#000" font-size="14" textLength="136.965">LibraryScanJobStatus</text><line x1="2722.682" y1="3440.875" x2="2931.116" y2="3440.875" style="stroke:#000;stroke-width:0.5;"/><g data-visibility-modifier="PUBLIC_METHOD"><ellipse cx="2732.682" cy="3463.984" rx="3" ry="3" fill="#84BE84" style="stroke:#038048;stroke-width:1;"/></g><text x="2741.682" y="3459.408" fill="#000" font-size="14" textLength="84.048">AddChild(job:</text><text x="2741.682" y="3477.018" fill="#000" font-size="14" textLength="143.958">IMediaLibraryScanJob)</text><g data-visibility-modifier="PUBLIC_METHOD"><ellipse cx="2732.682" cy="3499.203" rx="3" ry="3" fill="#84BE84" style="stroke:#038048;stroke-width:1;"/></g><text x="2741.682" y="3494.627" fill="#000" font-size="14" textLength="93.393">AddParent(job:</text><teLine truncated

Before

Width:  |  Height:  |  Size: 326 KiB

After

Width:  |  Height:  |  Size: 333 KiB

@@ -1,4 +1,5 @@
@startuml Book Reading and Book Reader Plugins Code
!pragma layout elk
!include <C4/C4_Component>
LAYOUT_WITH_LEGEND()
@@ -35,8 +36,13 @@ interface IBookReaderEnablementCache {
class BookReadingService {
- _extractions: ConcurrentDictionary<ReadingCacheKey, BookExtractionEntry>
- _bookExtractionLocks: ConcurrentDictionary<ReadingCacheKey, SemaphoreSlim>
- _pluginIdsByReaderKey: IReadOnlyDictionary<ReaderKey, Guid>
- _pluginIdsByReaderKey: IReadOnlyDictionary<ReaderKey, Guid>?
- _serviceProvider: IServiceProvider
- _pluginManager: IPluginManager
- _enablementCache: IBookReaderEnablementCache
- _serviceScopeFactory: IServiceScopeFactory
- _logger: ILogger<BookReadingService>
- _readerMapSync: object
+ GetManifestAsync(...): Task<Result<ReadingManifestResponse>>
+ GetSectionAsync(...): Task<Result<ReadingSectionDto>>
+ GetResourceAsync(...): Task<Result<ReadingResourceDataDto>>
@@ -119,14 +125,19 @@ class LibraryBookReaderConfigurationRepository
class GetLibraryBookReadersQueryHandler {
- _unitOfWork: IUnitOfWork
- _authorizationService: IAuthorizationService
- _currentUserService: ICurrentUserService
- _bookReaderRegistry: IBookReaderRegistry
- _validator: IValidator<GetLibraryBookReadersQuery>
+ HandleAsync(query: GetLibraryBookReadersQuery, token: CancellationToken): Task<Result<IReadOnlyList<LibraryBookReaderResponse>>>
}
class GetLibraryTypeBookReadersQueryHandler {
- _unitOfWork: IUnitOfWork
- _currentUserService: ICurrentUserService
- _providerConfigurationStore: IMediaLibraryProviderConfigurationStore
- _bookReaderRegistry: IBookReaderRegistry
- _validator: IValidator<GetLibraryTypeBookReadersQuery>
+ HandleAsync(query: GetLibraryTypeBookReadersQuery, token: CancellationToken): Task<Result<IReadOnlyList<LibraryBookReaderResponse>>>
}
@@ -138,20 +149,28 @@ end note
class MediaLibraryProviderConfigurationStore {
- _unitOfWork: IUnitOfWork
- _pluginManager: IPluginManager
- _serviceProvider: IServiceProvider
- _enablementCache: IBookReaderEnablementCache
+ GetConfigurationsAsync(libraryId: Guid, token: CancellationToken): Task<Result<IReadOnlyList<LibraryMetadataProviderConfigurationEntity>>>
+ EnsureProviderConfigurationsAsync(libraryId: Guid, libraryType: LibraryType, token: CancellationToken): Task<Result<Success>>
+ RemoveProviderConfigurationsForLibraryAsync(libraryId: Guid, token: CancellationToken): Task<Result<Deleted>>
+ RemoveProviderConfigurationsAsync(pluginId: Guid, token: CancellationToken): Task<Result<Deleted>>
+ ConfigureProvidersAsync(libraryId: Guid, libraryType: LibraryType, metadataProviders: IReadOnlyList<LibraryProviderSelectionDto>?, artworkProviders: IReadOnlyList<LibraryProviderSelectionDto>?, bookReaders: IReadOnlyList<LibraryProviderSelectionDto>?, shouldReconcileOmittedKinds: bool, token: CancellationToken): Task<Result<Success>>
+ GetSupportedBookReaderPluginIds(libraryType: LibraryType): IReadOnlyList<Guid>
}
note right of MediaLibraryProviderConfigurationStore
Called by the add and update library commands. Applies the
chosen metadata providers, artwork providers and book readers
of a media library by upserting their configuration rows in
the same save as the library. When shouldReconcileOmittedKinds
is set, the kinds without explicit choices are reconciled with
the library type first. Book reader changes invalidate the
enablement cache of the library so that a disabled reader
stops being served immediately.
Stores the metadata provider, artwork provider and book reader
configuration of each media library. EnsureProviderConfigurationsAsync
only adds the configurations that are missing, while
ConfigureProvidersAsync reconciles them with the plugins supporting
the library type and sets the enabled state and order chosen when
the library is added or updated. Calling them when the library or
a plugin is added or removed keeps the persisted rows in sync with
the loaded plugins. Book reader changes invalidate the enablement
cache of the library so that a disabled reader stops being served
immediately.
end note
' ============================== BOOK READER PLUGINS ==============================
@@ -208,12 +227,20 @@ end note
class EpubPlugin {
+ Id: Guid
+ Name: string = EPUB Reader
+ Author: string = Lumina
+ Version: Version
+ Description: string
+ GetSettingsSchema(): IReadOnlyList<PluginSettingDescriptorDto>
+ RegisterServices(services: IServiceCollection)
}
class PdfPlugin {
+ Id: Guid
+ Name: string = PDF Reader
+ Author: string = Lumina
+ Version: Version
+ Description: string
+ GetSettingsSchema(): IReadOnlyList<PluginSettingDescriptorDto>
+ RegisterServices(services: IServiceCollection)
}
@@ -248,8 +275,8 @@ ILibraryBookReaderConfigurationRepository --> LibraryBookReaderConfigurationEnti
' ============================== BOOK READER PLUGIN RELATIONSHIPS ==============================
EpubReader <|.. IBookReader : implements
PdfReader <|.. IBookReader : implements
IBookReader <|.. EpubReader : implements
IBookReader <|.. PdfReader : implements
EpubReader ..> EpubDocumentParser : parses
PdfReader ..> PdfDocumentParser : parses and renders pages
@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" data-diagram-type="CLASS" style="width:3081px;height:2599px;background:#FFFFFF;" width="3081px" height="2599px" viewBox="0 0 3081 2599" zoomAndPan="magnify" preserveAspectRatio="none" contentStyleType="text/css"><?plantuml 1.2026.7?><defs/><g font-family="sans-serif" lengthAdjust="spacing"><g class="title" data-source-line="4"><text x="1326.081" y="24.533" fill="#000" font-size="14" textLength="422.413" font-weight="700">Code diagram for Book Reading 3.2.2 and Book Reader Plugins</text></g><!--class IBookReadingService--><g class="entity" data-qualified-name="IBookReadingService" id="ent0001" data-source-line="13"><rect x="1606" y="45.609" width="310.054" height="558.672" fill="#FFF" style="stroke:#000;stroke-width:0.5;" rx="2.5" ry="2.5"/><ellipse cx="1689.46" cy="61.609" rx="11" ry="11" fill="#B4A7E5" style="stroke:#181818;stroke-width:1;"/><path d="M1690.413,58.25 L1690.413,64.906 L1692.132,64.906 Q1692.741,64.906 1693.007,65.141 Q1693.272,65.375 1693.272,65.766 Q1693.272,66.141 1693.007,66.375 Q1692.741,66.609 1692.132,66.609 L1686.991,66.609 Q1686.382,66.609 1686.116,66.375 Q1685.851,66.141 1685.851,65.75 Q1685.851,65.375 1686.116,65.141 Q1686.382,64.906 1686.991,64.906 L1688.71,64.906 L1688.71,58.25 L1686.991,58.25 Q1686.382,58.25 1686.116,58.016 Q1685.851,57.781 1685.851,57.391 Q1685.851,57.016 1686.116,56.781 Q1686.382,56.547 1686.991,56.547 L1692.132,56.547 Q1692.741,56.547 1693.007,56.781 Q1693.272,57.016 1693.272,57.391 Q1693.272,57.781 1693.007,58.016 Q1692.741,58.25 1692.132,58.25 L1690.413,58.25 Z " fill="#000"/><text x="1709.96" y="67.338" fill="#000" font-size="14" textLength="134.634" font-style="italic">IBookReadingService</text><line x1="1607" y1="77.609" x2="1915.054" y2="77.609" style="stroke:#000;stroke-width:0.5;"/><line x1="1607" y1="85.609" x2="1915.054" y2="85.609" style="stroke:#000;stroke-width:0.5;"/><g data-visibility-modifier="PUBLIC_METHOD"><ellipse cx="1617" cy="152.742" rx="3" ry="3" fill="#84BE84" style="stroke:#038048;stroke-width:1;"/></g><text x="1626" y="104.143" fill="#000" font-size="14" textLength="164.186">GetManifestAsync(bookId:</text><text x="1626" y="121.752" fill="#000" font-size="14" textLength="33.462">Guid,</text><text x="1659.462" y="121.752" fill="#000" font-size="14"> </text><text x="1663.352" y="121.752" fill="#000" font-size="14" textLength="53.683">libraryId:</text><text x="1717.034" y="121.752" fill="#000" font-size="14"> </text><text x="1720.924" y="121.752" fill="#000" font-size="14" textLength="33.462">Guid,</text><text x="1754.386" y="121.752" fill="#000" font-size="14"> </text><text x="1758.275" y="121.752" fill="#000" font-size="14" textLength="31.138">path:</text><text x="1626" y="139.361" fill="#000" font-size="14" textLength="38.124">string,</text><text x="1664.124" y="139.361" fill="#000" font-size="14"> </text><text x="1668.014" y="139.361" fill="#000" font-size="14" textLength="73.131">libraryType:</text><text x="1741.145" y="139.361" fill="#000" font-size="14"> </text><text x="1745.034" y="139.361" fill="#000" font-size="14" textLength="77.807">LibraryType,</text><text x="1626" y="156.971" fill="#000" font-size="14" textLength="174.323">shouldRenderPdfAsImages:</text><text x="1626" y="174.58" fill="#000" font-size="14" textLength="30.358">bool,</text><text x="1656.358" y="174.58" fill="#000" font-size="14"> </text><text x="1660.248" y="174.58" fill="#000" font-size="14" textLength="38.138">token:</text><text x="1626" y="192.189" fill="#000" font-size="14" textLength="124.51">CancellationToken):</text><text x="1626" y="209.799" fill="#000" font-size="14" textLength="270.826">Task&lt;Result&lt;ReadingManifestResponse>></text><g data-visibility-modifier="PUBLIC_METHOD"><ellipse cx="1617" cy="293.617" rx="3" ry="3" fill="#84BE84" style="stroke:#038048;stroke-width:1;"/></g><text x="1626" y="227.408" fill="#000" font-size="14" textLength="157.972">GetSectionAsync(bookId:</text><text x="1783.972" y="227.408" fill="#000" font-size="14"> </text><text x="1787.861" y="227.408" fill="#000" font-size="14" textLength="33.462">Guid,</text><text x="1626" y="245.018" fill="#000" font-size="14" textLength="53.683">libraryId:</text><text x="1679.683" y="245.018" fill="#000" font-size="14"> </text><text x="1683.572" y="245.018" fill="#000" font-size="14" textLength="33.462">Guid,</text><text x="1717.034" y="245.018" fill="#000" font-size="14"> </text><text x="1720.924" y="245.018" fill="#000" font-size="14" textLength="31.138">path:</text><text x="1752.062" y="245.018" fill="#000" font-size="14"> </text><text x="1755.951" y="245.018" fill="#000" font-size="14" textLength="38.124">string,</text><text x="1626" y="262.627" fill="#000" font-size="14" textLength="73.131">libraryType:</text><text x="1699.131" y="262.627" fill="#000" font-size="14"> </text><text x="1703.021" y="262.627" fill="#000" font-size="14" textLength="77.807">LibraryType,</text><texLine truncated
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" data-diagram-type="CLASS" style="width:2574px;height:3537px;background:#FFFFFF;" width="2574px" height="3537px" viewBox="0 0 2574 3537" zoomAndPan="magnify" preserveAspectRatio="none" contentStyleType="text/css"><?plantuml 1.2026.7?><defs/><g font-family="sans-serif" lengthAdjust="spacing"><g class="title" data-source-line="5"><text x="1072.392" y="24.533" fill="#000" font-size="14" textLength="422.413" font-weight="700">Code diagram for Book Reading 3.2.2 and Book Reader Plugins</text></g><!--class IBookReadingService--><g class="entity" data-qualified-name="IBookReadingService" id="ent0001" data-source-line="14"><rect x="144.015" y="50.609" width="310.054" height="558.672" fill="#FFF" style="stroke:#000;stroke-width:0.5;" rx="2.5" ry="2.5"/><ellipse cx="227.475" cy="66.609" rx="11" ry="11" fill="#B4A7E5" style="stroke:#181818;stroke-width:1;"/><path d="M228.428,63.25 L228.428,69.906 L230.147,69.906 Q230.756,69.906 231.022,70.141 Q231.287,70.375 231.287,70.766 Q231.287,71.141 231.022,71.375 Q230.756,71.609 230.147,71.609 L225.006,71.609 Q224.397,71.609 224.131,71.375 Q223.865,71.141 223.865,70.75 Q223.865,70.375 224.131,70.141 Q224.397,69.906 225.006,69.906 L226.725,69.906 L226.725,63.25 L225.006,63.25 Q224.397,63.25 224.131,63.016 Q223.865,62.781 223.865,62.391 Q223.865,62.016 224.131,61.781 Q224.397,61.547 225.006,61.547 L230.147,61.547 Q230.756,61.547 231.022,61.781 Q231.287,62.016 231.287,62.391 Q231.287,62.781 231.022,63.016 Q230.756,63.25 230.147,63.25 L228.428,63.25 Z " fill="#000"/><text x="247.975" y="72.338" fill="#000" font-size="14" textLength="134.634" font-style="italic">IBookReadingService</text><line x1="145.015" y1="82.609" x2="453.068" y2="82.609" style="stroke:#000;stroke-width:0.5;"/><line x1="145.015" y1="90.609" x2="453.068" y2="90.609" style="stroke:#000;stroke-width:0.5;"/><g data-visibility-modifier="PUBLIC_METHOD"><ellipse cx="155.015" cy="157.742" rx="3" ry="3" fill="#84BE84" style="stroke:#038048;stroke-width:1;"/></g><text x="164.015" y="109.143" fill="#000" font-size="14" textLength="164.186">GetManifestAsync(bookId:</text><text x="164.015" y="126.752" fill="#000" font-size="14" textLength="33.462">Guid,</text><text x="197.477" y="126.752" fill="#000" font-size="14"> </text><text x="201.366" y="126.752" fill="#000" font-size="14" textLength="53.683">libraryId:</text><text x="255.049" y="126.752" fill="#000" font-size="14"> </text><text x="258.939" y="126.752" fill="#000" font-size="14" textLength="33.462">Guid,</text><text x="292.401" y="126.752" fill="#000" font-size="14"> </text><text x="296.29" y="126.752" fill="#000" font-size="14" textLength="31.138">path:</text><text x="164.015" y="144.361" fill="#000" font-size="14" textLength="38.124">string,</text><text x="202.139" y="144.361" fill="#000" font-size="14"> </text><text x="206.028" y="144.361" fill="#000" font-size="14" textLength="73.131">libraryType:</text><text x="279.159" y="144.361" fill="#000" font-size="14"> </text><text x="283.049" y="144.361" fill="#000" font-size="14" textLength="77.807">LibraryType,</text><text x="164.015" y="161.971" fill="#000" font-size="14" textLength="174.323">shouldRenderPdfAsImages:</text><text x="164.015" y="179.58" fill="#000" font-size="14" textLength="30.358">bool,</text><text x="194.373" y="179.58" fill="#000" font-size="14"> </text><text x="198.263" y="179.58" fill="#000" font-size="14" textLength="38.138">token:</text><text x="164.015" y="197.189" fill="#000" font-size="14" textLength="124.51">CancellationToken):</text><text x="164.015" y="214.799" fill="#000" font-size="14" textLength="270.826">Task&lt;Result&lt;ReadingManifestResponse>></text><g data-visibility-modifier="PUBLIC_METHOD"><ellipse cx="155.015" cy="298.617" rx="3" ry="3" fill="#84BE84" style="stroke:#038048;stroke-width:1;"/></g><text x="164.015" y="232.408" fill="#000" font-size="14" textLength="157.972">GetSectionAsync(bookId:</text><text x="321.986" y="232.408" fill="#000" font-size="14"> </text><text x="325.876" y="232.408" fill="#000" font-size="14" textLength="33.462">Guid,</text><text x="164.015" y="250.018" fill="#000" font-size="14" textLength="53.683">libraryId:</text><text x="217.697" y="250.018" fill="#000" font-size="14"> </text><text x="221.587" y="250.018" fill="#000" font-size="14" textLength="33.462">Guid,</text><text x="255.049" y="250.018" fill="#000" font-size="14"> </text><text x="258.939" y="250.018" fill="#000" font-size="14" textLength="31.138">path:</text><text x="290.076" y="250.018" fill="#000" font-size="14"> </text><text x="293.966" y="250.018" fill="#000" font-size="14" textLength="38.124">string,</text><text x="164.015" y="267.627" fill="#000" font-size="14" textLength="73.131">libraryType:</text><text x="237.146" y="267.627" fill="#000" font-size="14"> </text><text x="241.035" y="267.627" fill="#000" font-size="14" textLength="77.807">LibraryType,</text><text x="164.015" y="28Line truncated

Before

Width:  |  Height:  |  Size: 173 KiB

After

Width:  |  Height:  |  Size: 185 KiB

@@ -1,4 +1,5 @@
@startuml Scheduled Jobs Code
!pragma layout elk
!include <C4/C4_Component>
LAYOUT_WITH_LEGEND()
@@ -21,6 +22,7 @@ class ScheduledJob {
+ LastStartedOnUtc: Optional<DateTime>
+ LastCompletedOnUtc: Optional<DateTime>
+ {static} Create(name: string, taskType: ScheduledTaskType, schedule: Schedule, ownerUserId: UserId): Result<ScheduledJob>
+ {static} Create(id: ScheduledJobId, name: string, taskType: ScheduledTaskType, schedule: Schedule, ownerUserId: UserId, status: ScheduledJobStatus, lastStartedOnUtc: Optional<DateTime>, lastCompletedOnUtc: Optional<DateTime>): Result<ScheduledJob>
+ Add(): Result<Success>
+ StartCycle(): Result<Success>
+ StopCycle(): Result<Success>
@@ -56,6 +58,10 @@ class DailySchedule {
+ {static} Create(hour: int, minute: int): Result<DailySchedule>
}
class OnceAtStartupSchedule {
+ {static} Create(): Result<OnceAtStartupSchedule>
}
class ScheduledJobId {
+ Value: Guid
+ {static} CreateUnique(): ScheduledJobId
@@ -73,6 +79,7 @@ class ScheduledJobExecutionStartedDomainEvent {
}
class ScheduledJobExecutionCompletedDomainEvent {
+ RunId: Guid
+ TaskType: ScheduledTaskType
+ IsCycleRun: bool
+ CompletedOnUtc: DateTime
}
@@ -96,8 +103,9 @@ interface IScheduledJobNotifier {
interface IScheduledJobRepository {
+ GetByIdAsync(id: Guid, token: CancellationToken): Task<Result<ScheduledJobEntity?>>
+ GetAllAsync(token: CancellationToken): Task<Result<IEnumerable<ScheduledJobEntity>>>
+ GetByIdWithoutTrackingAsync(id: Guid, token: CancellationToken): Task<Result<ScheduledJobEntity?>>
+ GetActiveOrRunningAsync(token: CancellationToken): Task<Result<IEnumerable<ScheduledJobEntity>>>
+ GetAllAsync(token: CancellationToken): Task<Result<IEnumerable<ScheduledJobEntity>>>
+ InsertAsync(entity: ScheduledJobEntity, token: CancellationToken): Task<Result<Created>>
+ UpdateAsync(entity: ScheduledJobEntity, token: CancellationToken): Task<Result<Updated>>
+ DeleteByIdAsync(id: Guid, token: CancellationToken): Task<Result<Deleted>>
@@ -110,6 +118,12 @@ interface IScheduledJobExecutionRepository {
+ InsertAsync(entity: ScheduledJobExecutionEntity, token: CancellationToken): Task<Result<Created>>
+ UpdateAsync(entity: ScheduledJobExecutionEntity, token: CancellationToken): Task<Result<Updated>>
+ DeleteByScheduledJobIdAsync(scheduledJobId: Guid, token: CancellationToken): Task<Result<Success>>
+ DeleteOlderThanAsync(cutoffUtc: DateTime, token: CancellationToken): Task<Result<Success>>
}
interface ISchedulerDisplayPreferencesRepository {
+ GetByUserIdAsync(userId: Guid, token: CancellationToken): Task<Result<SchedulerDisplayPreferencesEntity?>>
+ UpsertAsync(preferences: SchedulerDisplayPreferencesEntity, token: CancellationToken): Task<Result<Updated>>
}
' ============================== APPLICATION HANDLERS ==============================
@@ -142,6 +156,14 @@ class GetScheduledJobHistoryQueryHandler {
+ HandleAsync(query: GetScheduledJobHistoryQuery, token: CancellationToken): Task<Result<IEnumerable<ScheduledJobExecutionResponse>>>
}
class UpdateSchedulerDisplayPreferencesCommandHandler {
+ HandleAsync(command: UpdateSchedulerDisplayPreferencesCommand, token: CancellationToken): Task<Result<Updated>>
}
class GetSchedulerDisplayPreferencesQueryHandler {
+ HandleAsync(query: GetSchedulerDisplayPreferencesQuery, token: CancellationToken): Task<Result<SchedulerDisplayPreferencesResponse>>
}
' ============================== DOMAIN EVENT HANDLERS ==============================
class ScheduledJobAddedDomainEventHandler {
@@ -178,8 +200,8 @@ class ScheduledJobRemovedDomainEventHandler {
note bottom of ScheduledJobExecutionStartedDomainEventHandler
Updates the scheduled job to Running, inserts the open execution
history row, and notifies the SignalR clients about the started
execution.
history row with whether its cycle was active, and notifies the
SignalR clients about the started execution.
end note
note bottom of ScheduledJobExecutionCompletedDomainEventHandler
@@ -193,28 +215,55 @@ end note
class ScheduledJobSchedulerJob {
- _serviceScopeFactory: IServiceScopeFactory
- _runtimeRegistry: IScheduledJobRuntimeRegistry
- _logger: ILogger
- _logger: ILogger<ScheduledJobSchedulerJob>
- _cycleTickerFactory: Func<TimeSpan, IScheduledJobCycleTicker>
+ StartCycleAsync(scheduledJobId: ScheduledJobId, token: CancellationToken): Task
+ StopCycleAsync(scheduledJobId: ScheduledJobId, token: CancellationToken): Task
+ RunOnceAsync(scheduledJobId: ScheduledJobId, token: CancellationToken): Task
+ ExecuteAsync(stoppingToken: CancellationToken): Task
- SynchronizeBundledThemesIfNeededAsync(token: CancellationToken): Task
- EnsureTechnicalDataCleanupScheduledJobAsync(token: CancellationToken): Task
- ResumeActiveCyclesAsync(token: CancellationToken): Task
- RunCycleWorkerAsync(scheduledJobId: ScheduledJobId, runImmediately: bool, stoppingToken: CancellationToken): Task
- RunCycleWorkerAsync(scheduledJobId: ScheduledJobId, shouldRunImmediately: bool, stoppingToken: CancellationToken): Task
- RunOnceWorkerAsync(scheduledJobId: ScheduledJobId, token: CancellationToken): Task
- RunScheduledJobAsync(scheduledJobId: ScheduledJobId, isCycleRun: bool, token: CancellationToken): Task
- ExecuteScheduledJobRunAsync(scheduledJobId: ScheduledJobId, isCycleRun: bool, token: CancellationToken): Task
- CompleteExecutionAsync(scheduledJob: ScheduledJob, unitOfWork: IUnitOfWork, domainEventPublisher: IDomainEventPublisher, isCycleRun: bool, token: CancellationToken): Task
- ReconcileInterruptedRunAsync(scheduledJobId: ScheduledJobId, token: CancellationToken): Task<ScheduledJobStatus>
- GetScheduleAsync(scheduledJobId: ScheduledJobId, token: CancellationToken): Task<Schedule?>
- CalculateDelayAsync(schedule: Schedule): Task<TimeSpan>
}
note right of ScheduledJobSchedulerJob
Background service (registered as IScheduledJobScheduler and hosted)
that resumes the active execution cycles at startup, runs each cycle
worker on its schedule through PeriodicTimer, guards each execution
against overlapping runs, and publishes the started and completed
domain events of every run through the EventualConsistencyMiddleware.
that resumes the active execution cycles at startup, synchronizes
the bundled themes when no RepairThemes job exists, seeds the
technical data cleanup job, runs each cycle worker through an
IScheduledJobCycleTicker, guards each execution against overlapping
runs, and publishes the started and completed domain events of
every run through IDomainEventPublisher.
end note
interface IScheduledJobCycleTicker {
+ Period: TimeSpan {set}
+ WaitForNextTickAsync(token: CancellationToken): ValueTask<bool>
}
class PeriodicScheduledJobCycleTicker {
- _periodicTimer: PeriodicTimer
}
note bottom of IScheduledJobCycleTicker
Cancellable periodic ticker that drives the cadence of an
execution cycle. It is separated from PeriodicTimer so that
the cycle worker can be tested with a stubbed ticker.
end note
interface IScheduledJobRuntimeRegistry {
+ TryStartCycle(scheduledJobId: ScheduledJobId, cycleCancellationTokenSource: CancellationTokenSource): bool
+ HasActiveCycle(scheduledJobId: ScheduledJobId): bool
+ StopCycle(scheduledJobId: ScheduledJobId)
+ EndCycle(scheduledJobId: ScheduledJobId, cycleCancellationTokenSource: CancellationTokenSource)
+ TryAcquireRunSlot(scheduledJobId: ScheduledJobId): bool
+ ReleaseRunSlot(scheduledJobId: ScheduledJobId)
}
@@ -240,6 +289,12 @@ class ScheduledTaskExecutorFactory {
+ CreateExecutor(taskType: ScheduledTaskType): IScheduledTaskExecutor
}
note right of ScheduledTaskExecutorFactory
Creates the executor of a scheduled job from its task type:
ScanMediaLibraries, CleanTemporaryFiles, RepairThemes,
CleanScheduledJobExecutionHistory or TechnicalDataCleanup.
end note
interface IScheduledTaskExecutor {
+ ExecutePayloadAsync(scheduledJob: ScheduledJob, token: CancellationToken): Task<Result<Success>>
}
@@ -267,6 +322,41 @@ note right of TemporaryFilesCleanupTaskExecutor
cannot be resolved safely inside the application base directory.
end note
class RepairThemesTaskExecutor {
- _themeService: IThemeService
- _unitOfWork: IUnitOfWork
- _logger: ILogger<RepairThemesTaskExecutor>
+ ExecutePayloadAsync(scheduledJob: ScheduledJob, token: CancellationToken): Task<Result<Success>>
}
note right of RepairThemesTaskExecutor
Executes the RepairThemes task: reinstalls the files of the bundled
themes whose installed files are missing, through the theme service.
end note
class CleanScheduledJobExecutionHistoryTaskExecutor {
- _dateTimeProvider: IDateTimeProvider
- _unitOfWork: IUnitOfWork
- _logger: ILogger<CleanScheduledJobExecutionHistoryTaskExecutor>
+ ExecutePayloadAsync(scheduledJob: ScheduledJob, token: CancellationToken): Task<Result<Success>>
}
note right of CleanScheduledJobExecutionHistoryTaskExecutor
Executes the CleanScheduledJobExecutionHistory task: removes the
execution history rows that are older than one month.
end note
class TechnicalDataCleanupTaskExecutor {
- _unitOfWork: IUnitOfWork
- _logger: ILogger<TechnicalDataCleanupTaskExecutor>
+ ExecutePayloadAsync(scheduledJob: ScheduledJob, token: CancellationToken): Task<Result<Success>>
}
note right of TechnicalDataCleanupTaskExecutor
Executes the TechnicalDataCleanup task: marks the media library scans
that were interrupted by a previous shutdown as failed.
end note
' ============================== INFRASTRUCTURE - NOTIFICATIONS ==============================
class ScheduledJobNotifier {
@@ -299,6 +389,7 @@ interface IScheduledJobsClient {
interface IUnitOfWork {
+ ScheduledJobRepository: IScheduledJobRepository
+ ScheduledJobExecutionRepository: IScheduledJobExecutionRepository
+ SchedulerDisplayPreferencesRepository: ISchedulerDisplayPreferencesRepository
+ SaveChangesAsync(token: CancellationToken): Task
}
@@ -306,6 +397,8 @@ class ScheduledJobRepository
class ScheduledJobExecutionRepository
class SchedulerDisplayPreferencesRepository
' ============================== STORAGE MODEL ==============================
class ScheduledJobEntity {
@@ -329,6 +422,15 @@ class ScheduledJobExecutionEntity {
+ IsCycleRun: bool
+ StartedOnUtc: DateTime
+ CompletedOnUtc: DateTime?
+ WasCycleActive: bool
}
class SchedulerDisplayPreferencesEntity {
+ Id: Guid
+ UserId: Guid
+ JobTypeFilter: ScheduledTaskType?
+ DisplayTimeSpan: int
+ DisplayTimeUnit: SchedulerDisplayTimeUnit
}
note bottom of ScheduledJobEntity
@@ -340,12 +442,21 @@ end note
note bottom of ScheduledJobExecutionEntity
Stored in the ScheduledJobExecutions table, indexed by the started
time and the scheduled job id for fast history queries and cleanup.
WasCycleActive records whether the execution belonged to an active
cycle, so an interrupted cycle is resumed after a restart.
end note
note bottom of SchedulerDisplayPreferencesEntity
Stored in the SchedulerDisplayPreferences table, one row per user,
and used by the scheduler page for its job type filter and its
display time span and unit.
end note
' ============================== AGGREGATE AND VALUE OBJECT RELATIONSHIPS ==============================
Schedule <|-- IntervalSchedule : inherits
Schedule <|-- DailySchedule : inherits
Schedule <|-- OnceAtStartupSchedule : inherits
ScheduledJob *-- Schedule : has one
ScheduledJob o-- ScheduledJobId : identified by
@@ -365,6 +476,7 @@ IScheduledJobScheduler <|.. ScheduledJobSchedulerJob : implements
IScheduledJobNotifier <|.. ScheduledJobNotifier : implements
IScheduledJobRepository <|.. ScheduledJobRepository : implements
IScheduledJobExecutionRepository <|.. ScheduledJobExecutionRepository : implements
ISchedulerDisplayPreferencesRepository <|.. SchedulerDisplayPreferencesRepository : implements
' ============================== COMMAND AND QUERY HANDLER RELATIONSHIPS ==============================
@@ -386,6 +498,9 @@ RemoveScheduledJobCommandHandler --> IScheduledJobScheduler : stops the running
GetScheduledJobsQueryHandler --> IScheduledJobRepository : reads all
GetScheduledJobHistoryQueryHandler --> IScheduledJobExecutionRepository : reads by time range
UpdateSchedulerDisplayPreferencesCommandHandler --> IUnitOfWork : upserts the preferences
GetSchedulerDisplayPreferencesQueryHandler --> IUnitOfWork : reads the preferences
' ============================== DOMAIN EVENT HANDLER RELATIONSHIPS ==============================
ScheduledJobAddedDomainEventHandler --> IScheduledJobNotifier : notifies
@@ -408,10 +523,12 @@ ScheduledJobExecutionStoppedDomainEventHandler --> IScheduledJobNotifier : notif
ScheduledJobSchedulerJob --> IScheduledJobRuntimeRegistry : tracks cycles and run slots
ScheduledJobSchedulerJob --> IScheduledJobRepository : loads jobs and schedules
ScheduledJobSchedulerJob --> IScheduledJobCycleTicker : ticks each execution cycle
ScheduledJobSchedulerJob ..> ScheduledJobExecutionStartedDomainEvent : publishes
ScheduledJobSchedulerJob ..> ScheduledJobExecutionCompletedDomainEvent : publishes
ScheduledJobSchedulerJob ..> ScheduledJob : marks the execution started and completed
IScheduledJobCycleTicker <|.. PeriodicScheduledJobCycleTicker : implements
IScheduledJobRuntimeRegistry <|.. ScheduledJobRuntimeRegistry : implements
ScheduledJobSchedulerJob --> IScheduledTaskExecutorFactory : creates the task executor
@@ -419,11 +536,20 @@ IScheduledTaskExecutorFactory <|.. ScheduledTaskExecutorFactory : implements
ScheduledTaskExecutorFactory ..> MediaLibraryScanTaskExecutor : creates for ScanMediaLibraries
ScheduledTaskExecutorFactory ..> TemporaryFilesCleanupTaskExecutor : creates for CleanTemporaryFiles
ScheduledTaskExecutorFactory ..> RepairThemesTaskExecutor : creates for RepairThemes
ScheduledTaskExecutorFactory ..> CleanScheduledJobExecutionHistoryTaskExecutor : creates for CleanScheduledJobExecutionHistory
ScheduledTaskExecutorFactory ..> TechnicalDataCleanupTaskExecutor : creates for TechnicalDataCleanup
IScheduledTaskExecutor <|.. MediaLibraryScanTaskExecutor : implements
IScheduledTaskExecutor <|.. TemporaryFilesCleanupTaskExecutor : implements
IScheduledTaskExecutor <|.. RepairThemesTaskExecutor : implements
IScheduledTaskExecutor <|.. CleanScheduledJobExecutionHistoryTaskExecutor : implements
IScheduledTaskExecutor <|.. TechnicalDataCleanupTaskExecutor : implements
MediaLibraryScanTaskExecutor --> IUnitOfWork : queues the library scans of the owner
RepairThemesTaskExecutor --> IUnitOfWork : repairs the themes from the bundled archives
CleanScheduledJobExecutionHistoryTaskExecutor --> IUnitOfWork : deletes the old executions
TechnicalDataCleanupTaskExecutor --> IUnitOfWork : fails the interrupted scans
' ============================== NOTIFICATION RELATIONSHIPS ==============================
@@ -435,6 +561,7 @@ ScheduledJobsHub --> IScheduledJobsClient : typed client contract
ScheduledJobRepository --> ScheduledJobEntity : persists
ScheduledJobExecutionRepository --> ScheduledJobExecutionEntity : persists
SchedulerDisplayPreferencesRepository --> SchedulerDisplayPreferencesEntity : persists
caption [Code] Lumina - Scheduled Jobs 3.2.3
@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" data-diagram-type="CLASS" style="width:6534px;height:3023px;background:#FFFFFF;" width="6534px" height="3023px" viewBox="0 0 6534 3023" zoomAndPan="magnify" preserveAspectRatio="none" contentStyleType="text/css"><?plantuml 1.2026.7?><defs/><g font-family="sans-serif" lengthAdjust="spacing"><g class="title" data-source-line="4"><text x="3132.555" y="24.533" fill="#000" font-size="14" textLength="262.179" font-weight="700">Code diagram for Scheduled Jobs 3.2.3</text></g><!--class ScheduledJob--><g class="entity" data-qualified-name="ScheduledJob" id="ent0001" data-source-line="13"><rect x="2808" y="1456.609" width="265.647" height="470.625" fill="#FFF" style="stroke:#000;stroke-width:0.5;" rx="2.5" ry="2.5"/><ellipse cx="2892.205" cy="1472.609" rx="11" ry="11" fill="#ADD1B2" style="stroke:#181818;stroke-width:1;"/><path d="M2894.971,1468.484 Q2895.127,1468.266 2895.314,1468.156 Q2895.502,1468.047 2895.721,1468.047 Q2896.096,1468.047 2896.33,1468.313 Q2896.564,1468.563 2896.564,1469.172 L2896.564,1470.625 Q2896.564,1471.234 2896.33,1471.5 Q2896.096,1471.766 2895.721,1471.766 Q2895.377,1471.766 2895.174,1471.563 Q2894.971,1471.375 2894.861,1470.859 Q2894.814,1470.5 2894.627,1470.313 Q2894.299,1469.938 2893.689,1469.719 Q2893.08,1469.5 2892.455,1469.5 Q2891.689,1469.5 2891.049,1469.828 Q2890.424,1470.156 2889.924,1470.906 Q2889.439,1471.656 2889.439,1472.688 L2889.439,1473.781 Q2889.439,1475.016 2890.33,1475.844 Q2891.221,1476.656 2892.814,1476.656 Q2893.752,1476.656 2894.408,1476.406 Q2894.799,1476.25 2895.221,1475.813 Q2895.486,1475.547 2895.627,1475.469 Q2895.783,1475.391 2895.986,1475.391 Q2896.314,1475.391 2896.564,1475.656 Q2896.83,1475.906 2896.83,1476.25 Q2896.83,1476.594 2896.486,1477 Q2895.986,1477.578 2895.189,1477.906 Q2894.111,1478.359 2892.814,1478.359 Q2891.299,1478.359 2890.096,1477.734 Q2889.111,1477.234 2888.424,1476.172 Q2887.736,1475.094 2887.736,1473.813 L2887.736,1472.656 Q2887.736,1471.328 2888.346,1470.188 Q2888.971,1469.031 2890.064,1468.422 Q2891.158,1467.797 2892.393,1467.797 Q2893.127,1467.797 2893.768,1467.969 Q2894.424,1468.125 2894.971,1468.484 Z " fill="#000"/><text x="2912.705" y="1478.338" fill="#000" font-size="14" textLength="88.737">ScheduledJob</text><line x1="2809" y1="1488.609" x2="3072.647" y2="1488.609" style="stroke:#000;stroke-width:0.5;"/><g data-visibility-modifier="PRIVATE_FIELD"><rect x="2816" y="1508.719" width="6" height="6" fill="none" style="stroke:#C82930;stroke-width:1;"/></g><text x="2828" y="1507.143" fill="#000" font-size="14" textLength="154.089">_currentExecutionRunId:</text><text x="2828" y="1524.752" fill="#000" font-size="14" textLength="98.068">Optional&lt;Guid></text><g data-visibility-modifier="PUBLIC_FIELD"><ellipse cx="2819" cy="1538.133" rx="3" ry="3" fill="none" style="stroke:#038048;stroke-width:1;"/></g><text x="2828" y="1542.361" fill="#000" font-size="14" textLength="41.234">Name:</text><text x="2869.234" y="1542.361" fill="#000" font-size="14"> </text><text x="2873.124" y="1542.361" fill="#000" font-size="14" textLength="34.234">string</text><g data-visibility-modifier="PUBLIC_FIELD"><ellipse cx="2819" cy="1555.742" rx="3" ry="3" fill="none" style="stroke:#038048;stroke-width:1;"/></g><text x="2828" y="1559.971" fill="#000" font-size="14" textLength="65.352">TaskType:</text><text x="2893.352" y="1559.971" fill="#000" font-size="14"> </text><text x="2897.241" y="1559.971" fill="#000" font-size="14" textLength="127.627">ScheduledTaskType</text><g data-visibility-modifier="PUBLIC_FIELD"><ellipse cx="2819" cy="1573.352" rx="3" ry="3" fill="none" style="stroke:#038048;stroke-width:1;"/></g><text x="2828" y="1577.58" fill="#000" font-size="14" textLength="62.269">Schedule:</text><text x="2890.269" y="1577.58" fill="#000" font-size="14"> </text><text x="2894.158" y="1577.58" fill="#000" font-size="14" textLength="58.379">Schedule</text><g data-visibility-modifier="PUBLIC_FIELD"><ellipse cx="2819" cy="1590.961" rx="3" ry="3" fill="none" style="stroke:#038048;stroke-width:1;"/></g><text x="2828" y="1595.189" fill="#000" font-size="14" textLength="43.579">Status:</text><text x="2871.579" y="1595.189" fill="#000" font-size="14"> </text><text x="2875.469" y="1595.189" fill="#000" font-size="14" textLength="128.427">ScheduledJobStatus</text><g data-visibility-modifier="PUBLIC_FIELD"><ellipse cx="2819" cy="1608.57" rx="3" ry="3" fill="none" style="stroke:#038048;stroke-width:1;"/></g><text x="2828" y="1612.799" fill="#000" font-size="14" textLength="86.358">OwnerUserId:</text><text x="2914.358" y="1612.799" fill="#000" font-size="14"> </text><text x="2918.248" y="1612.799" fill="#000" font-size="14" textLength="41.234">UserId</text><g data-visibility-modifier="PUBLIC_FIELD"><ellipse cx="2819" cy="1634.984" rx="3" ry="3" fill="none" style="stroke:#038048;stroke-width:1;"/></g><text x="2828" y="1630.408" fill="#000" font-size="14" textLength="115.165">LaLine truncated
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" data-diagram-type="CLASS" style="width:10247px;height:4267px;background:#FFFFFF;" width="10247px" height="4267px" viewBox="0 0 10247 4267" zoomAndPan="magnify" preserveAspectRatio="none" contentStyleType="text/css"><?plantuml 1.2026.7?><defs/><g font-family="sans-serif" lengthAdjust="spacing"><g class="title" data-source-line="5"><text x="4989.402" y="24.533" fill="#000" font-size="14" textLength="262.179" font-weight="700">Code diagram for Scheduled Jobs 3.2.3</text></g><!--class ScheduledJob--><g class="entity" data-qualified-name="ScheduledJob" id="ent0001" data-source-line="14"><rect x="2449.27" y="2302.266" width="265.647" height="646.719" fill="#FFF" style="stroke:#000;stroke-width:0.5;" rx="2.5" ry="2.5"/><ellipse cx="2533.475" cy="2318.266" rx="11" ry="11" fill="#ADD1B2" style="stroke:#181818;stroke-width:1;"/><path d="M2536.24,2314.141 Q2536.397,2313.922 2536.584,2313.813 Q2536.772,2313.703 2536.99,2313.703 Q2537.365,2313.703 2537.6,2313.969 Q2537.834,2314.219 2537.834,2314.828 L2537.834,2316.281 Q2537.834,2316.891 2537.6,2317.156 Q2537.365,2317.422 2536.99,2317.422 Q2536.647,2317.422 2536.444,2317.219 Q2536.24,2317.031 2536.131,2316.516 Q2536.084,2316.156 2535.897,2315.969 Q2535.569,2315.594 2534.959,2315.375 Q2534.35,2315.156 2533.725,2315.156 Q2532.959,2315.156 2532.319,2315.484 Q2531.694,2315.813 2531.194,2316.563 Q2530.709,2317.313 2530.709,2318.344 L2530.709,2319.438 Q2530.709,2320.672 2531.6,2321.5 Q2532.49,2322.313 2534.084,2322.313 Q2535.022,2322.313 2535.678,2322.063 Q2536.069,2321.906 2536.49,2321.469 Q2536.756,2321.203 2536.897,2321.125 Q2537.053,2321.047 2537.256,2321.047 Q2537.584,2321.047 2537.834,2321.313 Q2538.1,2321.563 2538.1,2321.906 Q2538.1,2322.25 2537.756,2322.656 Q2537.256,2323.234 2536.459,2323.563 Q2535.381,2324.016 2534.084,2324.016 Q2532.569,2324.016 2531.365,2323.391 Q2530.381,2322.891 2529.694,2321.828 Q2529.006,2320.75 2529.006,2319.469 L2529.006,2318.313 Q2529.006,2316.984 2529.615,2315.844 Q2530.24,2314.688 2531.334,2314.078 Q2532.428,2313.453 2533.662,2313.453 Q2534.397,2313.453 2535.037,2313.625 Q2535.694,2313.781 2536.24,2314.141 Z " fill="#000"/><text x="2553.975" y="2323.994" fill="#000" font-size="14" textLength="88.737">ScheduledJob</text><line x1="2450.27" y1="2334.266" x2="2713.917" y2="2334.266" style="stroke:#000;stroke-width:0.5;"/><g data-visibility-modifier="PRIVATE_FIELD"><rect x="2457.27" y="2354.375" width="6" height="6" fill="none" style="stroke:#C82930;stroke-width:1;"/></g><text x="2469.27" y="2352.799" fill="#000" font-size="14" textLength="154.089">_currentExecutionRunId:</text><text x="2469.27" y="2370.408" fill="#000" font-size="14" textLength="98.068">Optional&lt;Guid></text><g data-visibility-modifier="PUBLIC_FIELD"><ellipse cx="2460.27" cy="2383.789" rx="3" ry="3" fill="none" style="stroke:#038048;stroke-width:1;"/></g><text x="2469.27" y="2388.018" fill="#000" font-size="14" textLength="41.234">Name:</text><text x="2510.504" y="2388.018" fill="#000" font-size="14"> </text><text x="2514.394" y="2388.018" fill="#000" font-size="14" textLength="34.234">string</text><g data-visibility-modifier="PUBLIC_FIELD"><ellipse cx="2460.27" cy="2401.398" rx="3" ry="3" fill="none" style="stroke:#038048;stroke-width:1;"/></g><text x="2469.27" y="2405.627" fill="#000" font-size="14" textLength="65.352">TaskType:</text><text x="2534.621" y="2405.627" fill="#000" font-size="14"> </text><text x="2538.511" y="2405.627" fill="#000" font-size="14" textLength="127.627">ScheduledTaskType</text><g data-visibility-modifier="PUBLIC_FIELD"><ellipse cx="2460.27" cy="2419.008" rx="3" ry="3" fill="none" style="stroke:#038048;stroke-width:1;"/></g><text x="2469.27" y="2423.236" fill="#000" font-size="14" textLength="62.269">Schedule:</text><text x="2531.538" y="2423.236" fill="#000" font-size="14"> </text><text x="2535.428" y="2423.236" fill="#000" font-size="14" textLength="58.379">Schedule</text><g data-visibility-modifier="PUBLIC_FIELD"><ellipse cx="2460.27" cy="2436.617" rx="3" ry="3" fill="none" style="stroke:#038048;stroke-width:1;"/></g><text x="2469.27" y="2440.846" fill="#000" font-size="14" textLength="43.579">Status:</text><text x="2512.849" y="2440.846" fill="#000" font-size="14"> </text><text x="2516.739" y="2440.846" fill="#000" font-size="14" textLength="128.427">ScheduledJobStatus</text><g data-visibility-modifier="PUBLIC_FIELD"><ellipse cx="2460.27" cy="2454.227" rx="3" ry="3" fill="none" style="stroke:#038048;stroke-width:1;"/></g><text x="2469.27" y="2458.455" fill="#000" font-size="14" textLength="86.358">OwnerUserId:</text><text x="2555.628" y="2458.455" fill="#000" font-size="14"> </text><text x="2559.518" y="2458.455" fill="#000" font-size="14" textLength="41.234">UserId</text><g data-visibility-modifier="PUBLIC_FIELD"><ellipse cx="2460.27" cy="2480.641" rx="3" ry="3" fill="none" style="stroke:#038048;stroke-width:1;"/></g><text x="2469.27" y="2476Line truncated

Before

Width:  |  Height:  |  Size: 271 KiB

After

Width:  |  Height:  |  Size: 352 KiB

+82
View File
@@ -0,0 +1,82 @@
# Architecture Diagrams
This folder contains the C4 architecture diagrams of Lumina. Every diagram is maintained as a PlantUML source file (`.puml`) and rendered to a committed SVG (`.svg`) with the same base name.
## Layout
Every diagram starts with:
```plantuml
!pragma layout elk
```
This selects the Eclipse Layout Kernel (ELK) instead of Graphviz. ELK is bundled with PlantUML since version 1.2024.6, so neither Graphviz nor a separate ELK installation is required. It draws connectors as straight orthogonal segments instead of Bezier curves.
## Rendering
Prerequisites:
- Java 17 or newer.
- PlantUML 1.2026.7, the version recorded in the metadata of the committed SVG files.
Download the pinned PlantUML jar once.
PowerShell:
```powershell
Invoke-WebRequest -Uri "https://repo1.maven.org/maven2/net/sourceforge/plantuml/plantuml/1.2026.7/plantuml-1.2026.7.jar" -OutFile "$env:TEMP\plantuml-1.2026.7.jar"
```
Bash:
```bash
curl -L -o /tmp/plantuml-1.2026.7.jar "https://repo1.maven.org/maven2/net/sourceforge/plantuml/plantuml/1.2026.7/plantuml-1.2026.7.jar"
```
From this folder, render every `.puml` file to an `.svg` file next to it.
PowerShell:
```powershell
cd docs/technical/architecture
java -jar "$env:TEMP\plantuml-1.2026.7.jar" --charset UTF-8 --format svg --ignore-startuml-filename .
```
Bash:
```bash
cd docs/technical/architecture
java -jar /tmp/plantuml-1.2026.7.jar --charset UTF-8 --format svg --ignore-startuml-filename .
```
The options are required for reproducible output:
- `--charset UTF-8` reads the source as UTF-8.
- `--format svg` writes the vector SVG files that are committed.
- `--ignore-startuml-filename` names each output file after its `.puml` source. Without it, PlantUML uses the `@startuml` title as the file name.
- The input `.` renders every diagram in the current folder and writes each SVG beside its source.
Do not add `--output-dir` when rendering this folder. PlantUML resolves a relative output directory against each source file, so `--output-dir .` creates a nested copy of the folder. Running from the folder without that option writes the SVG files in place.
Commit the regenerated `.svg` files together with the `.puml` change. Never edit an SVG by hand.
## Verifying the output
The `.puml` file is the source of truth. The committed SVG carries the PlantUML version marker and rendering hints, but no readable `@startuml` source and no `<metadata>` block. After rendering, check that:
- the SVG contains `<?plantuml 1.2026.7?>`,
- its base name matches its `.puml` source,
- the diagram connectors are straight orthogonal segments, not curved paths.
The only reliable way to tell whether a committed SVG is current is to start from a clean working tree, re-render it from its `.puml` with the pinned command, and then check the generated SVGs for changes. From the architecture folder where the render command runs:
```bash
git diff --exit-code -- '*.svg'
```
If you run the check from the repository root instead, use the full path:
```bash
git diff --exit-code -- 'docs/technical/architecture/*.svg'
```
A non-zero exit code means the render changed one or more SVG files, so the committed ones were stale. Review the diff, commit the regenerated SVGs together with the `.puml` change, and re-run the check.
If a future PlantUML release is adopted, update the version in this document and in the download commands, then re-render every diagram in the same change. Mixing PlantUML versions produces noisy SVG diffs and different layouts.
+1
View File
@@ -88,6 +88,7 @@
<File Path="../docs/technical/api/users-management/Api.Settings.md" />
</Folder>
<Folder Name="/docs/technical/architecture/">
<File Path="../docs/technical/architecture/README.md" />
<File Path="../docs/technical/architecture/1 system-context-diagram.puml" />
<File Path="../docs/technical/architecture/1 system-context-diagram.svg" />
<File Path="../docs/technical/architecture/2 container-diagram.puml" />