Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
378677acda | ||
|
|
ee94f4fd49 | ||
|
|
a188ab3fe0 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -17,3 +17,6 @@ publish/
|
||||
# OS noise
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# Log files
|
||||
*.log
|
||||
|
||||
@@ -18,7 +18,14 @@
|
||||
<PackageReference Include="Jellyfin.Model" Version="10.11.11">
|
||||
<ExcludeAssets>runtime</ExcludeAssets>
|
||||
</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>
|
||||
|
||||
@@ -16,14 +16,20 @@ public class PluginServiceRegistrator : IPluginServiceRegistrator
|
||||
/// <inheritdoc />
|
||||
public void RegisterServices(IServiceCollection serviceCollection, IServerApplicationHost applicationHost)
|
||||
{
|
||||
var dbPath = Path.Combine(
|
||||
applicationHost.Resolve<IApplicationPaths>().PluginConfigurationsPath,
|
||||
"RedditComments",
|
||||
"reddit-comments.db");
|
||||
|
||||
serviceCollection.AddSingleton<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(
|
||||
sp.GetRequiredService<ILogger<RedditCommentsService>>(),
|
||||
sp.GetRequiredService<RedditClient>(),
|
||||
|
||||
10
README.md
10
README.md
@@ -38,7 +38,7 @@ primarily for anime, where almost every episode has a thread on r/anime.
|
||||
- Linux (native): `/var/lib/jellyfin/plugins/RedditComments`
|
||||
- Docker: `<your config volume>/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.
|
||||
|
||||
### Option B — plugin repository
|
||||
@@ -102,9 +102,11 @@ Requires the .NET 9 SDK:
|
||||
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
|
||||
`e_sqlite3` library for your platform (under `publish/runtimes/<rid>/native/`) into your plugins
|
||||
folder. The `dist/` zip in this repo is already assembled this way.
|
||||
Copy `Jellyfin.Plugin.RedditComments.dll` into your plugins folder and restart. The package is
|
||||
intentionally a single DLL: the plugin uses the same `Microsoft.Data.Sqlite` build that Jellyfin
|
||||
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):
|
||||
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
|
||||
<ItemGroup>
|
||||
<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>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
"version": "1.0.0.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",
|
||||
"targetAbi": "10.11.0.0",
|
||||
"sourceUrl": "https://YOUR-HOSTING-URL/Jellyfin.Plugin.RedditComments_1.0.0.0.zip",
|
||||
"checksum": "9ee28786f8f9c7edb17f3f7c147a6df9",
|
||||
"sourceUrl": "https://git.gabjimmy.com/Gabe/Jellyfin-Comments/releases/download/1.0.1/Jellyfin.Plugin.RedditComments_1.0.0.0.zip",
|
||||
"checksum": "e83846f799ae02b8af635bc026e8b4f0",
|
||||
"timestamp": "2026-07-16T00:00:00Z"
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user