mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-15 01:32:55 -07:00
!wip work in progress for the theme presets
This commit is contained in:
parent
fa774784c0
commit
c8f00c4e8a
11 changed files with 131 additions and 2 deletions
25
src/Ombi.Api.Github/GithubApi.cs
Normal file
25
src/Ombi.Api.Github/GithubApi.cs
Normal file
|
@ -0,0 +1,25 @@
|
|||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using Ombi.Api.Github.Models;
|
||||
|
||||
namespace Ombi.Api.Github
|
||||
{
|
||||
public class GithubApi : IGithubApi
|
||||
{
|
||||
public GithubApi(IApi api)
|
||||
{
|
||||
_api = api;
|
||||
}
|
||||
|
||||
private readonly IApi _api;
|
||||
private const string BaseUrl = "https://api.github.com/";
|
||||
|
||||
public async Task<CakeThemesContainer> GetCakeThemes()
|
||||
{
|
||||
var request = new Request("repos/leram84/layer.Cake/contents/Themes", BaseUrl, HttpMethod.Get);
|
||||
|
||||
return await _api.Request<CakeThemesContainer>(request);
|
||||
}
|
||||
}
|
||||
}
|
10
src/Ombi.Api.Github/IGithubApi.cs
Normal file
10
src/Ombi.Api.Github/IGithubApi.cs
Normal file
|
@ -0,0 +1,10 @@
|
|||
using System.Threading.Tasks;
|
||||
using Ombi.Api.Github.Models;
|
||||
|
||||
namespace Ombi.Api.Github
|
||||
{
|
||||
public interface IGithubApi
|
||||
{
|
||||
Task<CakeThemesContainer> GetCakeThemes();
|
||||
}
|
||||
}
|
29
src/Ombi.Api.Github/Models/CakeThemes.cs
Normal file
29
src/Ombi.Api.Github/Models/CakeThemes.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
namespace Ombi.Api.Github.Models
|
||||
{
|
||||
public class CakeThemesContainer
|
||||
{
|
||||
public CakeThemes[] Themes { get; set; }
|
||||
}
|
||||
|
||||
public class CakeThemes
|
||||
{
|
||||
public string name { get; set; }
|
||||
public string path { get; set; }
|
||||
public string sha { get; set; }
|
||||
public int size { get; set; }
|
||||
public string url { get; set; }
|
||||
public string html_url { get; set; }
|
||||
public string git_url { get; set; }
|
||||
public string download_url { get; set; }
|
||||
public string type { get; set; }
|
||||
public _Links _links { get; set; }
|
||||
}
|
||||
|
||||
public class _Links
|
||||
{
|
||||
public string self { get; set; }
|
||||
public string git { get; set; }
|
||||
public string html { get; set; }
|
||||
}
|
||||
|
||||
}
|
11
src/Ombi.Api.Github/Ombi.Api.Github.csproj
Normal file
11
src/Ombi.Api.Github/Ombi.Api.Github.csproj
Normal file
|
@ -0,0 +1,11 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Ombi.Api\Ombi.Api.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
Loading…
Add table
Add a link
Reference in a new issue