Skip to content

Commit

Permalink
Fix keys using 'id' field
Browse files Browse the repository at this point in the history
  • Loading branch information
Xwilarg committed Dec 31, 2024
1 parent 37815df commit f3a39d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions backend/api/Controllers/DataController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public DataController(ILogger<RootController> logger, WebsiteManager manager, Ht
info = Serialization.Deserialize<EuphoniaInfo>(System.IO.File.ReadAllText($"{folder}/info.json"));

// ID Lookup
Song? song = info.Musics.FirstOrDefault(x => x.Id == key);
Song? song = info.Musics.FirstOrDefault(x => x.Key == key);

// Key lookup
song ??= info.Musics.FirstOrDefault(x => $"{x.Name}_{x.Artist}_{x.Type}" == key);
Expand Down Expand Up @@ -334,7 +334,7 @@ public IActionResult UploadSong([FromForm]YoutubeForm data)
// Create Song class
var m = new Song
{
Id = Guid.NewGuid().ToString(),
Key = Guid.NewGuid().ToString(),
Album = albumKey,
Artist = artist,
Name = songName,
Expand Down
2 changes: 1 addition & 1 deletion backend/common/EuphoniaInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class Album

public class Song
{
public string Id { set; get; }
public string Key { set; get; }
public string Name { set; get; }
public string Path { set; get; }
public string Artist { set; get; }
Expand Down

0 comments on commit f3a39d2

Please sign in to comment.