Skip to content

Commit

Permalink
Исправления для корректной работы методов, связанных с треками (#20)
Browse files Browse the repository at this point in the history
* New enum value

* YTrackAlbumPair ToString for user uploaded tracks
  • Loading branch information
PrepConcedeITIS committed Jan 26, 2023
1 parent 3f0e2c9 commit 886792f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/Yandex.Music.Api/Models/Common/YTrackSource.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
using System.ComponentModel;
using System.Runtime.Serialization;

namespace Yandex.Music.Api.Models.Common
{
public enum YTrackSource
{
[EnumMember(Value = "OWN")]
Own
Own,

[EnumMember(Value = "UGC")]
[Description("User Generated Content")]
UGC
}
}
9 changes: 8 additions & 1 deletion src/Yandex.Music.Api/Models/Track/YTrackAlbumPair.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Text;

namespace Yandex.Music.Api.Models.Track
{
Expand All @@ -9,7 +10,13 @@ public class YTrackAlbumPair : IEquatable<YTrackAlbumPair>

public override string ToString()
{
return $"{Id}:{AlbumId}";
var sb = new StringBuilder(Id);
if (string.IsNullOrWhiteSpace(AlbumId))
return sb.ToString();

sb.Append(':');
sb.Append(AlbumId);
return sb.ToString();
}

#region IEquatable
Expand Down

0 comments on commit 886792f

Please sign in to comment.