-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6fd0d96
commit e84c64e
Showing
1 changed file
with
50 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -206,31 +206,65 @@ public static void CreateLists(ILogger log) | |
// docxGenerator.GenerateDocx("brailleBook-" + Dates.GetCurrentYear(Dates.StartOfPreviousMonth) + "-" + Dates.GetMonthNameInSwedish(Dates.StartOfPreviousMonth) + ".docx", books); | ||
} | ||
List<string> generatedFiles = new List<string>(); | ||
|
||
if (talkingBooks.Any()) | ||
if (Environment.GetEnvironmentVariable("WEBSITE_CONTENTSHARE") != null) | ||
{ | ||
string talkingBooksFile = "nyf-tb-" + DateTime.Now.Year + "-" + DateTime.Now.Month.ToString("00") + ".xml"; | ||
generatedFiles.Add(talkingBooksFile); | ||
if (talkingBooks.Any()) | ||
{ | ||
string tempPath = Path.GetTempPath(); | ||
|
||
string talkingBooksNoLinksFile = "nyf-tb-no-links-" + DateTime.Now.Year + "-" + DateTime.Now.Month.ToString("00") + ".xml"; | ||
generatedFiles.Add(talkingBooksNoLinksFile); | ||
string talkingBooksFile = Path.Combine(tempPath, $"nyf-tb-{DateTime.Now:yyyy-MM}.xml"); | ||
generatedFiles.Add(talkingBooksFile); | ||
|
||
string talkingBooksSwedishOnlyFile = "nyf-tb-no-links-swedishonly-" + DateTime.Now.Year + "-" + DateTime.Now.Month.ToString("00") + ".xml"; | ||
generatedFiles.Add(talkingBooksSwedishOnlyFile); | ||
} | ||
string talkingBooksNoLinksFile = Path.Combine(tempPath, $"nyf-tb-no-links-{DateTime.Now:yyyy-MM}.xml"); | ||
generatedFiles.Add(talkingBooksNoLinksFile); | ||
|
||
if (brailleBooks.Any()) | ||
string talkingBooksSwedishOnlyFile = Path.Combine(tempPath, $"nyf-tb-no-links-swedishonly-{DateTime.Now:yyyy-MM}.xml"); | ||
generatedFiles.Add(talkingBooksSwedishOnlyFile); | ||
} | ||
|
||
if (brailleBooks.Any()) | ||
{ | ||
string tempPath = Path.GetTempPath(); | ||
|
||
string brailleBooksFile = Path.Combine(tempPath, $"nyf-punkt-{DateTime.Now:yyyy-MM}.xml"); | ||
generatedFiles.Add(brailleBooksFile); | ||
|
||
string brailleBooksNoLinksFile = Path.Combine(tempPath, $"nyf-punkt-no-links-{DateTime.Now:yyyy-MM}.xml"); | ||
generatedFiles.Add(brailleBooksNoLinksFile); | ||
|
||
string brailleBooksSwedishOnlyFile = Path.Combine(tempPath, $"nyf-punkt-no-links-swedishonly-{DateTime.Now:yyyy-MM}.xml"); | ||
generatedFiles.Add(brailleBooksSwedishOnlyFile); | ||
} | ||
} | ||
else | ||
{ | ||
string brailleBooksFile = "nyf-punkt-" + DateTime.Now.Year + "-" + DateTime.Now.Month.ToString("00") + ".xml"; | ||
generatedFiles.Add(brailleBooksFile); | ||
if (talkingBooks.Any()) | ||
{ | ||
string talkingBooksFile = "nyf-tb-" + DateTime.Now.Year + "-" + DateTime.Now.Month.ToString("00") + ".xml"; | ||
generatedFiles.Add(talkingBooksFile); | ||
|
||
string brailleBooksNoLinksFile = "nyf-punkt-no-links-" + DateTime.Now.Year + "-" + DateTime.Now.Month.ToString("00") + ".xml"; | ||
generatedFiles.Add(brailleBooksNoLinksFile); | ||
string talkingBooksNoLinksFile = "nyf-tb-no-links-" + DateTime.Now.Year + "-" + DateTime.Now.Month.ToString("00") + ".xml"; | ||
generatedFiles.Add(talkingBooksNoLinksFile); | ||
|
||
string brailleBooksSwedishOnlyFile = "nyf-punkt-no-links-swedishonly-" + DateTime.Now.Year + "-" + DateTime.Now.Month.ToString("00") + ".xml"; | ||
generatedFiles.Add(brailleBooksSwedishOnlyFile); | ||
string talkingBooksSwedishOnlyFile = "nyf-tb-no-links-swedishonly-" + DateTime.Now.Year + "-" + DateTime.Now.Month.ToString("00") + ".xml"; | ||
generatedFiles.Add(talkingBooksSwedishOnlyFile); | ||
} | ||
|
||
if (brailleBooks.Any()) | ||
{ | ||
string brailleBooksFile = "nyf-punkt-" + DateTime.Now.Year + "-" + DateTime.Now.Month.ToString("00") + ".xml"; | ||
generatedFiles.Add(brailleBooksFile); | ||
|
||
string brailleBooksNoLinksFile = "nyf-punkt-no-links-" + DateTime.Now.Year + "-" + DateTime.Now.Month.ToString("00") + ".xml"; | ||
generatedFiles.Add(brailleBooksNoLinksFile); | ||
|
||
string brailleBooksSwedishOnlyFile = "nyf-punkt-no-links-swedishonly-" + DateTime.Now.Year + "-" + DateTime.Now.Month.ToString("00") + ".xml"; | ||
generatedFiles.Add(brailleBooksSwedishOnlyFile); | ||
} | ||
} | ||
|
||
|
||
|
||
if (generatedFiles.Any()) | ||
{ | ||
SendEmailWithAttachments(generatedFiles.ToArray(), "[email protected]"); | ||
|