Skip to content

Commit

Permalink
Allow null track names (for single track albums)
Browse files Browse the repository at this point in the history
  • Loading branch information
Metalnem committed Jun 16, 2024
1 parent 071e2fd commit e486c00
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Api/Model/Track.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ namespace Api.Model;
public class Track
{
public string Title { get; set; }
public int TrackNumber { get; set; }
public int? TrackNumber { get; set; }
public string HqAudioUrl { get; set; }
}
2 changes: 1 addition & 1 deletion BandcampDownloader/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private static async Task Download(string username, string password, long albumI
{
foreach (var track in album.Tracks)
{
var fileName = $"{track.TrackNumber:00}. {Utils.GetSafeFileName(track.Title)}.mp3";
var fileName = $"{(track.TrackNumber ?? 1):00}. {Utils.GetSafeFileName(track.Title)}.mp3";
var entry = archive.CreateEntry(fileName);

using var entryStream = entry.Open();
Expand Down

0 comments on commit e486c00

Please sign in to comment.