Skip to content

Commit 80ccba6

Browse files
committed
Fixed #14 by stopping the .gitignore being over zealous and ignoring one of the models folders.
P.S: I did not accidently delete every model with the word "Release" in it's filename, meaning i had to remake them >:(
1 parent 798296e commit 80ccba6

File tree

7 files changed

+91
-2
lines changed

7 files changed

+91
-2
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ bld/
2222
[Oo]bj/
2323
[Ll]og/
2424

25+
!VndbSharp/Models/*
26+
2527
# Visual Studio 2015 cache/options directory
2628
.vs/
2729
# Uncomment if you have tasks that create the project's static files in wwwroot

VndbConsoleCore/Program.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public async Task MainAsync(String[] args)
3939
// await this.GetVisualNovelListAsync();
4040
// await this.GetWishlistAsync();
4141

42-
await this.GetFilterExampleAsync();
42+
// await this.GetFilterExampleAsync();
4343
// await this.GetInvalidFlagsExampleAsync();
4444
// await this.GetErrorExampleAsync();
4545

@@ -164,7 +164,8 @@ public async Task GetReleaseAsync()
164164
var englishRelease = releases.FirstOrDefault(r => r.Languages[0] == "en" && r.Type == ReleaseType.Complete);
165165

166166
// Yeah i dunno. Here's a primitive example!
167-
Console.WriteLine($"Ever17 had a {englishRelease.MinimumAge}+ English Release on {englishRelease.Released}, on {englishRelease.Platforms[0]}.");
167+
Console.WriteLine($"Ever17 had a {englishRelease.MinimumAge}+ English Release on {englishRelease.Released} " +
168+
$"that was {englishRelease.Type}, on {englishRelease.Platforms[0]}.");
168169

169170
if (releases.HasMore) // This doesn't really work since we only show 1
170171
Console.WriteLine("And other more releases!");

VndbSharp/Models/Release/Media.cs

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System;
2+
3+
namespace VndbSharp.Models.Release
4+
{
5+
public class Media
6+
{
7+
public String Medium { get; private set; }
8+
public UInt32? Quantity { get; private set; }
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
using Newtonsoft.Json;
3+
using VndbSharp.Models.Common;
4+
5+
namespace VndbSharp.Models.Release
6+
{
7+
public class ProducerRelease : ProducerCommon
8+
{
9+
[JsonProperty("developer")]
10+
public Boolean IsDeveloper { get; private set; }
11+
[JsonProperty("publisher")]
12+
public Boolean IsPublisher { get; private set; }
13+
}
14+
}

VndbSharp/Models/Release/Release.cs

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
using System;
2+
using System.Collections.ObjectModel;
3+
using Newtonsoft.Json;
4+
using VndbSharp.Models.Common;
5+
6+
namespace VndbSharp.Models.Release
7+
{
8+
public class Release
9+
{
10+
public UInt32 Id { get; private set; }
11+
[JsonProperty("title")]
12+
public String Name { get; private set; }
13+
[JsonProperty("original")]
14+
public String OriginalName { get; private set; }
15+
public SimpleDate Released { get; private set; }
16+
public ReleaseType Type { get; private set; }
17+
[JsonProperty("patch")]
18+
public Boolean IsPatch { get; private set; }
19+
[JsonProperty("freeware")]
20+
public Boolean IsFreeware { get; private set; }
21+
[JsonProperty("doujin")]
22+
public Boolean IsDoujin { get; private set; }
23+
public ReadOnlyCollection<String> Languages { get; private set; }
24+
public String Website { get; private set; }
25+
public String Notes { get; private set; } // Possibly rename to description
26+
[JsonProperty("minage")]
27+
public UInt32? MinimumAge { get; private set; }
28+
/// <summary>
29+
/// JAN/UPC/EAN code.
30+
/// </summary>
31+
public String Gtin { get; private set; }
32+
public String Catalog { get; private set; }
33+
public ReadOnlyCollection<String> Platforms { get; private set; }
34+
public ReadOnlyCollection<Media> Media { get; private set; }
35+
[JsonProperty("vn")]
36+
public ReadOnlyCollection<VisualNovelMetadata> VisualNovels { get; private set; }
37+
public ReadOnlyCollection<ProducerRelease> Producers { get; private set; }
38+
}
39+
}
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace VndbSharp.Models.Release
2+
{
3+
public enum ReleaseType
4+
{
5+
Trial = 0,
6+
Partial = 1,
7+
Complete = 2,
8+
}
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
using Newtonsoft.Json;
3+
4+
namespace VndbSharp.Models.Release
5+
{
6+
public class VisualNovelMetadata
7+
{
8+
public UInt32 Id { get; private set; }
9+
[JsonProperty("title")]
10+
public String Name { get; private set; }
11+
[JsonProperty("original")]
12+
public String OriginalName { get; private set; }
13+
}
14+
}

0 commit comments

Comments
 (0)