mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-10-08 14:05:02 -04:00
feat(providers): split streaming priority from downloads
This commit is contained in:
13 files changed
+195
-30
No files matched your search
@@ -49,6 +49,7 @@ public sealed class RuntimeEnvConfigurationTests : IDisposable
|
||||
[Theory]
|
||||
[InlineData("MULTI_PROVIDER_METADATA_ORDER")]
|
||||
[InlineData("MULTI_PROVIDER_DOWNLOAD_ORDER")]
|
||||
[InlineData("MULTI_PROVIDER_STREAMING_ORDER")]
|
||||
[InlineData("MULTI_PROVIDER_PLAYLIST_ORDER")]
|
||||
[InlineData("MULTI_PROVIDER_LYRICS_ORDER")]
|
||||
[InlineData("MULTI_PROVIDER_ENABLED_SEARCH")]
|
||||
|
||||
@@ -166,7 +166,7 @@ public class AdminUiController : ControllerBase
|
||||
Name = "Apple Music",
|
||||
Icon = "applemusic",
|
||||
Status = string.IsNullOrWhiteSpace(_appleMusicSettings.BaseUrl) ? "needs_config" : "needs_login",
|
||||
Categories = ["metadata", "download", "playlist"],
|
||||
Categories = ["metadata", "download", "streaming", "playlist"],
|
||||
ConfigSchema =
|
||||
[
|
||||
Field("APPLE_MUSIC_AIO_URL", "Sidecar URL", "url", "appleMusic.baseUrl"),
|
||||
@@ -179,7 +179,7 @@ public class AdminUiController : ControllerBase
|
||||
Name = "Deezer",
|
||||
Icon = "deezer",
|
||||
Status = string.IsNullOrWhiteSpace(_deezerSettings.Arl) ? "needs_config" : "configured",
|
||||
Categories = ["metadata", "download", "playlist"],
|
||||
Categories = ["metadata", "download", "streaming", "playlist"],
|
||||
ConfigSchema =
|
||||
[
|
||||
Field("DEEZER_ARL", "ARL cookie", "password", "deezer.arl", sensitive: true),
|
||||
@@ -194,7 +194,7 @@ public class AdminUiController : ControllerBase
|
||||
Name = "Qobuz",
|
||||
Icon = "qobuz",
|
||||
Status = string.IsNullOrWhiteSpace(_qobuzSettings.UserAuthToken) ? "needs_config" : "configured",
|
||||
Categories = ["metadata", "download", "playlist"],
|
||||
Categories = ["metadata", "download", "streaming", "playlist"],
|
||||
ConfigSchema =
|
||||
[
|
||||
Field("QOBUZ_USER_AUTH_TOKEN", "User auth token", "password", "qobuz.userAuthToken", sensitive: true),
|
||||
@@ -209,7 +209,7 @@ public class AdminUiController : ControllerBase
|
||||
Name = "SquidWTF",
|
||||
Icon = "squidwtf",
|
||||
Status = string.IsNullOrWhiteSpace(_squidWtfSettings.Quality) ? "unknown" : "configured",
|
||||
Categories = ["metadata", "download", "playlist"],
|
||||
Categories = ["metadata", "download", "streaming", "playlist"],
|
||||
ConfigSchema =
|
||||
[
|
||||
Field("SQUIDWTF_QUALITY", "Quality", "select", "squidWtf.quality", ["LOW", "HIGH", "LOSSLESS"]),
|
||||
@@ -264,6 +264,8 @@ public class AdminUiController : ControllerBase
|
||||
"spotify,applemusic,deezer,qobuz,squidwtf"),
|
||||
Priority("download", "Download priority", "MULTI_PROVIDER_DOWNLOAD_ORDER", null,
|
||||
"applemusic,deezer,qobuz,squidwtf"),
|
||||
Priority("streaming", "Streaming priority", "MULTI_PROVIDER_STREAMING_ORDER", null,
|
||||
"applemusic,deezer,qobuz,squidwtf"),
|
||||
Priority("playlist", "Playlist discovery priority", "MULTI_PROVIDER_PLAYLIST_ORDER", "MULTI_PROVIDER_ENABLED_PLAYLIST",
|
||||
"spotify,applemusic,deezer,qobuz,squidwtf"),
|
||||
Priority("lyrics", "Lyrics priority", "MULTI_PROVIDER_LYRICS_ORDER", null,
|
||||
|
||||
@@ -149,6 +149,7 @@ public class ConfigController : ControllerBase
|
||||
{
|
||||
metadataOrder = GetEnvString(envVars, "MULTI_PROVIDER_METADATA_ORDER", "spotify,applemusic,deezer,qobuz,squidwtf"),
|
||||
downloadOrder = GetEnvString(envVars, "MULTI_PROVIDER_DOWNLOAD_ORDER", "applemusic,deezer,qobuz,squidwtf"),
|
||||
streamingOrder = GetEnvString(envVars, "MULTI_PROVIDER_STREAMING_ORDER", "applemusic,deezer,qobuz,squidwtf"),
|
||||
playlistOrder = GetEnvString(envVars, "MULTI_PROVIDER_PLAYLIST_ORDER", "spotify,applemusic,deezer,qobuz,squidwtf"),
|
||||
lyricsOrder = GetEnvString(envVars, "MULTI_PROVIDER_LYRICS_ORDER", "spotify,lyricsplus,lrclib"),
|
||||
enabledSearch = GetEnvString(envVars, "MULTI_PROVIDER_ENABLED_SEARCH", "spotify,applemusic,deezer,qobuz,squidwtf"),
|
||||
|
||||
@@ -67,15 +67,15 @@ public class MultiProviderDownloadService : IDownloadService
|
||||
|
||||
public async Task<Stream> DownloadAndStreamAsync(string externalProvider, string externalId, Common.StreamQuality? qualityOverride = null, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var downloadProviders = GetPrioritizedDownloadProviders();
|
||||
if (downloadProviders.Count == 0)
|
||||
var streamingProviders = GetPrioritizedStreamingProviders();
|
||||
if (streamingProviders.Count == 0)
|
||||
{
|
||||
throw new InvalidOperationException("No download providers are currently enabled and healthy.");
|
||||
throw new InvalidOperationException("No streaming providers are currently enabled and healthy.");
|
||||
}
|
||||
|
||||
Exception? lastException = null;
|
||||
|
||||
foreach (var targetProvider in downloadProviders)
|
||||
foreach (var targetProvider in streamingProviders)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -172,6 +172,11 @@ public class MultiProviderDownloadService : IDownloadService
|
||||
return _statusManager.GetEnabledDownloadProviders();
|
||||
}
|
||||
|
||||
private IReadOnlyList<string> GetPrioritizedStreamingProviders()
|
||||
{
|
||||
return _statusManager.GetEnabledStreamingProviders();
|
||||
}
|
||||
|
||||
private IDownloadService? GetDownloadServiceByName(string name)
|
||||
{
|
||||
var normalizedName = name.ToLowerInvariant();
|
||||
|
||||
@@ -72,6 +72,14 @@ public class ProviderStatusManager
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public IReadOnlyList<string> GetEnabledStreamingProviders()
|
||||
{
|
||||
var order = GetStreamingOrder();
|
||||
return order
|
||||
.Where(p => IsProviderHealthy(p))
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public IReadOnlyList<string> GetEnabledLyricsProviders()
|
||||
{
|
||||
return GetLyricsOrder();
|
||||
@@ -142,23 +150,27 @@ public class ProviderStatusManager
|
||||
|
||||
private List<string> GetDownloadOrder()
|
||||
{
|
||||
var val = _configuration["MULTI_PROVIDER_DOWNLOAD_ORDER"] ?? "applemusic,deezer,qobuz,squidwtf";
|
||||
return val.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries)
|
||||
.Select(s => s.ToLowerInvariant())
|
||||
.ToList();
|
||||
return GetProviderOrder("MULTI_PROVIDER_DOWNLOAD_ORDER", "applemusic,deezer,qobuz,squidwtf");
|
||||
}
|
||||
|
||||
private List<string> GetStreamingOrder()
|
||||
{
|
||||
return GetProviderOrder("MULTI_PROVIDER_STREAMING_ORDER", "applemusic,deezer,qobuz,squidwtf");
|
||||
}
|
||||
|
||||
private List<string> GetPlaylistOrder()
|
||||
{
|
||||
var val = _configuration["MULTI_PROVIDER_PLAYLIST_ORDER"] ?? "spotify,applemusic,deezer,qobuz,squidwtf";
|
||||
return val.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries)
|
||||
.Select(s => s.ToLowerInvariant())
|
||||
.ToList();
|
||||
return GetProviderOrder("MULTI_PROVIDER_PLAYLIST_ORDER", "spotify,applemusic,deezer,qobuz,squidwtf");
|
||||
}
|
||||
|
||||
private List<string> GetLyricsOrder()
|
||||
{
|
||||
var val = _configuration["MULTI_PROVIDER_LYRICS_ORDER"] ?? "spotify,lyricsplus,lrclib";
|
||||
return GetProviderOrder("MULTI_PROVIDER_LYRICS_ORDER", "spotify,lyricsplus,lrclib");
|
||||
}
|
||||
|
||||
private List<string> GetProviderOrder(string key, string fallback)
|
||||
{
|
||||
var val = _configuration[key] ?? fallback;
|
||||
return val.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries)
|
||||
.Select(s => s.ToLowerInvariant())
|
||||
.ToList();
|
||||
|
||||
@@ -90,6 +90,7 @@ public static class RuntimeEnvConfiguration
|
||||
|
||||
["MULTI_PROVIDER_METADATA_ORDER"] = ["MULTI_PROVIDER_METADATA_ORDER"],
|
||||
["MULTI_PROVIDER_DOWNLOAD_ORDER"] = ["MULTI_PROVIDER_DOWNLOAD_ORDER"],
|
||||
["MULTI_PROVIDER_STREAMING_ORDER"] = ["MULTI_PROVIDER_STREAMING_ORDER"],
|
||||
["MULTI_PROVIDER_PLAYLIST_ORDER"] = ["MULTI_PROVIDER_PLAYLIST_ORDER"],
|
||||
["MULTI_PROVIDER_LYRICS_ORDER"] = ["MULTI_PROVIDER_LYRICS_ORDER"],
|
||||
["MULTI_PROVIDER_ENABLED_SEARCH"] = ["MULTI_PROVIDER_ENABLED_SEARCH"],
|
||||
|
||||
@@ -516,8 +516,8 @@ tr:last-child td {
|
||||
display: inline-grid;
|
||||
place-items: center;
|
||||
flex: 0 0 auto;
|
||||
min-width: 72px;
|
||||
height: 32px;
|
||||
width: 76px;
|
||||
height: 34px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
background: var(--surface-elevated);
|
||||
@@ -527,27 +527,31 @@ tr:last-child td {
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
.provider-logo img {
|
||||
display: block;
|
||||
max-width: 58px;
|
||||
max-height: 20px;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.provider-spotify {
|
||||
color: #062b15;
|
||||
background: #1ed760;
|
||||
border-color: #1ed760;
|
||||
background: #0d1f15;
|
||||
border-color: rgba(30, 215, 96, 0.35);
|
||||
}
|
||||
|
||||
.provider-applemusic {
|
||||
color: #fff;
|
||||
background: linear-gradient(135deg, #fa233b, #fb5c74);
|
||||
border-color: #fb5c74;
|
||||
background: #241416;
|
||||
border-color: rgba(250, 36, 60, 0.36);
|
||||
}
|
||||
|
||||
.provider-deezer {
|
||||
color: #fff;
|
||||
background: linear-gradient(135deg, #ff0092, #ffed00 55%, #00c7f2);
|
||||
border-color: transparent;
|
||||
background: #20131d;
|
||||
border-color: rgba(255, 0, 146, 0.36);
|
||||
}
|
||||
|
||||
.provider-qobuz {
|
||||
color: #fff;
|
||||
background: #141414;
|
||||
border-color: rgba(255, 255, 255, 0.18);
|
||||
}
|
||||
|
||||
.provider-squidwtf {
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<svg fill="#FA243C" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Apple Music</title><path d="M23.994 6.124a9.23 9.23 0 00-.24-2.19c-.317-1.31-1.062-2.31-2.18-3.043a5.022 5.022 0 00-1.877-.726 10.496 10.496 0 00-1.564-.15c-.04-.003-.083-.01-.124-.013H5.986c-.152.01-.303.017-.455.026-.747.043-1.49.123-2.193.4-1.336.53-2.3 1.452-2.865 2.78-.192.448-.292.925-.363 1.408-.056.392-.088.785-.1 1.18 0 .032-.007.062-.01.093v12.223c.01.14.017.283.027.424.05.815.154 1.624.497 2.373.65 1.42 1.738 2.353 3.234 2.801.42.127.856.187 1.293.228.555.053 1.11.06 1.667.06h11.03a12.5 12.5 0 001.57-.1c.822-.106 1.596-.35 2.295-.81a5.046 5.046 0 001.88-2.207c.186-.42.293-.87.37-1.324.113-.675.138-1.358.137-2.04-.002-3.8 0-7.595-.003-11.393zm-6.423 3.99v5.712c0 .417-.058.827-.244 1.206-.29.59-.76.962-1.388 1.14-.35.1-.706.157-1.07.173-.95.045-1.773-.6-1.943-1.536a1.88 1.88 0 011.038-2.022c.323-.16.67-.25 1.018-.324.378-.082.758-.153 1.134-.24.274-.063.457-.23.51-.516a.904.904 0 00.02-.193c0-1.815 0-3.63-.002-5.443a.725.725 0 00-.026-.185c-.04-.15-.15-.243-.304-.234-.16.01-.318.035-.475.066-.76.15-1.52.303-2.28.456l-2.325.47-1.374.278c-.016.003-.032.01-.048.013-.277.077-.377.203-.39.49-.002.042 0 .086 0 .13-.002 2.602 0 5.204-.003 7.805 0 .42-.047.836-.215 1.227-.278.64-.77 1.04-1.434 1.233-.35.1-.71.16-1.075.172-.96.036-1.755-.6-1.92-1.544-.14-.812.23-1.685 1.154-2.075.357-.15.73-.232 1.108-.31.287-.06.575-.116.86-.177.383-.083.583-.323.6-.714v-.15c0-2.96 0-5.922.002-8.882 0-.123.013-.25.042-.37.07-.285.273-.448.546-.518.255-.066.515-.112.774-.165.733-.15 1.466-.296 2.2-.444l2.27-.46c.67-.134 1.34-.27 2.01-.403.22-.043.442-.088.663-.106.31-.025.523.17.554.482.008.073.012.148.012.223.002 1.91.002 3.822 0 5.732z"/></svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
@@ -0,0 +1 @@
|
||||
<svg fill="#FF0092" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Deezer</title><path d="M.693 10.024c.381 0 .693-1.256.693-2.807 0-1.55-.312-2.807-.693-2.807C.312 4.41 0 5.666 0 7.217s.312 2.808.693 2.808ZM21.038 1.56c-.364 0-.684.805-.91 2.096C19.765 1.446 19.184 0 18.526 0c-.78 0-1.464 2.036-1.784 5-.312-2.158-.788-3.536-1.325-3.536-.745 0-1.386 2.704-1.62 6.472-.442-1.932-1.083-3.145-1.793-3.145s-1.35 1.213-1.793 3.145c-.242-3.76-.874-6.463-1.628-6.463-.537 0-1.013 1.378-1.325 3.535C6.938 2.036 6.262 0 5.474 0c-.658 0-1.247 1.447-1.602 3.665-.217-1.291-.546-2.105-.91-2.105-.675 0-1.221 2.807-1.221 6.272 0 3.466.546 6.273 1.221 6.273.277 0 .537-.476.736-1.273.32 2.928.996 4.938 1.776 4.938.606 0 1.143-1.204 1.507-3.11.251 3.622.875 6.195 1.602 6.195.46 0 .875-1.023 1.187-2.677C10.142 21.6 11 24 12.004 24c1.005 0 1.863-2.4 2.235-5.822.312 1.654.727 2.677 1.186 2.677.728 0 1.352-2.573 1.603-6.195.364 1.906.9 3.11 1.507 3.11.78 0 1.455-2.01 1.775-4.938.208.797.46 1.273.737 1.273.675 0 1.22-2.807 1.22-6.273-.008-3.457-.553-6.272-1.23-6.272ZM23.307 10.024c.381 0 .693-1.256.693-2.807 0-1.55-.312-2.807-.693-2.807-.381 0-.693 1.256-.693 2.807s.312 2.808.693 2.808Z"/></svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@@ -0,0 +1 @@
|
||||
<svg enable-background="new 0 0 27 30" height="30" viewBox="0 0 30 30" width="30" xmlns="http://www.w3.org/2000/svg"><title>MusicBrainz Simple Icon</title><g transform="translate(1.5)"><path d="m13 1-12 7v14l12 7z" fill="#ba478f"/><path d="m14 1 12 7v14l-12 7z" fill="#eb743b"/></g></svg>
|
||||
|
After Width: | Height: | Size: 289 B |
@@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
viewBox="0 0 1667.0751 661.28438"
|
||||
version="1.1"
|
||||
id="svg20"
|
||||
width="1667.0751"
|
||||
height="661.28436"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<defs
|
||||
id="defs1">
|
||||
<style
|
||||
id="style1">.cls-1{fill:#fff;}</style>
|
||||
</defs>
|
||||
<g
|
||||
id="Calque_2"
|
||||
data-name="Calque 2"
|
||||
transform="matrix(2.3,0,0,2.3,0.046,0)">
|
||||
<g
|
||||
id="Calque_1-2"
|
||||
data-name="Calque 1">
|
||||
<path
|
||||
class="cls-1"
|
||||
d="m 713.1,192.21 h -60.21 l 68.42,-91.49 A 18.18,18.18 0 0 0 707,71.84 v 0 h -73.38 c -7,0 -13.09,5.66 -13.09,12.65 a 12.64,12.64 0 0 0 12.65,12.64 2.81,2.81 0 0 0 0.29,0 h 59 l -68.27,91.21 a 18.22,18.22 0 0 0 14.53,29.18 h 74.37 c 6.43,0 11.64,-5.67 11.64,-12.66 0,-6.99 -5.21,-12.65 -11.64,-12.65 z"
|
||||
id="path1"
|
||||
style="fill:#000000;fill-opacity:1" />
|
||||
<path
|
||||
class="cls-1"
|
||||
d="m 604.46,83.71 a 0.61,0.61 0 0 0 0,-0.14 12.65,12.65 0 1 0 -25.3,0 c 0,0.05 0,0.1 0,0.15 0,4.21 0,67.65 0,76.46 0,20.57 -12.46,31.69 -34.43,31.69 C 522.76,191.87 509,180.6 509,160 V 83.92 c 0,0 0,-0.1 0,-0.15 0,-0.05 0,-0.09 0,-0.14 v -0.14 0 a 12.64,12.64 0 0 0 -25.27,0 v 0 0.14 c 0,0.05 0,0.1 0,0.14 0,0.04 0,0.1 0,0.15 v 76.26 c 0,31.48 27.48,57 61.1,57 33.62,0 59.75,-25.51 59.75,-57 -0.06,-8.27 -0.11,-72.28 -0.12,-76.47 z"
|
||||
id="path2"
|
||||
style="fill:#000000;fill-opacity:1" />
|
||||
<path
|
||||
class="cls-1"
|
||||
d="M 394.7,70.56 A 72.64,72.64 0 0 0 356.53,81.33 V 115 A 47.69,47.69 0 1 1 347,143.54 v 0 -130.89 a 12.65,12.65 0 1 0 -25.3,0 c 0,0 0,0.1 0,0.15 v 130.74 a 73,73 0 1 0 73,-73 z"
|
||||
id="path3"
|
||||
style="fill:#000000;fill-opacity:1" />
|
||||
<path
|
||||
class="cls-1"
|
||||
d="m 234,70.65 a 73,73 0 1 0 73,73 73,73 0 0 0 -73,-73 z m 0,120.67 A 47.69,47.69 0 1 1 281.67,143.64 47.68,47.68 0 0 1 234,191.32 Z"
|
||||
id="path4"
|
||||
style="fill:#000000;fill-opacity:1" />
|
||||
<path
|
||||
class="cls-1"
|
||||
d="m 73,216.59 a 72.59,72.59 0 0 0 38.16,-10.78 v -33.62 a 47.69,47.69 0 1 1 9.51,-28.58 v 0 130.74 c 0,0 0,0.09 0,0.14 a 12.66,12.66 0 1 0 25.31,0 c 0,-0.05 0,-0.09 0,-0.14 V 143.61 a 73,73 0 1 0 -73,73 z"
|
||||
id="path5"
|
||||
style="fill:#000000;fill-opacity:1" />
|
||||
<path
|
||||
class="cls-1"
|
||||
d="m 170.92,286.89 v -30.44 h 10.89 a 10.52,10.52 0 0 1 7.44,2.6 8.81,8.81 0 0 1 2.81,6.76 9.19,9.19 0 0 1 -6.1,8.79 l 6.93,12.29 h -5.31 l -6.22,-11.59 h -5.75 v 11.59 z m 4.69,-15.64 h 6 a 5.86,5.86 0 0 0 4.06,-1.4 5.81,5.81 0 0 0 0,-7.85 5.85,5.85 0 0 0 -4.26,-1.49 h -5.79 z"
|
||||
id="path6"
|
||||
style="fill:#000000;fill-opacity:1" />
|
||||
<path
|
||||
class="cls-1"
|
||||
d="m 207.16,286.89 v -30.44 h 18 v 4.14 h -13.31 v 8.85 h 11.44 v 4.06 h -11.44 v 9.25 h 13.79 v 4.14 z"
|
||||
id="path7"
|
||||
style="fill:#000000;fill-opacity:1" />
|
||||
<path
|
||||
class="cls-1"
|
||||
d="m 240.22,286.89 v -30.44 h 9.65 a 16.77,16.77 0 0 1 8.27,1.95 13.08,13.08 0 0 1 5.32,5.36 16.5,16.5 0 0 1 1.8,7.85 q 0,7.11 -4.08,11.2 -4.08,4.09 -11.31,4.08 z m 4.69,-4.14 h 4.88 a 10.63,10.63 0 0 0 7.77,-2.88 c 1.95,-1.92 2.92,-4.68 2.92,-8.26 0,-3.58 -1,-6.18 -2.91,-8.12 a 10.57,10.57 0 0 0 -7.78,-2.9 h -4.88 z"
|
||||
id="path8"
|
||||
style="fill:#000000;fill-opacity:1" />
|
||||
<path
|
||||
class="cls-1"
|
||||
d="m 279.19,286.89 v -30.44 h 4.69 v 30.44 z"
|
||||
id="path9"
|
||||
style="fill:#000000;fill-opacity:1" />
|
||||
<path
|
||||
class="cls-1"
|
||||
d="m 298.14,277.55 h 4.56 a 5.23,5.23 0 0 0 1.9,4 8.52,8.52 0 0 0 9.33,0.42 3.77,3.77 0 0 0 1.65,-3.23 4.26,4.26 0 0 0 -0.56,-2.26 4.1,4.1 0 0 0 -1.53,-1.48 9.11,9.11 0 0 0 -2.2,-0.88 l -2.61,-0.71 -2.73,-0.73 a 13.75,13.75 0 0 1 -2.59,-1 9.27,9.27 0 0 1 -2.19,-1.54 6.25,6.25 0 0 1 -1.51,-2.4 9.6,9.6 0 0 1 -0.57,-3.45 7.68,7.68 0 0 1 2.76,-6 10.86,10.86 0 0 1 7.44,-2.43 13.29,13.29 0 0 1 3.81,0.55 11.17,11.17 0 0 1 3.32,1.63 7.67,7.67 0 0 1 2.4,2.86 9.15,9.15 0 0 1 0.92,4.09 H 315 a 4.68,4.68 0 0 0 -1.49,-3.65 6.15,6.15 0 0 0 -4.23,-1.34 6,6 0 0 0 -4.06,1.23 3.83,3.83 0 0 0 -1.41,3 3.56,3.56 0 0 0 0.57,2 3.82,3.82 0 0 0 1.5,1.34 10.65,10.65 0 0 0 2.19,0.84 l 2.62,0.71 2.76,0.74 a 13,13 0 0 1 2.64,1 9.35,9.35 0 0 1 2.2,1.58 6.45,6.45 0 0 1 1.53,2.42 9.75,9.75 0 0 1 0.57,3.47 8.15,8.15 0 0 1 -2.95,6.48 13.55,13.55 0 0 1 -16.11,-0.23 9,9 0 0 1 -3.19,-7.03 z"
|
||||
id="path10"
|
||||
style="fill:#000000;fill-opacity:1" />
|
||||
<path
|
||||
class="cls-1"
|
||||
d="m 333,271.67 a 16.22,16.22 0 0 1 1.19,-6.23 15.15,15.15 0 0 1 3.27,-5 15,15 0 0 1 5,-3.31 16.49,16.49 0 0 1 6.31,-1.21 15,15 0 0 1 9.35,3 14.47,14.47 0 0 1 5.25,7.86 h -5.05 a 8.74,8.74 0 0 0 -3.59,-4.69 10.54,10.54 0 0 0 -6,-1.7 10.77,10.77 0 0 0 -5.56,1.47 10.49,10.49 0 0 0 -3.93,4.08 11.81,11.81 0 0 0 -1.42,5.78 11.22,11.22 0 0 0 3.18,8.08 10.4,10.4 0 0 0 7.79,3.23 10.59,10.59 0 0 0 5.94,-1.68 8.92,8.92 0 0 0 3.61,-4.67 h 5.14 a 14,14 0 0 1 -5.26,7.83 15.31,15.31 0 0 1 -9.43,2.95 16.66,16.66 0 0 1 -6.33,-1.2 14.66,14.66 0 0 1 -5,-3.29 15,15 0 0 1 -3.26,-5 16.37,16.37 0 0 1 -1.2,-6.3 z"
|
||||
id="path11"
|
||||
style="fill:#000000;fill-opacity:1" />
|
||||
<path
|
||||
class="cls-1"
|
||||
d="m 376.18,271.67 a 16.39,16.39 0 0 1 0.78,-5.07 14.85,14.85 0 0 1 2.2,-4.35 16.17,16.17 0 0 1 3.39,-3.37 15,15 0 0 1 4.4,-2.2 16.91,16.91 0 0 1 5.15,-0.78 16.11,16.11 0 0 1 8.12,2.08 14.87,14.87 0 0 1 5.66,5.69 16.07,16.07 0 0 1 2,8 16.46,16.46 0 0 1 -1.19,6.24 15.15,15.15 0 0 1 -3.29,5 15.38,15.38 0 0 1 -5.05,3.31 16.43,16.43 0 0 1 -6.32,1.22 16.66,16.66 0 0 1 -6.33,-1.2 15.08,15.08 0 0 1 -5,-3.29 15.27,15.27 0 0 1 -3.3,-5 16.44,16.44 0 0 1 -1.22,-6.28 z m 4.88,0 a 11.23,11.23 0 0 0 3.13,8.13 11.3,11.3 0 0 0 15.82,0 11.23,11.23 0 0 0 3.13,-8.13 11.75,11.75 0 0 0 -1.42,-5.77 10.38,10.38 0 0 0 -3.94,-4.08 11.64,11.64 0 0 0 -11.36,0 10.47,10.47 0 0 0 -3.95,4.08 11.85,11.85 0 0 0 -1.41,5.77 z"
|
||||
id="path12"
|
||||
style="fill:#000000;fill-opacity:1" />
|
||||
<path
|
||||
class="cls-1"
|
||||
d="m 419.21,256.45 h 5.08 l 8.57,24.71 h 0.26 l 8.7,-24.71 H 447 l -11.4,30.44 h -5.18 z"
|
||||
id="path13"
|
||||
style="fill:#000000;fill-opacity:1" />
|
||||
<path
|
||||
class="cls-1"
|
||||
d="m 460.32,286.89 v -30.44 h 18 v 4.14 H 465 v 8.85 h 11.44 v 4.06 H 465 v 9.25 h 13.8 v 4.14 z"
|
||||
id="path14"
|
||||
style="fill:#000000;fill-opacity:1" />
|
||||
<path
|
||||
class="cls-1"
|
||||
d="m 493.37,286.89 v -30.44 h 10.89 a 10.52,10.52 0 0 1 7.44,2.6 8.78,8.78 0 0 1 2.81,6.76 9.2,9.2 0 0 1 -6.09,8.79 l 6.92,12.29 H 510 l -6.22,-11.59 h -5.76 v 11.59 z m 4.69,-15.64 h 6 a 5.81,5.81 0 0 0 4.05,-1.4 5.78,5.78 0 0 0 0,-7.85 5.82,5.82 0 0 0 -4.25,-1.49 h -5.8 z"
|
||||
id="path15"
|
||||
style="fill:#000000;fill-opacity:1" />
|
||||
<path
|
||||
class="cls-1"
|
||||
d="m 550.13,286.89 v -30.44 h 5.52 L 566.21,281 h 0.25 l 9.65,-24.52 h 5.47 v 30.44 H 577 v -20.85 h -0.26 l -8.24,20.82 H 564 l -9,-21 h -0.28 v 21 z"
|
||||
id="path16"
|
||||
style="fill:#000000;fill-opacity:1" />
|
||||
<path
|
||||
class="cls-1"
|
||||
d="m 597.56,275.77 v -19.32 h 4.69 v 19.27 a 7.69,7.69 0 0 0 1.81,5.43 7.93,7.93 0 0 0 10.45,0 7.74,7.74 0 0 0 1.83,-5.46 V 256.45 H 621 v 19.27 a 11.69,11.69 0 0 1 -3.16,8.53 11.5,11.5 0 0 1 -8.58,3.21 q -5.47,0 -8.6,-3.18 a 11.6,11.6 0 0 1 -3.1,-8.51 z"
|
||||
id="path17"
|
||||
style="fill:#000000;fill-opacity:1" />
|
||||
<path
|
||||
class="cls-1"
|
||||
d="m 634.84,277.55 h 4.56 a 5.23,5.23 0 0 0 1.9,4 7.27,7.27 0 0 0 4.94,1.61 7.36,7.36 0 0 0 4.39,-1.19 3.77,3.77 0 0 0 1.65,-3.23 4.35,4.35 0 0 0 -0.56,-2.26 4.1,4.1 0 0 0 -1.53,-1.48 9.11,9.11 0 0 0 -2.2,-0.88 l -2.61,-0.71 -2.73,-0.73 a 13.49,13.49 0 0 1 -2.59,-1 9.27,9.27 0 0 1 -2.19,-1.54 6.27,6.27 0 0 1 -1.52,-2.4 9.83,9.83 0 0 1 -0.56,-3.45 7.68,7.68 0 0 1 2.76,-6 10.86,10.86 0 0 1 7.45,-2.39 13.29,13.29 0 0 1 3.81,0.55 11.29,11.29 0 0 1 3.32,1.63 7.67,7.67 0 0 1 2.4,2.86 9.15,9.15 0 0 1 0.92,4.09 h -4.77 a 4.66,4.66 0 0 0 -1.5,-3.65 6.11,6.11 0 0 0 -4.18,-1.38 6,6 0 0 0 -4.06,1.23 3.83,3.83 0 0 0 -1.41,3 3.63,3.63 0 0 0 0.56,2 4,4 0 0 0 1.5,1.34 11,11 0 0 0 2.2,0.84 l 2.62,0.71 2.75,0.74 a 12.89,12.89 0 0 1 2.65,1 9.56,9.56 0 0 1 2.2,1.58 6.56,6.56 0 0 1 1.52,2.42 9.52,9.52 0 0 1 0.58,3.47 8.18,8.18 0 0 1 -2.95,6.48 q -2.94,2.54 -8,2.54 a 11.77,11.77 0 0 1 -8.07,-2.77 9,9 0 0 1 -3.25,-7.03 z"
|
||||
id="path18"
|
||||
style="fill:#000000;fill-opacity:1" />
|
||||
<path
|
||||
class="cls-1"
|
||||
d="m 671.54,286.89 v -30.44 h 4.69 v 30.44 z"
|
||||
id="path19"
|
||||
style="fill:#000000;fill-opacity:1" />
|
||||
<path
|
||||
class="cls-1"
|
||||
d="m 690.13,271.67 a 16.22,16.22 0 0 1 1.19,-6.23 15.28,15.28 0 0 1 3.26,-5 15.09,15.09 0 0 1 5,-3.31 16.58,16.58 0 0 1 6.32,-1.21 15,15 0 0 1 9.35,3 14.52,14.52 0 0 1 5.25,7.86 h -5 a 8.74,8.74 0 0 0 -3.59,-4.69 10.54,10.54 0 0 0 -6,-1.7 10.77,10.77 0 0 0 -5.56,1.47 10.49,10.49 0 0 0 -3.93,4.08 11.81,11.81 0 0 0 -1.42,5.78 11.22,11.22 0 0 0 3.12,8.13 10.39,10.39 0 0 0 7.79,3.23 10.59,10.59 0 0 0 5.94,-1.68 8.92,8.92 0 0 0 3.61,-4.67 h 5.13 a 13.93,13.93 0 0 1 -5.25,7.83 15.31,15.31 0 0 1 -9.43,2.95 16.66,16.66 0 0 1 -6.33,-1.2 14.8,14.8 0 0 1 -5,-3.29 15,15 0 0 1 -3.25,-5 16.37,16.37 0 0 1 -1.2,-6.35 z"
|
||||
id="path20"
|
||||
style="fill:#000000;fill-opacity:1" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 9.2 KiB |
@@ -0,0 +1 @@
|
||||
<svg fill="#1ED760" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Spotify</title><path d="M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.66 0 12 0zm5.521 17.34c-.24.359-.66.48-1.021.24-2.82-1.74-6.36-2.101-10.561-1.141-.418.122-.779-.179-.899-.539-.12-.421.18-.78.54-.9 4.56-1.021 8.52-.6 11.64 1.32.42.18.479.659.301 1.02zm1.44-3.3c-.301.42-.841.6-1.262.3-3.239-1.98-8.159-2.58-11.939-1.38-.479.12-1.02-.12-1.14-.6-.12-.48.12-1.021.6-1.141C9.6 9.9 15 10.561 18.72 12.84c.361.181.54.78.241 1.2zm.12-3.36C15.24 8.4 8.82 8.16 5.16 9.301c-.6.179-1.2-.181-1.38-.721-.18-.601.18-1.2.72-1.381 4.26-1.26 11.28-1.02 15.721 1.621.539.3.719 1.02.419 1.56-.299.421-1.02.599-1.559.3z"/></svg>
|
||||
|
After Width: | Height: | Size: 712 B |
@@ -123,6 +123,12 @@ function providerMark(provider) {
|
||||
return marks[id] || titleCase(provider?.name || provider?.Name || id);
|
||||
}
|
||||
|
||||
function providerLogoUrl(provider) {
|
||||
const id = String(provider?.id || provider?.Id || provider?.name || provider?.Name || "").toLowerCase();
|
||||
const logos = new Set(["spotify", "applemusic", "deezer", "qobuz", "musicbrainz"]);
|
||||
return logos.has(id) ? `/images/providers/${id}.svg` : "";
|
||||
}
|
||||
|
||||
function isAwaitingApple2fa(value) {
|
||||
const state = String(value?.state || value?.login_state || value?.account?.state || "").toLowerCase();
|
||||
return state === "awaiting_2fa";
|
||||
@@ -1500,11 +1506,16 @@ class AllstarrApp extends LitElement {
|
||||
const status = provider.id === "applemusic" && this.appleMusicStatus
|
||||
? (this.appleMusicStatus.logged_in || this.appleMusicStatus.account?.state === "authenticated" ? "configured" : "needs_config")
|
||||
: provider.status;
|
||||
const logoUrl = providerLogoUrl(provider);
|
||||
return html`
|
||||
<div class="card provider-card">
|
||||
<div class="provider-head">
|
||||
<div class="provider-brand">
|
||||
<span class="provider-logo provider-${provider.id}">${providerMark(provider)}</span>
|
||||
<span class="provider-logo provider-${provider.id}">
|
||||
${logoUrl
|
||||
? html`<img src="${logoUrl}" alt="${provider.name} logo">`
|
||||
: providerMark(provider)}
|
||||
</span>
|
||||
<div class="provider-title">
|
||||
<strong>${provider.name}</strong>
|
||||
<span>${provider.id === "musicbrainz" ? "Genre enrichment" : "Provider"}</span>
|
||||
|
||||
Reference in new issue
Block a user