|
16 | 16 | var authors = JsonSerializer.Serialize<IEnumerable<string>>(db.Authors.Select(a => a.Name).ToList().Order(), jsonOptions);
|
17 | 17 | var tags = JsonSerializer.Serialize<IEnumerable<string>>(db.Tags.Select(t => t.Name).ToList().Order(), jsonOptions);
|
18 | 18 | var licences = JsonSerializer.Serialize<IEnumerable<LicenceJsonRecord>>(db.Licences.Select(l => new LicenceJsonRecord(l.Name, l.Text)).ToList().OrderBy(l => l.Name), jsonOptions);
|
19 |
| -var modpacks = JsonSerializer.Serialize<IEnumerable<ModpackJsonRecord>>(db.Modpacks.Select(m => new ModpackJsonRecord(m.Name, m.Author)).ToList().OrderBy(m => m.Name), jsonOptions); |
| 19 | +var objectPacks = JsonSerializer.Serialize<IEnumerable<ObjectPackJsonRecord>>(db.ObjectPacks.Select(m => new ObjectPackJsonRecord(m.Name, m.Description, m.Author)).ToList().OrderBy(m => m.Name), jsonOptions); |
| 20 | +//var scv5Files = JsonSerializer.Serialize<IEnumerable<?>>(db.Licences.Select(l => new LicenceJsonRecord(l.Name, l.Text)).ToList().OrderBy(l => l.Name), jsonOptions); |
| 21 | +//var scv5FilePacks = JsonSerializer.Serialize<IEnumerable<SCV5FilePackJsonRecord>>(db.ObjectPacks.Select(m => new SCV5FilePackJsonRecord(m.Name, m.Description, m.Author)).ToList().OrderBy(m => m.Name), jsonOptions); |
20 | 22 |
|
21 | 23 | var objs = new List<ObjectMetadata>();
|
22 | 24 |
|
23 | 25 | foreach (var o in db.Objects
|
24 | 26 | .Include(l => l.Licence)
|
25 |
| - .Select(x => new ExpandedTblLocoObject(x, x.Authors, x.Tags, x.Modpacks)) |
| 27 | + .Select(x => new ExpandedTblLocoObject(x, x.Authors, x.Tags, x.ObjectPacks)) |
26 | 28 | .ToList()
|
27 | 29 | .OrderBy(x => x.Object.UniqueName))
|
28 | 30 | {
|
|
33 | 35 | o.Object.Description,
|
34 | 36 | o.Authors.Select(a => a.Name).ToList(),
|
35 | 37 | o.Tags.Select(t => t.Name).ToList(),
|
36 |
| - o.Modpacks.Select(m => m.Name).ToList(), |
| 38 | + o.ObjectPacks.Select(m => m.Name).ToList(), |
37 | 39 | o.Object.Licence?.Name,
|
38 | 40 | o.Object.Availability,
|
39 | 41 | o.Object.ObjectSource);
|
|
47 | 49 | File.WriteAllText("Q:\\Games\\Locomotion\\Database\\authors.json", authors);
|
48 | 50 | File.WriteAllText("Q:\\Games\\Locomotion\\Database\\tags.json", tags);
|
49 | 51 | File.WriteAllText("Q:\\Games\\Locomotion\\Database\\licences.json", licences);
|
50 |
| -File.WriteAllText("Q:\\Games\\Locomotion\\Database\\modpacks.json", modpacks); |
| 52 | +File.WriteAllText("Q:\\Games\\Locomotion\\Database\\objectPacks.json", objectPacks); |
51 | 53 | File.WriteAllText("Q:\\Games\\Locomotion\\Database\\objectMetadata.json", objects);
|
| 54 | +//File.WriteAllText("Q:\\Games\\Locomotion\\Database\\scv5Files.json", objectPacks); |
| 55 | +//File.WriteAllText("Q:\\Games\\Locomotion\\Database\\scv5FilePacks.json", objects); |
52 | 56 |
|
53 | 57 | Console.WriteLine("done");
|
0 commit comments