Song server: central song library with on-demand downloads
- VocaluxeSongServer: ASP.NET Core server that scans an UltraStar library and serves the song list (ETag), single files (Range) and zip bundles; optional API key; Dockerfile and Gitea workflow for git.disi.dev/projects/vocaluxe-song-server - Game: config section SongServer (Url, ApiKey). At song loading, the song text files are mirrored into a local cache that is loaded like a song folder; without connection the last library is used - VocaluxeLib: CSongFiles hook for all song file access; media are downloaded on demand (covers in the background, preview audio, everything before singing with progress in the sing screen) - Tests for scanner, API and downloads (incl. resume); AGENTS.md for the fork Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
cf2fa796e2
commit
efcc63a640
29 files changed
+1753
-20
No files matched your search
@@ -338,6 +338,41 @@ namespace VocaluxeLib.Songs
|
||||
return Path.Combine(Folder, Video);
|
||||
}
|
||||
|
||||
public string GetCover()
|
||||
{
|
||||
return Cover == "" ? "" : Path.Combine(Folder, Cover);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Full paths of the files needed to sing the song: audio (or instrumental/vocals), video, backgrounds and cover.
|
||||
/// </summary>
|
||||
public List<string> GetMediaFiles(bool includeVideo = true)
|
||||
{
|
||||
var files = new List<string> { GetMP3() };
|
||||
if (HasInstrumental())
|
||||
{
|
||||
files.Add(GetInstrumental());
|
||||
}
|
||||
|
||||
if (HasVocals())
|
||||
{
|
||||
files.Add(GetVocals());
|
||||
}
|
||||
|
||||
if (includeVideo && !string.IsNullOrEmpty(Video))
|
||||
{
|
||||
files.Add(GetVideo());
|
||||
}
|
||||
|
||||
files.AddRange(BackgroundFileNames.Where(bg => !string.IsNullOrEmpty(bg)).Select(bg => Path.Combine(Folder, bg)));
|
||||
if (Cover != "")
|
||||
{
|
||||
files.Add(GetCover());
|
||||
}
|
||||
|
||||
return files;
|
||||
}
|
||||
|
||||
public void LoadSmallCover()
|
||||
{
|
||||
if (_CoverTextureSmall != null)
|
||||
@@ -347,7 +382,9 @@ namespace VocaluxeLib.Songs
|
||||
|
||||
if (Cover != "")
|
||||
{
|
||||
if (CBase.DataBase.GetCover(Path.Combine(Folder, Cover), ref _CoverTextureSmall, CBase.Config.GetCoverSize()))
|
||||
// Songs from a song server: download the cover first (cover loading runs on background threads).
|
||||
CSongFiles.EnsureLocal(GetCover());
|
||||
if (CBase.DataBase.GetCover(GetCover(), ref _CoverTextureSmall, CBase.Config.GetCoverSize()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user