-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
8 changed files
with
214 additions
and
119 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace CdRipper.Tagging | ||
{ | ||
public class AlbumIdentification | ||
{ | ||
private readonly List<TrackIdentification> _tracks; | ||
|
||
public AlbumIdentification() | ||
{ | ||
_tracks = new List<TrackIdentification>(); | ||
} | ||
|
||
public IEnumerable<TrackIdentification> Tracks { get { return _tracks; } } | ||
public string Id { get; set; } | ||
public string AlbumArtist { get; set; } | ||
public string AlbumTitle { get; set; } | ||
public int NumberOfTracks { get; set; } | ||
public string Year { get; set; } | ||
|
||
public void AddTrack(TrackIdentification track) | ||
{ | ||
track.SetAlbum(this); | ||
_tracks.Add(track); | ||
} | ||
|
||
public static AlbumIdentification GetEmpty(int numberOfTracks) | ||
{ | ||
var album = new AlbumIdentification | ||
{ | ||
Id = null, | ||
AlbumArtist = "Unknown Artist", | ||
AlbumTitle = "Unknown Album", | ||
NumberOfTracks = numberOfTracks | ||
}; | ||
|
||
foreach (var trackNumber in Enumerable.Range(1, numberOfTracks)) | ||
{ | ||
album.AddTrack(TrackIdentification.GetEmpty(album, trackNumber)); | ||
} | ||
|
||
return album; | ||
} | ||
} | ||
} |
Oops, something went wrong.