Removed v7 import shit
This commit is contained in:
@@ -336,8 +336,7 @@ namespace AyaNova.Util
|
||||
|
||||
///////////////////////////////////////////
|
||||
// Check if DB is empty
|
||||
// CALLED BY LICENSE CONTROLLER AND LICENSE.CS FOR TRIAL Request check
|
||||
// Also called by Import
|
||||
// CALLED BY LICENSE CONTROLLER AND LICENSE.CS FOR TRIAL Request check
|
||||
internal static async Task<bool> DBIsEmptyAsync(AyContext ct, ILogger _log)
|
||||
{
|
||||
//TODO: This needs to be way more thorough, only the main tables though, no need to get crazy with it
|
||||
|
||||
@@ -188,40 +188,40 @@ namespace AyaNova.Util
|
||||
return zipEntries;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Import utility - get individual files specified in zip archive as JSON objects
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="zipFileName">Name of utility zip import file</param>
|
||||
/// <param name="entryList">Name of entries in utility file archive to fetch</param>
|
||||
/// <returns></returns>
|
||||
internal static List<JObject> ZipGetUtilityArchiveEntriesAsJsonObjects(List<string> entryList, string zipFileName)
|
||||
{
|
||||
List<JObject> jList = new List<JObject>();
|
||||
var zipPath = GetFullPathForUtilityFile(zipFileName);
|
||||
using (ZipArchive archive = ZipFile.OpenRead(zipPath))
|
||||
{
|
||||
foreach (string importFileName in entryList)
|
||||
{
|
||||
ZipArchiveEntry entry = archive.GetEntry(importFileName);
|
||||
if (entry != null)
|
||||
{
|
||||
//stream entry into a new jobject and add it to the list
|
||||
StreamReader reader = new StreamReader(entry.Open());
|
||||
string text = reader.ReadToEnd();
|
||||
var j = JObject.Parse(text);
|
||||
// /// <summary>
|
||||
// /// Import utility - get individual files specified in zip archive as JSON objects
|
||||
// ///
|
||||
// /// </summary>
|
||||
// /// <param name="zipFileName">Name of utility zip import file</param>
|
||||
// /// <param name="entryList">Name of entries in utility file archive to fetch</param>
|
||||
// /// <returns></returns>
|
||||
// internal static List<JObject> ZipGetUtilityArchiveEntriesAsJsonObjects(List<string> entryList, string zipFileName)
|
||||
// {
|
||||
// List<JObject> jList = new List<JObject>();
|
||||
// var zipPath = GetFullPathForUtilityFile(zipFileName);
|
||||
// using (ZipArchive archive = ZipFile.OpenRead(zipPath))
|
||||
// {
|
||||
// foreach (string importFileName in entryList)
|
||||
// {
|
||||
// ZipArchiveEntry entry = archive.GetEntry(importFileName);
|
||||
// if (entry != null)
|
||||
// {
|
||||
// //stream entry into a new jobject and add it to the list
|
||||
// StreamReader reader = new StreamReader(entry.Open());
|
||||
// string text = reader.ReadToEnd();
|
||||
// var j = JObject.Parse(text);
|
||||
|
||||
//Here add v7 import file name as sometimes it's needed later (Translations)
|
||||
j.Add("V7_SOURCE_FILE_NAME", JToken.FromObject(importFileName));
|
||||
jList.Add(j);
|
||||
}
|
||||
}
|
||||
// //Here add v7 import file name as sometimes it's needed later (Translations)
|
||||
// j.Add("V7_SOURCE_FILE_NAME", JToken.FromObject(importFileName));
|
||||
// jList.Add(j);
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
return jList;
|
||||
// return jList;
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
|
||||
#endregion Zip handling
|
||||
|
||||
Reference in New Issue
Block a user