mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-02-10 07:58:39 -05:00
add configurable playlist names env var
This commit is contained in:
@@ -120,3 +120,9 @@ SPOTIFY_IMPORT_SYNC_WINDOW_HOURS=2
|
|||||||
# Get IDs from Jellyfin playlist URLs: https://jellyfin.example.com/web/#/details?id=PLAYLIST_ID
|
# Get IDs from Jellyfin playlist URLs: https://jellyfin.example.com/web/#/details?id=PLAYLIST_ID
|
||||||
# Example: SPOTIFY_IMPORT_PLAYLIST_IDS=4383a46d8bcac3be2ef9385053ea18df,ba50e26c867ec9d57ab2f7bf24cfd6b0
|
# Example: SPOTIFY_IMPORT_PLAYLIST_IDS=4383a46d8bcac3be2ef9385053ea18df,ba50e26c867ec9d57ab2f7bf24cfd6b0
|
||||||
SPOTIFY_IMPORT_PLAYLIST_IDS=
|
SPOTIFY_IMPORT_PLAYLIST_IDS=
|
||||||
|
|
||||||
|
# Playlist names (comma-separated, must match Spotify Import plugin format)
|
||||||
|
# IMPORTANT: Plugin replaces spaces with underscores in filenames
|
||||||
|
# Must be in same order as SPOTIFY_IMPORT_PLAYLIST_IDS
|
||||||
|
# Example: SPOTIFY_IMPORT_PLAYLIST_NAMES=Discover_Weekly,Release_Radar
|
||||||
|
SPOTIFY_IMPORT_PLAYLIST_NAMES=
|
||||||
|
|||||||
@@ -1993,21 +1993,15 @@ public class JellyfinController : ControllerBase
|
|||||||
|
|
||||||
var results = new Dictionary<string, object>();
|
var results = new Dictionary<string, object>();
|
||||||
|
|
||||||
// Hardcoded playlist names that match the Spotify Import plugin format
|
for (int i = 0; i < _spotifySettings.PlaylistIds.Count; i++)
|
||||||
// Note: Plugin replaces spaces with underscores in filenames
|
|
||||||
var playlistNames = new Dictionary<string, string>
|
|
||||||
{
|
|
||||||
{ "4383a46d8bcac3be2ef9385053ea18df", "Discover_Weekly" },
|
|
||||||
{ "ba50e26c867ec9d57ab2f7bf24cfd6b0", "Release_Radar" }
|
|
||||||
};
|
|
||||||
|
|
||||||
foreach (var playlistId in _spotifySettings.PlaylistIds)
|
|
||||||
{
|
{
|
||||||
|
var playlistId = _spotifySettings.PlaylistIds[i];
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Use hardcoded name or fall back to ID
|
// Use configured name if available, otherwise use ID
|
||||||
var playlistName = playlistNames.ContainsKey(playlistId)
|
var playlistName = i < _spotifySettings.PlaylistNames.Count
|
||||||
? playlistNames[playlistId]
|
? _spotifySettings.PlaylistNames[i]
|
||||||
: playlistId;
|
: playlistId;
|
||||||
|
|
||||||
_logger.LogInformation("Fetching missing tracks for {Playlist} (ID: {Id})", playlistName, playlistId);
|
_logger.LogInformation("Fetching missing tracks for {Playlist} (ID: {Id})", playlistName, playlistId);
|
||||||
|
|||||||
@@ -36,4 +36,12 @@ public class SpotifyImportSettings
|
|||||||
/// Get IDs from Jellyfin playlist URLs
|
/// Get IDs from Jellyfin playlist URLs
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<string> PlaylistIds { get; set; } = new();
|
public List<string> PlaylistIds { get; set; } = new();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Comma-separated list of playlist names (must match Spotify Import plugin format)
|
||||||
|
/// Example: "Discover_Weekly,Release_Radar"
|
||||||
|
/// Must be in same order as PlaylistIds
|
||||||
|
/// Plugin replaces spaces with underscores in filenames
|
||||||
|
/// </summary>
|
||||||
|
public List<string> PlaylistNames { get; set; } = new();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user