From 4a0849105e1788298c1a5b2f1c4b4e07be08aa7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=8E=A7=20RicherTunes=20=F0=9F=8E=A7?= Date: Sat, 27 Dec 2025 16:30:12 -0500 Subject: [PATCH 1/2] fix(versioning): derive assembly versions from plugin.json --- Brainarr.Plugin/Brainarr.Plugin.csproj | 5 ++++- Brainarr.Plugin/Properties/AssemblyInfo.cs | 20 -------------------- Directory.Build.props | 19 +++++++++++++++---- Directory.Build.targets | 10 ++++++++++ VERSION | 1 - manifest.json | 4 ++-- 6 files changed, 31 insertions(+), 28 deletions(-) delete mode 100644 VERSION diff --git a/Brainarr.Plugin/Brainarr.Plugin.csproj b/Brainarr.Plugin/Brainarr.Plugin.csproj index d4f98f5e..fda1c5e6 100644 --- a/Brainarr.Plugin/Brainarr.Plugin.csproj +++ b/Brainarr.Plugin/Brainarr.Plugin.csproj @@ -15,7 +15,10 @@ true - false + true + RicherTunes + Brainarr + AI-powered music recommendation plugin for Lidarr false true diff --git a/Brainarr.Plugin/Properties/AssemblyInfo.cs b/Brainarr.Plugin/Properties/AssemblyInfo.cs index b287428a..c75a3567 100644 --- a/Brainarr.Plugin/Properties/AssemblyInfo.cs +++ b/Brainarr.Plugin/Properties/AssemblyInfo.cs @@ -1,28 +1,8 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly -[assembly: AssemblyTitle("Brainarr.Plugin")] -[assembly: AssemblyDescription("AI-powered music recommendation plugin for Lidarr")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("RicherTunes")] -[assembly: AssemblyProduct("Brainarr")] -[assembly: AssemblyCopyright("Copyright © RicherTunes 2025")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. [assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("A4C7B8AA-7F67-4C38-9A5E-7CA4E2C5D827")] -// Version information -[assembly: AssemblyVersion("1.3.2.0")] -[assembly: AssemblyFileVersion("1.3.2.0")] - -// Mark as Lidarr plugin [assembly: AssemblyMetadata("PluginType", "ImportList")] [assembly: AssemblyMetadata("PluginName", "Brainarr")] diff --git a/Directory.Build.props b/Directory.Build.props index c42645c5..793610c2 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -14,14 +14,24 @@ - + + $(MSBuildThisFileDirectory)plugin.json + $([System.IO.File]::ReadAllText('$(PluginJsonPath)')) + $([System.Text.RegularExpressions.Regex]::Match('$(PluginJsonText)', '"version"\s*:\s*"([^"]+)"').Groups[1].Value) + + $([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)VERSION').Trim()) + + $(PluginJsonVersion) $(VersionFromFile) 0.1.0-dev - - $([System.Text.RegularExpressions.Regex]::Match('$(VersionFromFile)', '^\d+\.\d+\.\d+').Value) - $(VersionPrefix).0 + + $([System.Text.RegularExpressions.Regex]::Match('$(Version)', '^(\d+\.\d+)').Groups[1].Value) + $([System.Text.RegularExpressions.Regex]::Match('$(Version)', '^\d+\.\d+\.\d+').Value) + $(VersionMajorMinor).0.0 $(VersionPrefix).0 @@ -29,6 +39,7 @@ true true + true true true diff --git a/Directory.Build.targets b/Directory.Build.targets index 9f4234a5..9deb3d20 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -9,5 +9,15 @@ the ILRepack task with the correct LibraryPath that includes Lidarr assemblies. The package's automatic target doesn't have Lidarr in its LibraryPath and fails. --> + + + + diff --git a/VERSION b/VERSION deleted file mode 100644 index 3a3cd8cc..00000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.3.1 diff --git a/manifest.json b/manifest.json index 91e85305..2a3e8dd6 100644 --- a/manifest.json +++ b/manifest.json @@ -25,11 +25,11 @@ }, { "path": "Lidarr.Plugin.Brainarr.dll", - "sha256": "f9cce5ad263663590a18cf67f16521fcb8b51cdf7215d7c563083386db252caa" + "sha256": "dcaeff67da4c57affe105725dfe6d31c9f2024a5408766cc4140bc859823cbbd" }, { "path": "manifest.json", - "sha256": "150901d2b7912e391c736219e853e102a0fc9325d64c61a4a35b23b71da2fc58" + "sha256": "b687a0647e9d33cc60c656c04373b33bcd25a086350a5c4cec1336e43905f074" }, { "path": "Microsoft.Extensions.DependencyInjection.Abstractions.dll", From 8c8db17efb5e802d73625bf7c4aa04bf3360fec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=8E=A7=20RicherTunes=20=F0=9F=8E=A7?= Date: Sat, 27 Dec 2025 16:33:32 -0500 Subject: [PATCH 2/2] build: add FluentValidation host guard to prevent type-identity issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds build-time validation that FluentValidation.dll exists in the Lidarr host assemblies path. This prevents accidental builds where Directory.Packages.props pulls FV 11.x from NuGet instead of using the host's FluentValidation. The guard fails fast with a clear error message explaining: - Why host FV is required (type-identity for Test override) - How to fix it (extract assemblies or use complete installation) - Link to PR #346 for context This closes the "contributor footgun" risk identified during the FluentValidation exclusion fix review. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- Brainarr.Plugin/Brainarr.Plugin.csproj | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Brainarr.Plugin/Brainarr.Plugin.csproj b/Brainarr.Plugin/Brainarr.Plugin.csproj index fda1c5e6..fbfa9673 100644 --- a/Brainarr.Plugin/Brainarr.Plugin.csproj +++ b/Brainarr.Plugin/Brainarr.Plugin.csproj @@ -159,6 +159,14 @@ + + + + +