1
0
Fork 0
mirror of https://github.com/fiso64/slsk-batchdl.git synced 2025-01-08 22:42:42 +00:00

fix album-aggregate null reference exception

This commit is contained in:
fiso64 2024-12-23 16:20:58 +01:00
parent 4d8fd7672b
commit 146066ebca
2 changed files with 7 additions and 4 deletions

View file

@ -12,6 +12,7 @@ namespace Models
public bool needSkipExistingAfterSearch = false; public bool needSkipExistingAfterSearch = false;
public bool gotoNextAfterSearch = false; public bool gotoNextAfterSearch = false;
public bool enablesIndexByDefault = false; public bool enablesIndexByDefault = false;
public bool preprocessTracks = true;
public string? defaultFolderName = null; public string? defaultFolderName = null;
public Config config = null!; public Config config = null!;
@ -47,8 +48,8 @@ namespace Models
SetDefaults(); SetDefaults();
} }
public TrackListEntry(List<List<Track>> list, Track source, bool needSourceSearch = false, bool sourceCanBeSkipped = false, 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 needSkipExistingAfterSearch = false, bool gotoNextAfterSearch = false, string? defaultFoldername = null, bool preprocessTracks = true)
{ {
this.list = list; this.list = list;
this.source = source; this.source = source;
@ -57,6 +58,8 @@ namespace Models
this.needSkipExistingAfterSearch = needSkipExistingAfterSearch; this.needSkipExistingAfterSearch = needSkipExistingAfterSearch;
this.gotoNextAfterSearch = gotoNextAfterSearch; this.gotoNextAfterSearch = gotoNextAfterSearch;
this.defaultFolderName = defaultFoldername; this.defaultFolderName = defaultFoldername;
this.config = config;
this.preprocessTracks = preprocessTracks;
} }
public void SetDefaults() public void SetDefaults()

View file

@ -263,7 +263,7 @@ static partial class Program
var tle = trackLists[i]; var tle = trackLists[i];
var config = tle.config; var config = tle.config;
PreprocessTracks(tle); if (tle.preprocessTracks) PreprocessTracks(tle);
if (!enableParallelSearch) tle.PrintLines(); if (!enableParallelSearch) tle.PrintLines();
var existing = new List<Track>(); var existing = new List<Track>();
@ -357,7 +357,7 @@ static partial class Program
foreach (var item in res) foreach (var item in res)
{ {
var newSource = new Track(tle.source) { Type = TrackType.Album }; 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; albumTle.defaultFolderName = tle.defaultFolderName;
trackLists.AddEntry(albumTle); trackLists.AddEntry(albumTle);
} }