mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-07 10:14:13 -04:00
Adding custom extensions for provider's logo
This commit is contained in:
parent
9b6aa68472
commit
a620cc1818
@ -12,7 +12,7 @@
|
||||
<Company>SDG</Company>
|
||||
<PackageLicenseExpression>GPL-3.0-or-later</PackageLicenseExpression>
|
||||
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
|
||||
<PackageVersion>1.0.24</PackageVersion>
|
||||
<PackageVersion>1.0.25</PackageVersion>
|
||||
<IncludeSymbols>true</IncludeSymbols>
|
||||
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||
<LangVersion>default</LangVersion>
|
||||
|
@ -9,7 +9,7 @@ namespace Kyoo.Models
|
||||
public string Slug { get; set; }
|
||||
public string Name { get; set; }
|
||||
[SerializeAs("{HOST}/api/providers/{Slug}/logo")] public string Logo { get; set; }
|
||||
|
||||
[SerializeIgnore] public string LogoExtension { get; set; }
|
||||
[LoadableRelation] public virtual ICollection<Library> Libraries { get; set; }
|
||||
|
||||
#if ENABLE_INTERNAL_LINKS
|
||||
|
@ -142,16 +142,16 @@ namespace Kyoo.Controllers
|
||||
if (people == null)
|
||||
throw new ArgumentNullException(nameof(people));
|
||||
string thumbPath = Path.GetFullPath(Path.Combine(_peoplePath, $"{people.Slug}.jpg"));
|
||||
if (!thumbPath.StartsWith(_peoplePath))
|
||||
return Task.FromResult<string>(null);
|
||||
return Task.FromResult(thumbPath);
|
||||
return Task.FromResult(thumbPath.StartsWith(_peoplePath) ? thumbPath : null);
|
||||
}
|
||||
|
||||
public Task<string> GetProviderLogo(ProviderID provider)
|
||||
{
|
||||
if (provider == null)
|
||||
throw new ArgumentNullException(nameof(provider));
|
||||
string thumbPath = Path.GetFullPath(Path.Combine(_providerPath, $"{provider.Slug}.png"));
|
||||
// TODO add a image's type on the provider to allow svg here.
|
||||
// TODO fix trailer display.
|
||||
string thumbPath = Path.GetFullPath(Path.Combine(_providerPath, $"{provider.Slug}.{provider.LogoExtension}"));
|
||||
return Task.FromResult(thumbPath.StartsWith(_providerPath) ? thumbPath : null);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user