mirror of
https://github.com/lampame/lampac-ukraine.git
synced 2026-04-16 17:32:20 +00:00
- Add Controller.cs for handling StarLight API endpoints - Add ModInit.cs for module initialization and configuration - Add StarLightModels.cs for data models (SearchResult, ProjectInfo, etc.) - Add OnlineApi.cs for integrating with the online API system - Add StarLight.csproj for project configuration - Add StarLightInvoke.cs for core functionality including search, project retrieval, and stream resolution - Add manifest.json for module metadata and initialization The implementation includes: - Search functionality with caching - Project information retrieval with season and episode handling - Stream resolution with multiple fallback options - Proxy support and error handling - Integration with the existing online module system
26 lines
869 B
C#
26 lines
869 B
C#
using Shared.Models.Base;
|
|
using System.Collections.Generic;
|
|
|
|
namespace StarLight
|
|
{
|
|
public class OnlineApi
|
|
{
|
|
public static List<(string name, string url, string plugin, int index)> Events(string host, long id, string imdb_id, long kinopoisk_id, string title, string original_title, string original_language, int year, string source, int serial, string account_email)
|
|
{
|
|
var online = new List<(string name, string url, string plugin, int index)>();
|
|
|
|
var init = ModInit.StarLight;
|
|
if (init.enable && !init.rip)
|
|
{
|
|
string url = init.overridehost;
|
|
if (string.IsNullOrEmpty(url))
|
|
url = $"{host}/starlight";
|
|
|
|
online.Add((init.displayname, url, "starlight", init.displayindex));
|
|
}
|
|
|
|
return online;
|
|
}
|
|
}
|
|
}
|