3 Commits

Author SHA1 Message Date
Gabrieal Jimmy
76a2560cdb fix 3 2026-07-16 14:32:59 -05:00
Gabrieal Jimmy
378677acda fix 2 2026-07-16 14:07:16 -05:00
Gabrieal Jimmy
ee94f4fd49 Fix 2026-07-16 13:54:01 -05:00
6 changed files with 42 additions and 21 deletions

3
.gitignore vendored
View File

@@ -17,3 +17,6 @@ publish/
# OS noise # OS noise
.DS_Store .DS_Store
Thumbs.db Thumbs.db
# Log files
*.log

View File

@@ -4,8 +4,8 @@
<TargetFramework>net9.0</TargetFramework> <TargetFramework>net9.0</TargetFramework>
<RootNamespace>Jellyfin.Plugin.RedditComments</RootNamespace> <RootNamespace>Jellyfin.Plugin.RedditComments</RootNamespace>
<AssemblyName>Jellyfin.Plugin.RedditComments</AssemblyName> <AssemblyName>Jellyfin.Plugin.RedditComments</AssemblyName>
<AssemblyVersion>1.0.0.0</AssemblyVersion> <AssemblyVersion>1.0.1.0</AssemblyVersion>
<FileVersion>1.0.0.0</FileVersion> <FileVersion>1.0.1.0</FileVersion>
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ImplicitUsings>disable</ImplicitUsings> <ImplicitUsings>disable</ImplicitUsings>
@@ -18,7 +18,14 @@
<PackageReference Include="Jellyfin.Model" Version="10.11.11"> <PackageReference Include="Jellyfin.Model" Version="10.11.11">
<ExcludeAssets>runtime</ExcludeAssets> <ExcludeAssets>runtime</ExcludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.Data.Sqlite" Version="9.0.18" /> <!-- Pinned to the exact version Jellyfin 10.11.x ships for its own database (via EF Core 9.0.11).
Runtime assets are excluded: the server already has Microsoft.Data.Sqlite and the native
e_sqlite3 library loaded, so the plugin must not ship its own copies. Shipping them would
also break plugin loading, because PluginManager tries to load every *.dll in the plugin
folder as a managed assembly (including native binaries like e_sqlite3.dll). -->
<PackageReference Include="Microsoft.Data.Sqlite" Version="9.0.11">
<ExcludeAssets>runtime</ExcludeAssets>
</PackageReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -16,14 +16,20 @@ public class PluginServiceRegistrator : IPluginServiceRegistrator
/// <inheritdoc /> /// <inheritdoc />
public void RegisterServices(IServiceCollection serviceCollection, IServerApplicationHost applicationHost) public void RegisterServices(IServiceCollection serviceCollection, IServerApplicationHost applicationHost)
{ {
var dbPath = Path.Combine(
applicationHost.Resolve<IApplicationPaths>().PluginConfigurationsPath,
"RedditComments",
"reddit-comments.db");
serviceCollection.AddSingleton<RateLimiter>(); serviceCollection.AddSingleton<RateLimiter>();
serviceCollection.AddSingleton(sp => new RedditClient(sp.GetRequiredService<ILogger<RedditClient>>(), sp.GetRequiredService<RateLimiter>())); serviceCollection.AddSingleton(sp => new RedditClient(sp.GetRequiredService<ILogger<RedditClient>>(), sp.GetRequiredService<RateLimiter>()));
serviceCollection.AddSingleton(sp => new CommentCache(dbPath, sp.GetRequiredService<ILogger<CommentCache>>()));
// The path is resolved inside the factory (not eagerly here) because the host's service
// provider does not exist yet while RegisterServices is running.
serviceCollection.AddSingleton(sp =>
{
var dbPath = Path.Combine(
sp.GetRequiredService<IApplicationPaths>().PluginConfigurationsPath,
"RedditComments",
"reddit-comments.db");
return new CommentCache(dbPath, sp.GetRequiredService<ILogger<CommentCache>>());
});
serviceCollection.AddSingleton(sp => new RedditCommentsService( serviceCollection.AddSingleton(sp => new RedditCommentsService(
sp.GetRequiredService<ILogger<RedditCommentsService>>(), sp.GetRequiredService<ILogger<RedditCommentsService>>(),
sp.GetRequiredService<RedditClient>(), sp.GetRequiredService<RedditClient>(),

View File

@@ -33,20 +33,20 @@ primarily for anime, where almost every episode has a thread on r/anime.
### Option A — manual install ### Option A — manual install
1. Download/copy `dist/Jellyfin.Plugin.RedditComments_1.0.0.0.zip`. 1. Download/copy `dist/Jellyfin.Plugin.RedditComments_1.0.1.0.zip`.
2. Create a folder `RedditComments` inside your Jellyfin plugins directory: 2. Create a folder `RedditComments` inside your Jellyfin plugins directory:
- Linux (native): `/var/lib/jellyfin/plugins/RedditComments` - Linux (native): `/var/lib/jellyfin/plugins/RedditComments`
- Docker: `<your config volume>/plugins/RedditComments` - Docker: `<your config volume>/plugins/RedditComments`
- Windows: `%ProgramData%\Jellyfin\Server\plugins\RedditComments` - Windows: `%ProgramData%\Jellyfin\Server\plugins\RedditComments`
3. Extract the zip contents into that folder (the DLLs must sit directly inside it). 3. Extract the zip contents into that folder (the plugin DLL must sit directly inside it).
4. Restart Jellyfin. 4. Restart Jellyfin.
### Option B — plugin repository ### Option B — plugin repository
1. Host `dist/Jellyfin.Plugin.RedditComments_1.0.0.0.zip` somewhere reachable by your server 1. Host `dist/Jellyfin.Plugin.RedditComments_1.0.1.0.zip` somewhere reachable by your server
(e.g. a GitHub release asset). (e.g. a GitHub release asset).
2. Edit `manifest.json`: set `sourceUrl` to the zip URL and update `checksum` with the zip's MD5 2. Edit `manifest.json`: set `sourceUrl` to the zip URL and update `checksum` with the zip's MD5
(`md5sum Jellyfin.Plugin.RedditComments_1.0.0.0.zip`). (`md5sum Jellyfin.Plugin.RedditComments_1.0.1.0.zip`).
3. Host `manifest.json` next to the zip. 3. Host `manifest.json` next to the zip.
4. In Jellyfin: **Dashboard → Plugins → Repositories → +**, paste the manifest URL, then install 4. In Jellyfin: **Dashboard → Plugins → Repositories → +**, paste the manifest URL, then install
"Reddit Comments" from the catalog and restart. "Reddit Comments" from the catalog and restart.
@@ -102,9 +102,11 @@ Requires the .NET 9 SDK:
dotnet publish Jellyfin.Plugin.RedditComments/Jellyfin.Plugin.RedditComments.csproj -c Release -o publish dotnet publish Jellyfin.Plugin.RedditComments/Jellyfin.Plugin.RedditComments.csproj -c Release -o publish
``` ```
Copy the plugin DLL plus `Microsoft.Data.Sqlite.dll`, the `SQLitePCLRaw.*.dll`s and the native Copy `Jellyfin.Plugin.RedditComments.dll` into your plugins folder and restart. The package is
`e_sqlite3` library for your platform (under `publish/runtimes/<rid>/native/`) into your plugins intentionally a single DLL: the plugin uses the same `Microsoft.Data.Sqlite` build that Jellyfin
folder. The `dist/` zip in this repo is already assembled this way. itself ships for `jellyfin.db`, so no extra assemblies or native libraries may be placed in the
plugin folder (Jellyfin tries to load every `*.dll` there as a managed assembly and disables the
plugin on failure).
Run the smoke tests (cache, Reddit response parsing, rate limiter): Run the smoke tests (cache, Reddit response parsing, rate limiter):

View File

@@ -9,6 +9,9 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Jellyfin.Plugin.RedditComments\Jellyfin.Plugin.RedditComments.csproj" /> <ProjectReference Include="..\Jellyfin.Plugin.RedditComments\Jellyfin.Plugin.RedditComments.csproj" />
<!-- The plugin itself excludes runtime assets (the Jellyfin server provides this assembly);
the tests need it present to exercise the cache. -->
<PackageReference Include="Microsoft.Data.Sqlite" Version="9.0.11" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -8,12 +8,12 @@
"category": "General", "category": "General",
"versions": [ "versions": [
{ {
"version": "1.0.0.0", "version": "1.0.1.0",
"changelog": "- Initial release\n- Player OSD button + comments sidebar\n- Reddit thread search across configurable subreddits\n- SQLite caching with separate TTLs for found/not-found results\n- Sliding-window rate limiter (default 60 requests/minute, max 100)\n- Lazy loading: Reddit is only contacted on button click", "changelog": "- Fix plugin being disabled at startup (eager DI resolve in service registration)\n- Ship as a single DLL using the server's own SQLite assemblies\n- Player OSD button + comments sidebar\n- Reddit thread search across configurable subreddits\n- SQLite caching with separate TTLs for found/not-found results\n- Sliding-window rate limiter (default 60 requests/minute, max 100)\n- Lazy loading: Reddit is only contacted on button click",
"targetAbi": "10.11.0.0", "targetAbi": "10.11.0.0",
"sourceUrl": "https://git.gabjimmy.com/Gabe/Jellyfin-Comments/releases/download/1.0/Jellyfin.Plugin.RedditComments_1.0.0.0.zip", "sourceUrl": "https://git.gabjimmy.com/Gabe/Jellyfin-Comments/releases/download/1.0.1.0/Jellyfin.Plugin.RedditComments_1.0.1.0.zip",
"checksum": "9ee28786f8f9c7edb17f3f7c147a6df9", "checksum": "4261e0c68ce67eab4a41e9a2a042750e",
"timestamp": "2026-07-16T00:00:00Z" "timestamp": "2026-07-16T14:30:00Z"
} }
] ]
} }