Finalised for first release build
This commit is contained in:
parent
9a4ca60458
commit
dc708060fc
|
@ -105,6 +105,7 @@
|
|||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
|
|
|
@ -1,11 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Discord_Media_Loader
|
||||
|
|
56
Discord Media Loader/MainForm.Designer.cs
generated
56
Discord Media Loader/MainForm.Designer.cs
generated
|
@ -45,6 +45,10 @@
|
|||
this.cbGuilds = new System.Windows.Forms.ComboBox();
|
||||
this.lbGuild = new System.Windows.Forms.Label();
|
||||
this.cbSkip = new System.Windows.Forms.CheckBox();
|
||||
this.lbCopyright = new System.Windows.Forms.Label();
|
||||
this.lbGithub = new System.Windows.Forms.LinkLabel();
|
||||
this.lbAbout = new System.Windows.Forms.LinkLabel();
|
||||
this.lbVersion = new System.Windows.Forms.Label();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nupThreadCount)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
|
@ -116,6 +120,7 @@
|
|||
//
|
||||
// cbChannels
|
||||
//
|
||||
this.cbChannels.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cbChannels.FormattingEnabled = true;
|
||||
this.cbChannels.Location = new System.Drawing.Point(264, 32);
|
||||
this.cbChannels.Name = "cbChannels";
|
||||
|
@ -172,6 +177,7 @@
|
|||
//
|
||||
// cbGuilds
|
||||
//
|
||||
this.cbGuilds.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cbGuilds.FormattingEnabled = true;
|
||||
this.cbGuilds.Location = new System.Drawing.Point(52, 32);
|
||||
this.cbGuilds.Name = "cbGuilds";
|
||||
|
@ -200,11 +206,55 @@
|
|||
this.cbSkip.Text = "Skip existing files";
|
||||
this.cbSkip.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// lbCopyright
|
||||
//
|
||||
this.lbCopyright.AutoSize = true;
|
||||
this.lbCopyright.Location = new System.Drawing.Point(12, 274);
|
||||
this.lbCopyright.Name = "lbCopyright";
|
||||
this.lbCopyright.Size = new System.Drawing.Size(151, 13);
|
||||
this.lbCopyright.TabIndex = 22;
|
||||
this.lbCopyright.Text = "Copyright (c) 2017 by Serraniel";
|
||||
//
|
||||
// lbGithub
|
||||
//
|
||||
this.lbGithub.AutoSize = true;
|
||||
this.lbGithub.Location = new System.Drawing.Point(169, 274);
|
||||
this.lbGithub.Name = "lbGithub";
|
||||
this.lbGithub.Size = new System.Drawing.Size(40, 13);
|
||||
this.lbGithub.TabIndex = 23;
|
||||
this.lbGithub.TabStop = true;
|
||||
this.lbGithub.Text = "GitHub";
|
||||
this.lbGithub.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lbGithub_LinkClicked);
|
||||
//
|
||||
// lbAbout
|
||||
//
|
||||
this.lbAbout.AutoSize = true;
|
||||
this.lbAbout.Location = new System.Drawing.Point(223, 274);
|
||||
this.lbAbout.Name = "lbAbout";
|
||||
this.lbAbout.Size = new System.Drawing.Size(35, 13);
|
||||
this.lbAbout.TabIndex = 24;
|
||||
this.lbAbout.TabStop = true;
|
||||
this.lbAbout.Text = "About";
|
||||
this.lbAbout.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lbAbout_LinkClicked);
|
||||
//
|
||||
// lbVersion
|
||||
//
|
||||
this.lbVersion.Location = new System.Drawing.Point(328, 274);
|
||||
this.lbVersion.Name = "lbVersion";
|
||||
this.lbVersion.Size = new System.Drawing.Size(100, 13);
|
||||
this.lbVersion.TabIndex = 25;
|
||||
this.lbVersion.Text = "version";
|
||||
this.lbVersion.TextAlign = System.Drawing.ContentAlignment.TopRight;
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(439, 253);
|
||||
this.ClientSize = new System.Drawing.Size(439, 296);
|
||||
this.Controls.Add(this.lbVersion);
|
||||
this.Controls.Add(this.lbAbout);
|
||||
this.Controls.Add(this.lbGithub);
|
||||
this.Controls.Add(this.lbCopyright);
|
||||
this.Controls.Add(this.cbSkip);
|
||||
this.Controls.Add(this.lbDownload);
|
||||
this.Controls.Add(this.lbScanCount);
|
||||
|
@ -252,5 +302,9 @@
|
|||
private System.Windows.Forms.ComboBox cbGuilds;
|
||||
private System.Windows.Forms.Label lbGuild;
|
||||
private System.Windows.Forms.CheckBox cbSkip;
|
||||
private System.Windows.Forms.Label lbCopyright;
|
||||
private System.Windows.Forms.LinkLabel lbGithub;
|
||||
private System.Windows.Forms.LinkLabel lbAbout;
|
||||
private System.Windows.Forms.Label lbVersion;
|
||||
}
|
||||
}
|
|
@ -1,22 +1,15 @@
|
|||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Discord;
|
||||
using Discord.Net;
|
||||
using Nito.AsyncEx;
|
||||
using ConnectionState = Discord.ConnectionState;
|
||||
using Message = Discord.Message;
|
||||
|
||||
namespace Discord_Media_Loader
|
||||
{
|
||||
|
@ -42,13 +35,12 @@ namespace Discord_Media_Loader
|
|||
{
|
||||
if (control.InvokeRequired)
|
||||
{
|
||||
control.Invoke(new SetControlPropertyThreadSafeDelegate(SetControlPropertyThreadSafe),
|
||||
new object[] { control, propertyName, propertyValue });
|
||||
control.Invoke(new SetControlPropertyThreadSafeDelegate(SetControlPropertyThreadSafe), control, propertyName, propertyValue);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
control.GetType().InvokeMember(propertyName, BindingFlags.SetProperty, null, control, new object[] { propertyValue });
|
||||
control.GetType().InvokeMember(propertyName, BindingFlags.SetProperty, null, control, new[] { propertyValue });
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -59,7 +51,7 @@ namespace Discord_Media_Loader
|
|||
|
||||
while (Client.State != ConnectionState.Connected && !abort)
|
||||
{
|
||||
var password = "";
|
||||
string password;
|
||||
|
||||
if (LoginForm.Exec(ref email, out password))
|
||||
{
|
||||
|
@ -78,7 +70,7 @@ namespace Discord_Media_Loader
|
|||
Cursor = Cursors.Default;
|
||||
}
|
||||
}
|
||||
catch (HttpException ex)
|
||||
catch (HttpException)
|
||||
{
|
||||
// ignore http exception on invalid login
|
||||
}
|
||||
|
@ -94,6 +86,8 @@ namespace Discord_Media_Loader
|
|||
|
||||
private async void MainForm_Shown(object sender, EventArgs e)
|
||||
{
|
||||
lbVersion.Text = $"v{Assembly.GetExecutingAssembly().GetName().Version}";
|
||||
|
||||
SetEnabled(false);
|
||||
|
||||
if (!await Login())
|
||||
|
@ -167,10 +161,7 @@ namespace Discord_Media_Loader
|
|||
private void OnUpdateProgress(UpdateProgessEventArgs e)
|
||||
{
|
||||
EventHandler<UpdateProgessEventArgs> handler = UpdateProgress;
|
||||
if (handler != null)
|
||||
{
|
||||
handler(this, e);
|
||||
}
|
||||
handler?.Invoke(this, e);
|
||||
}
|
||||
|
||||
private static long DateTimeToUnixTimeStamp(DateTime dateTime)
|
||||
|
@ -203,17 +194,13 @@ namespace Discord_Media_Loader
|
|||
|
||||
var limit = 100;
|
||||
var stop = false;
|
||||
ulong lastId = ulong.MaxValue;
|
||||
var lastId = ulong.MaxValue;
|
||||
var isFirst = true;
|
||||
|
||||
ulong msgScanCount = 0;
|
||||
ulong fileFound = 0;
|
||||
ulong downloadCount = 0;
|
||||
var locker = new object();
|
||||
|
||||
var timeDiffSteps = (int)Math.Floor(int.MaxValue / 2 / (DateTime.Now - dtpLimit.Value.Date).TotalHours);
|
||||
int progress = 0;
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
|
||||
|
@ -222,9 +209,9 @@ namespace Discord_Media_Loader
|
|||
Discord.Message[] messages;
|
||||
|
||||
if (isFirst)
|
||||
messages = await channel.DownloadMessages(limit, null, Relative.Before, true);
|
||||
messages = await channel.DownloadMessages(limit, null);
|
||||
else
|
||||
messages = await channel.DownloadMessages(limit, lastId, Relative.Before, true);
|
||||
messages = await channel.DownloadMessages(limit, lastId);
|
||||
|
||||
isFirst = false;
|
||||
|
||||
|
@ -241,8 +228,6 @@ namespace Discord_Media_Loader
|
|||
|
||||
foreach (var a in m.Attachments)
|
||||
{
|
||||
fileFound++;
|
||||
|
||||
if (!path.EndsWith(@"\"))
|
||||
path += @"\";
|
||||
|
||||
|
@ -288,14 +273,25 @@ namespace Discord_Media_Loader
|
|||
}
|
||||
});
|
||||
|
||||
Process.Start(path);
|
||||
SetEnabled(true);
|
||||
});
|
||||
}
|
||||
|
||||
private void lbGithub_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
Process.Start("https://github.com/Serraniel/DiscordMediaLoader/releases");
|
||||
}
|
||||
|
||||
private void lbAbout_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
MessageBox.Show(Properties.Resources.AboutString);
|
||||
}
|
||||
}
|
||||
|
||||
internal class UpdateProgessEventArgs : EventArgs
|
||||
{
|
||||
internal ulong Scanned { get; set; } = 0;
|
||||
internal ulong Downloaded { get; set; } = 0;
|
||||
internal ulong Scanned { get; set; }
|
||||
internal ulong Downloaded { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Discord_Media_Loader
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||
|
@ -32,5 +31,5 @@ using System.Runtime.InteropServices;
|
|||
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
|
||||
// übernehmen, indem Sie "*" eingeben:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("0.1.0.48")]
|
||||
[assembly: AssemblyFileVersion("0.1.0.48")]
|
||||
[assembly: AssemblyVersion("0.1.0.51")]
|
||||
[assembly: AssemblyFileVersion("0.1.0.51")]
|
||||
|
|
|
@ -3,47 +3,42 @@
|
|||
// Dieser Code wurde von einem Tool generiert.
|
||||
// Laufzeitversion:4.0.30319.42000
|
||||
//
|
||||
// Änderungen an dieser Datei können fehlerhaftes Verhalten verursachen und gehen verloren, wenn
|
||||
// der Code neu generiert wird.
|
||||
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
// der Code erneut generiert wird.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Discord_Media_Loader.Properties
|
||||
{
|
||||
namespace Discord_Media_Loader.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||
/// </summary>
|
||||
// Diese Klasse wurde von der StronglyTypedResourceBuilder-Klasse
|
||||
// über ein Tool wie ResGen oder Visual Studio automatisch generiert.
|
||||
// Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
|
||||
// -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
|
||||
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
|
||||
// mit der Option /str erneut aus, oder erstellen Sie Ihr VS-Projekt neu.
|
||||
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources
|
||||
{
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources()
|
||||
{
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Discord_Media_Loader.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
|
@ -53,19 +48,32 @@ namespace Discord_Media_Loader.Properties
|
|||
|
||||
/// <summary>
|
||||
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
||||
/// Ressourcenlookups, die diese stark typisierte Ressourcenklasse verwenden.
|
||||
/// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Discord Media Loader by Serraniel - Apache 2.0 License
|
||||
///https://github.com/Serraniel/DiscordMediaLoader/
|
||||
///
|
||||
///Made with:
|
||||
///Discord.Net (Copyright (c) 2015 RogueException - MIT License)
|
||||
///Newtonsoft.Json (Copyright (c) 2007 James Newton-King - MIT License)
|
||||
///Nito.AsyncEx (Copyright (c) 2014 StephenCleary - MIT License)
|
||||
///WebSocket4Net (Copyright (c) kerryjiang - Apache 2.0 License) ähnelt.
|
||||
/// </summary>
|
||||
internal static string AboutString {
|
||||
get {
|
||||
return ResourceManager.GetString("AboutString", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
|
@ -60,6 +60,7 @@
|
|||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
|
@ -68,9 +69,10 @@
|
|||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
|
@ -85,9 +87,10 @@
|
|||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
|
@ -109,9 +112,19 @@
|
|||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="AboutString" xml:space="preserve">
|
||||
<value>Discord Media Loader by Serraniel - Apache 2.0 License
|
||||
https://github.com/Serraniel/DiscordMediaLoader/
|
||||
|
||||
Made with:
|
||||
Discord.Net (Copyright (c) 2015 RogueException - MIT License)
|
||||
Newtonsoft.Json (Copyright (c) 2007 James Newton-King - MIT License)
|
||||
Nito.AsyncEx (Copyright (c) 2014 StephenCleary - MIT License)
|
||||
WebSocket4Net (Copyright (c) kerryjiang - Apache 2.0 License)</value>
|
||||
</data>
|
||||
</root>
|
Loading…
Reference in a new issue