mirror of
https://github.com/fiso64/slsk-batchdl.git
synced 2025-01-08 06:22:43 +00:00
fix album-aggregate null reference exception
This commit is contained in:
parent
4d8fd7672b
commit
146066ebca
2 changed files with 7 additions and 4 deletions
|
@ -12,6 +12,7 @@ namespace Models
|
|||
public bool needSkipExistingAfterSearch = false;
|
||||
public bool gotoNextAfterSearch = false;
|
||||
public bool enablesIndexByDefault = false;
|
||||
public bool preprocessTracks = true;
|
||||
public string? defaultFolderName = null;
|
||||
|
||||
public Config config = null!;
|
||||
|
@ -47,8 +48,8 @@ namespace Models
|
|||
SetDefaults();
|
||||
}
|
||||
|
||||
public TrackListEntry(List<List<Track>> list, Track source, bool needSourceSearch = false, bool sourceCanBeSkipped = false,
|
||||
bool needSkipExistingAfterSearch = false, bool gotoNextAfterSearch = false, string? defaultFoldername = null)
|
||||
public TrackListEntry(List<List<Track>> list, Track source, Config config, bool needSourceSearch = false, bool sourceCanBeSkipped = false,
|
||||
bool needSkipExistingAfterSearch = false, bool gotoNextAfterSearch = false, string? defaultFoldername = null, bool preprocessTracks = true)
|
||||
{
|
||||
this.list = list;
|
||||
this.source = source;
|
||||
|
@ -57,6 +58,8 @@ namespace Models
|
|||
this.needSkipExistingAfterSearch = needSkipExistingAfterSearch;
|
||||
this.gotoNextAfterSearch = gotoNextAfterSearch;
|
||||
this.defaultFolderName = defaultFoldername;
|
||||
this.config = config;
|
||||
this.preprocessTracks = preprocessTracks;
|
||||
}
|
||||
|
||||
public void SetDefaults()
|
||||
|
|
|
@ -263,7 +263,7 @@ static partial class Program
|
|||
var tle = trackLists[i];
|
||||
var config = tle.config;
|
||||
|
||||
PreprocessTracks(tle);
|
||||
if (tle.preprocessTracks) PreprocessTracks(tle);
|
||||
if (!enableParallelSearch) tle.PrintLines();
|
||||
|
||||
var existing = new List<Track>();
|
||||
|
@ -357,7 +357,7 @@ static partial class Program
|
|||
foreach (var item in res)
|
||||
{
|
||||
var newSource = new Track(tle.source) { Type = TrackType.Album };
|
||||
var albumTle = new TrackListEntry(item, newSource, needSourceSearch: false, sourceCanBeSkipped: true);
|
||||
var albumTle = new TrackListEntry(item, newSource, config, needSourceSearch: false, sourceCanBeSkipped: true, preprocessTracks: false);
|
||||
albumTle.defaultFolderName = tle.defaultFolderName;
|
||||
trackLists.AddEntry(albumTle);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue