From bac5e958bf5ff9d22204722087635efc265de725 Mon Sep 17 00:00:00 2001 From: Timothy Baldridge Date: Fri, 10 Jan 2020 06:25:01 -0700 Subject: [PATCH] Primary key string --- Wabbajack.BuildServer/Models/Jobs/IndexJob.cs | 2 +- Wabbajack.Lib/Downloaders/AbstractDownloadState.cs | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Wabbajack.BuildServer/Models/Jobs/IndexJob.cs b/Wabbajack.BuildServer/Models/Jobs/IndexJob.cs index 857a7500..003a8eeb 100644 --- a/Wabbajack.BuildServer/Models/Jobs/IndexJob.cs +++ b/Wabbajack.BuildServer/Models/Jobs/IndexJob.cs @@ -19,7 +19,7 @@ namespace Wabbajack.BuildServer.Models.Jobs public class IndexJob : AJobPayload { public Archive Archive { get; set; } - public override string Description => $"Index ${Archive.State.PrimaryKey} and save the download/file state"; + public override string Description => $"Index ${Archive.State.PrimaryKeyString} and save the download/file state"; public override bool UsesNexus { get => Archive.State is NexusDownloader.State; } public override async Task Execute(DBContext db, AppSettings settings) { diff --git a/Wabbajack.Lib/Downloaders/AbstractDownloadState.cs b/Wabbajack.Lib/Downloaders/AbstractDownloadState.cs index ee9d5e49..39a0bb81 100644 --- a/Wabbajack.Lib/Downloaders/AbstractDownloadState.cs +++ b/Wabbajack.Lib/Downloaders/AbstractDownloadState.cs @@ -35,7 +35,18 @@ namespace Wabbajack.Lib.Downloaders } public abstract object[] PrimaryKey { get; } - + + public string PrimaryKeyString + { + get + { + var pk = new List(); + pk.Add(AbstractDownloadState.TypeToName[GetType()]); + pk.AddRange(PrimaryKey); + var pk_str = string.Join("|",pk.Select(p => p.ToString())); + return pk_str; + } + } ///