mirror of
https://github.com/muskit/MercuryConverter.git
synced 2026-06-02 12:14:26 -07:00
sanitize song folder name
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Media;
|
||||
using MercuryConverter.Utility;
|
||||
using SaturnData.Notation.Core;
|
||||
using SaturnData.Notation.Serialization;
|
||||
using UAssetAPI.PropertyTypes.Objects;
|
||||
@@ -29,7 +26,7 @@ public class Song
|
||||
public required float PreviewTime { get; set; }
|
||||
public required float PreviewLen { get; set; }
|
||||
public string SourceName => Consts.NUM_SOURCE[Source];
|
||||
public string FolderName => $"{Artist} - {Name}";
|
||||
public string FolderName => $"{Utils.RemoveInvalidFileNameChars(Artist)} - {Utils.RemoveInvalidFileNameChars(Name)}";
|
||||
|
||||
/// <summary>
|
||||
/// Pairs of level and chart designer.
|
||||
|
||||
@@ -56,7 +56,6 @@ public class Exporter
|
||||
{
|
||||
var audioSourcePath = Database.AudioPaths[audioKey];
|
||||
|
||||
// Copy/convert audio -- TODO
|
||||
switch (options.AudioFormat)
|
||||
{
|
||||
case AudioFormat.WAV:
|
||||
|
||||
@@ -89,4 +89,9 @@ public static class Utils
|
||||
return (bool)_ffmpegAvailable!;
|
||||
}
|
||||
}
|
||||
|
||||
public static string RemoveInvalidFileNameChars(string filename)
|
||||
{
|
||||
return string.Concat(filename.Split(['/', '\\', '\"', '\'']));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user