Skip to content

Commit

Permalink
[Server] Base song IDs on stream URL
Browse files Browse the repository at this point in the history
  • Loading branch information
redstonekasi committed Oct 21, 2023
1 parent 8f6b845 commit 196eb8e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions UwuRadio.Server/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ private static string ToBase60(this ulong num) {
}

public static string ComputeSongId(Song song) {
var buffer = Encoding.UTF8.GetBytes(song.Name.ToLowerInvariant() + "|" + song.Artist.ToLowerInvariant());
var buffer = Encoding.UTF8.GetBytes(song.StreamUrl);
var hash = XXHash.Hash64(buffer);
return hash.ToBase60();
}
}
}

0 comments on commit 196eb8e

Please sign in to comment.