Better handle multiple tags respecting US format (#878)

* Better handle multiple tags respecting US format

Based on unversioned, V1 & V2 of US formats : https://github.com/UltraStar-Deluxe/format
Should address #623
Creator now takes multiple values
Maintain backward compatibility

* Update file path properties to match US formats
This commit is contained in:
Quentin Bray authored and GitHub committed 2026-06-23 21:04:59 +02:00
1 parent cae67eb4ab
commit 1bba340cf8
10 files changed
+97 -160

No files matched your search

+32 -40
View File
@@ -98,12 +98,12 @@ namespace VocaluxeLib.Songs
public string FileName = string.Empty;
public bool Relative;
public string MP3FileName = string.Empty;
public string InstrumentalFileName = string.Empty;
public string VocalsFileName = string.Empty;
public string CoverFileName = string.Empty;
public readonly List<string> BackgroundFileNames = new List<string>();
public string VideoFileName = string.Empty;
public string Audio = string.Empty;
public string Instrumental = string.Empty;
public string Vocals = string.Empty;
public string Cover = string.Empty;
public readonly List<string> BackgroundFileNames = new();
public string Video = string.Empty;
public EAspect VideoAspect = EAspect.Automatic;
@@ -120,14 +120,11 @@ namespace VocaluxeLib.Songs
return _CoverTextureSmall;
}
set { _CoverTextureSmall = value; }
}
public CTextureRef CoverTextureBig
{
get { return _CoverTextureBig ?? _CoverTextureSmall; }
set { _CoverTextureBig = value; }
get => _CoverTextureBig ?? _CoverTextureSmall;
}
public string Title = string.Empty;
@@ -136,11 +133,10 @@ namespace VocaluxeLib.Songs
public string TitleSorting = string.Empty;
public string ArtistSorting = string.Empty;
public string Creator = "";
public string Version = "";
public string Length = ""; //Length set in song file, SHOULD match actual song length but is more a hint
public string Source = "";
public readonly List<String> UnknownTags = new List<string>();
public readonly List<string> UnknownTags = new();
/// <summary>
/// Start of the song in s (s in txt)
@@ -168,27 +164,24 @@ namespace VocaluxeLib.Songs
private readonly bool _Visible = true;
private readonly int _CatIndex = -1;
private readonly bool _Selected;
public bool IsDuet
{
get { return Notes.VoiceCount > 1; }
}
public bool IsDuet => Notes.VoiceCount > 1;
public bool IsRap = false;
public readonly List<string> Editions = new List<string>();
public readonly List<string> Genres = new List<string>();
public readonly List<string> Tags = new List<string>();
public readonly List<string> Creators = new();
public readonly List<string> Editions = new();
public readonly List<string> Genres = new();
public readonly List<string> Tags = new();
public readonly List<string> Languages = new();
public string Album = "";
public string Year = "";
public readonly List<string> Languages = new List<string>();
public int DataBaseSongId = -1;
public DateTime DateAdded = DateTime.Today;
public int NumPlayed;
public int NumPlayedSession;
// Notes
public readonly CNotes Notes = new CNotes();
public readonly CNotes Notes = new();
public IList<EGameMode> AvailableGameModes
{
@@ -241,12 +234,12 @@ namespace VocaluxeLib.Songs
FileName = song.FileName;
Relative = song.Relative;
MP3FileName = song.MP3FileName;
InstrumentalFileName = song.InstrumentalFileName;
VocalsFileName = song.VocalsFileName;
CoverFileName = song.CoverFileName;
Audio = song.Audio;
Instrumental = song.Instrumental;
Vocals = song.Vocals;
Cover = song.Cover;
BackgroundFileNames = song.BackgroundFileNames;
VideoFileName = song.VideoFileName;
Video = song.Video;
VideoAspect = song.VideoAspect;
NotesLoaded = song.NotesLoaded;
@@ -256,7 +249,6 @@ namespace VocaluxeLib.Songs
ArtistSorting = song.ArtistSorting;
TitleSorting = song.TitleSorting;
Creator = song.Creator;
Version = song.Version;
Length = song.Length;
Source = song.Source;
@@ -276,14 +268,14 @@ namespace VocaluxeLib.Songs
_CatIndex = song._CatIndex;
_Selected = song._Selected;
Creators = new List<string>(song.Creators);
Editions = new List<string>(song.Editions);
Genres = new List<string>(song.Genres);
Tags = new List<string>(song.Tags);
Languages = new List<string>(song.Languages);
Album = song.Album;
Year = song.Year;
Languages = new List<string>(song.Languages);
DataBaseSongId = song.DataBaseSongId;
DateAdded = song.DateAdded;
NumPlayed = song.NumPlayed;
@@ -318,32 +310,32 @@ namespace VocaluxeLib.Songs
public string GetMP3()
{
return Path.Combine(Folder, MP3FileName);
return Path.Combine(Folder, Audio);
}
public string GetInstrumental()
{
return Path.Combine(Folder, InstrumentalFileName);
return Path.Combine(Folder, Instrumental);
}
public bool HasInstrumental()
{
return !string.IsNullOrEmpty(InstrumentalFileName);
return !string.IsNullOrEmpty(Instrumental);
}
public string GetVocals()
{
return Path.Combine(Folder, VocalsFileName);
return Path.Combine(Folder, Vocals);
}
public bool HasVocals()
{
return !string.IsNullOrEmpty(VocalsFileName);
return !string.IsNullOrEmpty(Vocals);
}
public string GetVideo()
{
return Path.Combine(Folder, VideoFileName);
return Path.Combine(Folder, Video);
}
public void LoadSmallCover()
@@ -353,9 +345,9 @@ namespace VocaluxeLib.Songs
return;
}
if (CoverFileName != "")
if (Cover != "")
{
if (CBase.DataBase.GetCover(Path.Combine(Folder, CoverFileName), ref _CoverTextureSmall, CBase.Config.GetCoverSize()))
if (CBase.DataBase.GetCover(Path.Combine(Folder, Cover), ref _CoverTextureSmall, CBase.Config.GetCoverSize()))
{
return;
}
@@ -366,7 +358,7 @@ namespace VocaluxeLib.Songs
private void _CheckFiles()
{
if (CoverFileName == "")
if (Cover == "")
{
var files = CHelper.ListImageFiles(Folder);
foreach (var file in files)
@@ -374,7 +366,7 @@ namespace VocaluxeLib.Songs
if (file.ContainsIgnoreCase("[CO]") &&
(file.ContainsIgnoreCase(Title) || file.ContainsIgnoreCase(Artist)))
{
CoverFileName = file;
Cover = file;
}
}
}