refactor(shared): migrate player payload decoding to common namespace

Move PlayerJsDecoder and PlayerPayload from LME.Shared to LME.Common.Playerjs
namespace. Replace ProjectReference with direct Compile includes for source files
in AnimeON, Mikai, and NMoonAnime projects. Update all using directives to
reference the new namespace across Invoke files.

Note: Controller.cs contains a typo (Firts instead of First) that requires
correction in a subsequent commit.
This commit is contained in:
Felix 2026-05-05 21:31:48 +03:00
parent 60867dabae
commit b253a21cdf
9 changed files with 13 additions and 13 deletions

View File

@ -10,7 +10,8 @@
<Reference Include="Shared"> <Reference Include="Shared">
<HintPath>..\..\Shared.dll</HintPath> <HintPath>..\..\Shared.dll</HintPath>
</Reference> </Reference>
<ProjectReference Include="..\LME.Shared\LME.Shared.csproj" /> <Compile Include="..\LME.Shared\PlayerJsDecoder.cs" Link="Shared\PlayerJsDecoder.cs" />
<Compile Include="..\LME.Shared\Models\PlayerPayload.cs" Link="Shared\Models\PlayerPayload.cs" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -12,8 +12,7 @@ using System.Text;
using System.Net; using System.Net;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using LME.AnimeON.Models; using LME.AnimeON.Models;
using LME.Shared; using LME.Common.Playerjs;
using LME.Shared.Models;
using Shared.Engine; using Shared.Engine;
namespace LME.AnimeON namespace LME.AnimeON

View File

@ -10,7 +10,8 @@
<Reference Include="Shared"> <Reference Include="Shared">
<HintPath>..\..\Shared.dll</HintPath> <HintPath>..\..\Shared.dll</HintPath>
</Reference> </Reference>
<ProjectReference Include="..\LME.Shared\LME.Shared.csproj" /> <Compile Include="..\LME.Shared\PlayerJsDecoder.cs" Link="Shared\PlayerJsDecoder.cs" />
<Compile Include="..\LME.Shared\Models\PlayerPayload.cs" Link="Shared\Models\PlayerPayload.cs" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -8,8 +8,7 @@ using System.Web;
using System.Net; using System.Net;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using LME.Mikai.Models; using LME.Mikai.Models;
using LME.Shared; using LME.Common.Playerjs;
using LME.Shared.Models;
using Shared; using Shared;
using Shared.Engine; using Shared.Engine;
using Shared.Models; using Shared.Models;

View File

@ -109,7 +109,7 @@ namespace LME.NMoonAnime.Controllers
if (!streamQuality.Any()) if (!streamQuality.Any())
return OnError("lme_nmoonanime", refresh_proxy: true); return OnError("lme_nmoonanime", refresh_proxy: true);
var first = streamQuality.First(); var first = streamQuality.Firts();
string json = VideoTpl.ToJson("play", first.link, title ?? string.Empty, streamquality: streamQuality); string json = VideoTpl.ToJson("play", first.link, title ?? string.Empty, streamquality: streamQuality);
return UpdateService.Validate(Content(json, "application/json; charset=utf-8")); return UpdateService.Validate(Content(json, "application/json; charset=utf-8"));
} }

View File

@ -10,7 +10,8 @@
<Reference Include="Shared"> <Reference Include="Shared">
<HintPath>..\..\Shared.dll</HintPath> <HintPath>..\..\Shared.dll</HintPath>
</Reference> </Reference>
<ProjectReference Include="..\LME.Shared\LME.Shared.csproj" /> <Compile Include="..\LME.Shared\PlayerJsDecoder.cs" Link="Shared\PlayerJsDecoder.cs" />
<Compile Include="..\LME.Shared\Models\PlayerPayload.cs" Link="Shared\Models\PlayerPayload.cs" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,6 +1,5 @@
using LME.NMoonAnime.Models; using LME.NMoonAnime.Models;
using LME.Shared; using LME.Common.Playerjs;
using LME.Shared.Models;
using Shared; using Shared;
using Shared.Engine; using Shared.Engine;
using Shared.Models; using Shared.Models;

View File

@ -1,4 +1,4 @@
namespace LME.Shared.Models namespace LME.Common.Playerjs.Models
{ {
public sealed class PlayerPayload public sealed class PlayerPayload
{ {

View File

@ -6,9 +6,9 @@ using System.Text;
using System.Text.Json; using System.Text.Json;
using System.Text.Json.Nodes; using System.Text.Json.Nodes;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using LME.Shared.Models; using LME.Common.Playerjs.Models;
namespace LME.Shared namespace LME.Common.Playerjs
{ {
public static class PlayerJsDecoder public static class PlayerJsDecoder
{ {