Skip to content

Commit

Permalink
Merge pull request #430 from gabriel-tandil/patch-1
Browse files Browse the repository at this point in the history
Update SongMetaBuilder.cs. trim white spaces
  • Loading branch information
achimmihca authored Mar 20, 2024
2 parents eb95584 + 351427e commit 5c20a65
Showing 1 changed file with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,49 +155,50 @@ public static SongMeta ParseFile(string path, out List<SongIssue> songIssues, En
);
foreach (var item in otherFields)
{
string trimmedValue = item.Value.Trim();
switch (item.Key)
{
case "background":
songMeta.Background = item.Value;
songMeta.Background = trimmedValue;
break;
case "cover":
songMeta.Cover = item.Value;
songMeta.Cover = trimmedValue;
break;
case "edition":
songMeta.Edition = item.Value;
songMeta.Edition = trimmedValue;
break;
case "end":
songMeta.End = ConvertToFloat(item.Value);
songMeta.End = ConvertToFloat(trimmedValue);
break;
case "gap":
songMeta.Gap = ConvertToFloat(item.Value);
songMeta.Gap = ConvertToFloat(trimmedValue);
break;
case "genre":
songMeta.Genre = item.Value;
songMeta.Genre = trimmedValue;
break;
case "language":
songMeta.Language = item.Value;
songMeta.Language = trimmedValue;
break;
case "previewstart":
songMeta.PreviewStart = ConvertToFloat(item.Value);
songMeta.PreviewStart = ConvertToFloat(trimmedValue);
break;
case "previewend":
songMeta.PreviewEnd = ConvertToFloat(item.Value);
songMeta.PreviewEnd = ConvertToFloat(trimmedValue);
break;
case "start":
songMeta.Start = ConvertToFloat(item.Value);
songMeta.Start = ConvertToFloat(trimmedValue);
break;
case "video":
songMeta.Video = item.Value;
songMeta.Video = trimmedValue;
break;
case "videogap":
songMeta.VideoGap = ConvertToFloat(item.Value);
songMeta.VideoGap = ConvertToFloat(trimmedValue);
break;
case "year":
songMeta.Year = ConvertToUInt32(item.Value);
songMeta.Year = ConvertToUInt32(trimmedValue);
break;
default:
songMeta.SetUnknownHeaderEntry(item.Key, item.Value);
songMeta.SetUnknownHeaderEntry(item.Key, trimmedValue);
break;
}
}
Expand Down

0 comments on commit 5c20a65

Please sign in to comment.