glax
fa69f4488f
Libraries will be updated on new Chapters downloaded. Added Migrator, for future file-changes
27 lines
726 B
C#
27 lines
726 B
C#
using Newtonsoft.Json;
|
|
|
|
namespace Tranga;
|
|
|
|
public static class Migrate
|
|
{
|
|
private static readonly ushort CurrentVersion = 16;
|
|
public static void Files(TrangaSettings settings)
|
|
{
|
|
settings.version ??= 15;
|
|
switch (settings.version)
|
|
{
|
|
case 15:
|
|
RemoveUpdateLibraryTask(settings);
|
|
break;
|
|
}
|
|
|
|
settings.version = CurrentVersion;
|
|
settings.ExportSettings();
|
|
}
|
|
|
|
private static void RemoveUpdateLibraryTask(TrangaSettings settings)
|
|
{
|
|
List<TrangaTask> tasks = JsonConvert.DeserializeObject<List<TrangaTask>>(settings.tasksFilePath)!;
|
|
tasks.RemoveAll(t => t.task == TrangaTask.Task.UpdateLibraries);
|
|
}
|
|
} |