mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-30 03:25:47 -05:00
Migrator fixes
This commit is contained in:
parent
6f846751c7
commit
b847212375
2 changed files with 10 additions and 18 deletions
|
@ -108,23 +108,6 @@ class SongMigrator
|
||||||
trace('Migrating song metadata from FNF Legacy.');
|
trace('Migrating song metadata from FNF Legacy.');
|
||||||
|
|
||||||
var songData:FNFLegacy = cast jsonData;
|
var songData:FNFLegacy = cast jsonData;
|
||||||
// Some cleanup
|
|
||||||
if (Std.isOfType(jsonData.song.notes, Array))
|
|
||||||
{
|
|
||||||
jsonData.song.notes = haxe.ds.Either.Left(jsonData.song.notes);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
jsonData.song.notes = haxe.ds.Either.Right(jsonData.song.notes);
|
|
||||||
}
|
|
||||||
if (Std.isOfType(jsonData.song.speed, Float))
|
|
||||||
{
|
|
||||||
jsonData.song.speed = haxe.ds.Either.Left(jsonData.song.speed);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
jsonData.song.speed = haxe.ds.Either.Right(jsonData.song.speed);
|
|
||||||
}
|
|
||||||
|
|
||||||
var songMetadata:SongMetadata = new SongMetadata('Import', 'Kawai Sprite', 'default');
|
var songMetadata:SongMetadata = new SongMetadata('Import', 'Kawai Sprite', 'default');
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,16 @@ class SerializerUtil
|
||||||
*/
|
*/
|
||||||
public static function fromJSONBytes(input:Bytes):Dynamic
|
public static function fromJSONBytes(input:Bytes):Dynamic
|
||||||
{
|
{
|
||||||
return Json.parse(input.toString());
|
try
|
||||||
|
{
|
||||||
|
return Json.parse(input.toString());
|
||||||
|
}
|
||||||
|
catch (e:Dynamic)
|
||||||
|
{
|
||||||
|
trace('An error occurred while parsing JSON from byte data');
|
||||||
|
trace(e);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue