mirror of
https://github.com/fiso64/slsk-batchdl.git
synced 2024-12-22 06:22:41 +00:00
fix empty string bug
This commit is contained in:
parent
43ae7a2754
commit
c503deae6e
1 changed files with 7 additions and 1 deletions
|
@ -440,7 +440,7 @@ class Program
|
|||
Track[] tmp = new Track[tracks.Count];
|
||||
tracks.CopyTo(tmp);
|
||||
var tracksStart = tmp.ToList();
|
||||
|
||||
|
||||
createM3u |= m3uOnly;
|
||||
List<string> m3uLines = Enumerable.Repeat("", tracksStart.Count).ToList();
|
||||
|
||||
|
@ -1232,7 +1232,10 @@ class Program
|
|||
|
||||
public bool NameSatisfies(string fname, string tname)
|
||||
{
|
||||
if (string.IsNullOrEmpty(tname))
|
||||
return false;
|
||||
tname = tname.Split('-', StringSplitOptions.RemoveEmptyEntries).Last();
|
||||
|
||||
foreach (var word in dangerWords)
|
||||
{
|
||||
if (fname.Contains(word, StringComparison.OrdinalIgnoreCase) ^ tname.Contains(word, StringComparison.OrdinalIgnoreCase))
|
||||
|
@ -1410,6 +1413,9 @@ class Program
|
|||
{
|
||||
string[] ignore = new string[] { " ", "_", "-", ".", "(", ")" };
|
||||
string searchName = track.TrackTitle.Replace(ignore, "");
|
||||
if (string.IsNullOrEmpty(searchName))
|
||||
searchName = track.TrackTitle;
|
||||
|
||||
searchName = RemoveInvalidChars(searchName, "");
|
||||
|
||||
var matchingFiles = collection
|
||||
|
|
Loading…
Reference in a new issue