Skip to content

Commit

Permalink
Build n.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Plenyx committed Apr 16, 2019
1 parent f6cdc4e commit 059737e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
31 changes: 28 additions & 3 deletions FormMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public partial class FormMain : Form
public DPSReportJSONMinimal LastLog { get; set; }
public string ChannelName { get; set; } = "";
public string DPSReportServer { get; set; } = "";
public int Build { get; } = 9;
public int Build { get; } = 10;

// fields
private TwitchIrcClient chatConnect;
Expand Down Expand Up @@ -329,7 +329,7 @@ protected void DoCommandArgs()
{
if (archived)
{
File.Delete(GetLocalDir() + Path.GetFileName(zipfilelocation) + ".zevtc");
File.Delete($"{GetLocalDir()}{Path.GetFileName(zipfilelocation)}.zevtc");
}
}
}
Expand Down Expand Up @@ -768,7 +768,32 @@ private void FormMain_DragDrop(object sender, DragEventArgs e)
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
foreach (string file in files)
{
HttpUploadFileToDPSReport(file, postData, true);
if (File.Exists(file) && (file.EndsWith(".evtc") || file.EndsWith(".zevtc")))
{
bool archived = false;
string zipfilelocation = file;
if (!file.EndsWith(".zevtc"))
{
zipfilelocation = $"{GetLocalDir()}{Path.GetFileName(file)}.zevtc";
using (ZipArchive zipfile = ZipFile.Open(zipfilelocation, ZipArchiveMode.Create)) { zipfile.CreateEntryFromFile(@file, Path.GetFileName(file)); }
archived = true;
}
try
{
HttpUploadFileToDPSReport(zipfilelocation, postData);
}
catch
{
AddToText($">>> Unknown error uploading a log: {zipfilelocation}");
}
finally
{
if (archived)
{
File.Delete($"{GetLocalDir()}{Path.GetFileName(zipfilelocation)}.zevtc");
}
}
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9
10

0 comments on commit 059737e

Please sign in to comment.