Added playlist renaming functionality.
This commit is contained in:
@@ -9,6 +9,19 @@ public partial class PlaylistItemViewModel : ObservableObject
|
||||
{
|
||||
public Playlist Playlist { get; private set; }
|
||||
|
||||
private string _name = string.Empty;
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return _name;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _name, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string _summary = string.Empty;
|
||||
public string Summary
|
||||
{
|
||||
@@ -41,6 +54,8 @@ public partial class PlaylistItemViewModel : ObservableObject
|
||||
|
||||
private void UpdateMetaData()
|
||||
{
|
||||
Name = Playlist.Name ?? "Untitled Playlist";
|
||||
|
||||
TimeSpan total = TimeSpan.FromSeconds(Playlist.Songs.Sum(s => s.Song.Length.TotalSeconds));
|
||||
Summary = $"{Playlist.Songs.Count} songs / {total:h\\:mm\\:ss}";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user