Skip to content

Commit

Permalink
V.A.T.S.
Browse files Browse the repository at this point in the history
  • Loading branch information
madelson committed May 15, 2024
1 parent 0de0ef8 commit 4e03a40
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
Binary file added cards/V.A.T.S. ART.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cards/V.A.T.S..png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions cards/cards.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,11 @@
"name": "Idolized",
"contributor": "madelson",
"mtgCardBuilderId": "133195"
},
"0008": {
"name": "V.A.T.S.",
"nickname": "Sudden Slaughter",
"contributor": "madelson",
"mtgCardBuilderId": "134057"
}
}
3 changes: 2 additions & 1 deletion gallery/BuildGallery.linq
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
</Query>

bool BustCache = false;
TimeSpan Expiry = TimeSpan.FromDays(7);

async Task Main()
{
Expand Down Expand Up @@ -175,7 +176,7 @@ record CardFace(string Name, Dictionary<string, string> Image_Uris);
async Task<T> CacheAsync<T>(string key, Func<Task<T>> valueFactory)
{
var cacheFile = Path.Combine(Path.GetTempPath(), Util.CurrentQuery.Name, $"{key}.json");
if (!BustCache && File.Exists(cacheFile) && File.GetLastWriteTimeUtc(cacheFile) + TimeSpan.FromHours(24) >= DateTime.Now)
if (!BustCache && File.Exists(cacheFile) && File.GetLastWriteTimeUtc(cacheFile) + Expiry >= DateTime.Now)
{
try { return JsonConvert.DeserializeObject<T>(File.ReadAllText(cacheFile)); }
catch (Exception ex) { ex.Dump($"Cache file read error for {key}"); }
Expand Down
2 changes: 1 addition & 1 deletion gallery/galleryData.js

Large diffs are not rendered by default.

0 comments on commit 4e03a40

Please sign in to comment.