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