Merge branch 'feature/#32-userid-placeholder-for-filenames'

This commit is contained in:
Serraniel 2019-12-12 19:14:22 +01:00
commit 881093ea4a
Signed by: Serraniel
GPG key ID: 3690B4E7364525D3
7 changed files with 92 additions and 26 deletions

View file

@ -247,7 +247,9 @@ namespace DML.AppCore.Classes
.Replace("%channel%", channelName) .Replace("%channel%", channelName)
.Replace("%timestamp%", message.CreatedAt.UtcDateTime.ToUnixTimeStamp().ToString()) .Replace("%timestamp%", message.CreatedAt.UtcDateTime.ToUnixTimeStamp().ToString())
.Replace("%name%", a.Filename) .Replace("%name%", a.Filename)
.Replace("%id%", a.Id.ToString()); .Replace("%id%", a.Id.ToString())
.Replace("%userid%", message.Author.Id.ToString())
.Replace("%username%", message.Author.Username);
if (extensionRequired) if (extensionRequired)
fileName += Path.GetExtension(a.Filename); fileName += Path.GetExtension(a.Filename);

View file

@ -222,6 +222,9 @@
<ItemGroup> <ItemGroup>
<None Include="Resources\Serraniel-Logo4-NO-BG.png" /> <None Include="Resources\Serraniel-Logo4-NO-BG.png" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="Resources\info_icon.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

View file

@ -31,6 +31,7 @@
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.pnlSettings = new System.Windows.Forms.GroupBox(); this.pnlSettings = new System.Windows.Forms.GroupBox();
this.btnFileNameHelp = new System.Windows.Forms.Button();
this.lbThreadLimit = new System.Windows.Forms.Label(); this.lbThreadLimit = new System.Windows.Forms.Label();
this.edThreadLimit = new System.Windows.Forms.NumericUpDown(); this.edThreadLimit = new System.Windows.Forms.NumericUpDown();
this.cbSkipExisting = new System.Windows.Forms.CheckBox(); this.cbSkipExisting = new System.Windows.Forms.CheckBox();
@ -56,6 +57,8 @@
this.lblVersionPlaceholder = new System.Windows.Forms.ToolStripStatusLabel(); this.lblVersionPlaceholder = new System.Windows.Forms.ToolStripStatusLabel();
this.lbVersion = new System.Windows.Forms.ToolStripStatusLabel(); this.lbVersion = new System.Windows.Forms.ToolStripStatusLabel();
this.btnDropDown = new System.Windows.Forms.ToolStripSplitButton(); this.btnDropDown = new System.Windows.Forms.ToolStripSplitButton();
this.showTokenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.visitGithubToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.visitGithubToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.groupBox2 = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox();
@ -63,8 +66,6 @@
this.lbxJobs = new System.Windows.Forms.ListBox(); this.lbxJobs = new System.Windows.Forms.ListBox();
this.tmrRefreshProgress = new System.Windows.Forms.Timer(this.components); this.tmrRefreshProgress = new System.Windows.Forms.Timer(this.components);
this.tmrTriggerRefresh = new System.Windows.Forms.Timer(this.components); this.tmrTriggerRefresh = new System.Windows.Forms.Timer(this.components);
this.showTokenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.pnlSettings.SuspendLayout(); this.pnlSettings.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.edThreadLimit)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.edThreadLimit)).BeginInit();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
@ -74,6 +75,7 @@
// //
// pnlSettings // pnlSettings
// //
this.pnlSettings.Controls.Add(this.btnFileNameHelp);
this.pnlSettings.Controls.Add(this.lbThreadLimit); this.pnlSettings.Controls.Add(this.lbThreadLimit);
this.pnlSettings.Controls.Add(this.edThreadLimit); this.pnlSettings.Controls.Add(this.edThreadLimit);
this.pnlSettings.Controls.Add(this.cbSkipExisting); this.pnlSettings.Controls.Add(this.cbSkipExisting);
@ -90,6 +92,17 @@
this.pnlSettings.TabStop = false; this.pnlSettings.TabStop = false;
this.pnlSettings.Text = "Settings"; this.pnlSettings.Text = "Settings";
// //
// btnFileNameHelp
//
this.btnFileNameHelp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnFileNameHelp.Image = global::DML.Application.Properties.Resources.info_icon;
this.btnFileNameHelp.Location = new System.Drawing.Point(554, 37);
this.btnFileNameHelp.Name = "btnFileNameHelp";
this.btnFileNameHelp.Size = new System.Drawing.Size(25, 23);
this.btnFileNameHelp.TabIndex = 8;
this.btnFileNameHelp.UseVisualStyleBackColor = true;
this.btnFileNameHelp.Click += new System.EventHandler(this.btnFileNameHelp_Click);
//
// lbThreadLimit // lbThreadLimit
// //
this.lbThreadLimit.AutoSize = true; this.lbThreadLimit.AutoSize = true;
@ -135,7 +148,7 @@
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.edNameScheme.Location = new System.Drawing.Point(113, 39); this.edNameScheme.Location = new System.Drawing.Point(113, 39);
this.edNameScheme.Name = "edNameScheme"; this.edNameScheme.Name = "edNameScheme";
this.edNameScheme.Size = new System.Drawing.Size(465, 20); this.edNameScheme.Size = new System.Drawing.Size(435, 20);
this.edNameScheme.TabIndex = 4; this.edNameScheme.TabIndex = 4;
this.edNameScheme.TextChanged += new System.EventHandler(this.DoSomethingChanged); this.edNameScheme.TextChanged += new System.EventHandler(this.DoSomethingChanged);
// //
@ -270,28 +283,28 @@
// invisibleToolStripMenuItem // invisibleToolStripMenuItem
// //
this.invisibleToolStripMenuItem.Name = "invisibleToolStripMenuItem"; this.invisibleToolStripMenuItem.Name = "invisibleToolStripMenuItem";
this.invisibleToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.invisibleToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
this.invisibleToolStripMenuItem.Tag = "3"; this.invisibleToolStripMenuItem.Tag = "3";
this.invisibleToolStripMenuItem.Text = "Invisible"; this.invisibleToolStripMenuItem.Text = "Invisible";
// //
// doNotDisturbToolStripMenuItem // doNotDisturbToolStripMenuItem
// //
this.doNotDisturbToolStripMenuItem.Name = "doNotDisturbToolStripMenuItem"; this.doNotDisturbToolStripMenuItem.Name = "doNotDisturbToolStripMenuItem";
this.doNotDisturbToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.doNotDisturbToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
this.doNotDisturbToolStripMenuItem.Tag = "2"; this.doNotDisturbToolStripMenuItem.Tag = "2";
this.doNotDisturbToolStripMenuItem.Text = "Do not disturb"; this.doNotDisturbToolStripMenuItem.Text = "Do not disturb";
// //
// doNotDenyToolStripMenuItem // doNotDenyToolStripMenuItem
// //
this.doNotDenyToolStripMenuItem.Name = "doNotDenyToolStripMenuItem"; this.doNotDenyToolStripMenuItem.Name = "doNotDenyToolStripMenuItem";
this.doNotDenyToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.doNotDenyToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
this.doNotDenyToolStripMenuItem.Tag = "1"; this.doNotDenyToolStripMenuItem.Tag = "1";
this.doNotDenyToolStripMenuItem.Text = "Idle"; this.doNotDenyToolStripMenuItem.Text = "Idle";
// //
// onlineToolStripMenuItem // onlineToolStripMenuItem
// //
this.onlineToolStripMenuItem.Name = "onlineToolStripMenuItem"; this.onlineToolStripMenuItem.Name = "onlineToolStripMenuItem";
this.onlineToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.onlineToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
this.onlineToolStripMenuItem.Tag = "0"; this.onlineToolStripMenuItem.Tag = "0";
this.onlineToolStripMenuItem.Text = "Online"; this.onlineToolStripMenuItem.Text = "Online";
// //
@ -308,7 +321,7 @@
// lblVersionPlaceholder // lblVersionPlaceholder
// //
this.lblVersionPlaceholder.Name = "lblVersionPlaceholder"; this.lblVersionPlaceholder.Name = "lblVersionPlaceholder";
this.lblVersionPlaceholder.Size = new System.Drawing.Size(459, 17); this.lblVersionPlaceholder.Size = new System.Drawing.Size(490, 17);
this.lblVersionPlaceholder.Spring = true; this.lblVersionPlaceholder.Spring = true;
// //
// lbVersion // lbVersion
@ -330,17 +343,29 @@
this.btnDropDown.Size = new System.Drawing.Size(16, 20); this.btnDropDown.Size = new System.Drawing.Size(16, 20);
this.btnDropDown.Text = "Options"; this.btnDropDown.Text = "Options";
// //
// showTokenToolStripMenuItem
//
this.showTokenToolStripMenuItem.Name = "showTokenToolStripMenuItem";
this.showTokenToolStripMenuItem.Size = new System.Drawing.Size(165, 22);
this.showTokenToolStripMenuItem.Text = "Copy login token";
this.showTokenToolStripMenuItem.Click += new System.EventHandler(this.showTokenToolStripMenuItem_Click);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(162, 6);
//
// visitGithubToolStripMenuItem // visitGithubToolStripMenuItem
// //
this.visitGithubToolStripMenuItem.Name = "visitGithubToolStripMenuItem"; this.visitGithubToolStripMenuItem.Name = "visitGithubToolStripMenuItem";
this.visitGithubToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.visitGithubToolStripMenuItem.Size = new System.Drawing.Size(165, 22);
this.visitGithubToolStripMenuItem.Text = "Visit Github"; this.visitGithubToolStripMenuItem.Text = "Visit Github";
this.visitGithubToolStripMenuItem.Click += new System.EventHandler(this.visitGithubToolStripMenuItem_Click); this.visitGithubToolStripMenuItem.Click += new System.EventHandler(this.visitGithubToolStripMenuItem_Click);
// //
// aboutToolStripMenuItem // aboutToolStripMenuItem
// //
this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.aboutToolStripMenuItem.Size = new System.Drawing.Size(165, 22);
this.aboutToolStripMenuItem.Text = "About"; this.aboutToolStripMenuItem.Text = "About";
this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click); this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
// //
@ -389,18 +414,6 @@
this.tmrTriggerRefresh.Interval = 5000; this.tmrTriggerRefresh.Interval = 5000;
this.tmrTriggerRefresh.Tick += new System.EventHandler(this.tmrTriggerRefresh_Tick); this.tmrTriggerRefresh.Tick += new System.EventHandler(this.tmrTriggerRefresh_Tick);
// //
// showTokenToolStripMenuItem
//
this.showTokenToolStripMenuItem.Name = "showTokenToolStripMenuItem";
this.showTokenToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.showTokenToolStripMenuItem.Text = "Copy login token";
this.showTokenToolStripMenuItem.Click += new System.EventHandler(this.showTokenToolStripMenuItem_Click);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(177, 6);
//
// MainForm // MainForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -466,5 +479,6 @@
private System.Windows.Forms.Timer tmrTriggerRefresh; private System.Windows.Forms.Timer tmrTriggerRefresh;
private System.Windows.Forms.ToolStripMenuItem showTokenToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem showTokenToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.Button btnFileNameHelp;
} }
} }

View file

@ -289,5 +289,10 @@ namespace DML.Application
MessageBox.Show(this, "Your login token has been copied to your clipboard.", "Discord Media Loader", MessageBox.Show(this, "Your login token has been copied to your clipboard.", "Discord Media Loader",
MessageBoxButtons.OK); MessageBoxButtons.OK);
} }
private void btnFileNameHelp_Click(object sender, EventArgs e)
{
MessageBox.Show(Properties.Resources.FileNameInfo);
}
} }
} }

View file

@ -19,7 +19,7 @@ namespace DML.Application.Properties {
// -Klasse über ein Tool wie ResGen oder Visual Studio 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 // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
// mit der /str-Option erneut aus, oder Sie erstellen 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.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources { internal class Resources {
@ -79,6 +79,33 @@ namespace DML.Application.Properties {
} }
} }
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die You can use the following placeholders for your filenames:
///
///%guild% -&gt; server name
///%channel% -&gt; channel name
///%timestamp% -&gt; message timestamp (Unix timestamp)
///%name% -&gt; attachment filename
///%username% -&gt; author name
///%id% -&gt; attachment id (given by Discord)
///%userid% -&gt; author id (given by discord) ähnelt.
/// </summary>
internal static string FileNameInfo {
get {
return ResourceManager.GetString("FileNameInfo", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap info_icon {
get {
object obj = ResourceManager.GetObject("info_icon", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary> /// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
/// </summary> /// </summary>

View file

@ -129,9 +129,24 @@ Nito.AsyncEx (Copyright (c) 2014 StephenCleary - MIT License)
RestSharp (Copyright (c) restsharp - Apache 2.0 License) RestSharp (Copyright (c) restsharp - Apache 2.0 License)
WebSocket4Net (Copyright (c) kerryjiang - Apache 2.0 License) WebSocket4Net (Copyright (c) kerryjiang - Apache 2.0 License)
LiteDB (Copyright (c) 2014 - 2015 Mauricio David - MIT License) LiteDB (Copyright (c) 2014 - 2015 Mauricio David - MIT License)
Octokit (Copyright (c) 2012 GitHub, Inc - MIT License)</value> Octokit (Copyright (c) 2012 GitHub, Inc - MIT License)
Flaticons (Roundicons Circle Flat) - Flaticon Basic License</value>
</data>
<data name="FileNameInfo" xml:space="preserve">
<value>You can use the following placeholders for your filenames:
%guild% -&gt; server name
%channel% -&gt; channel name
%timestamp% -&gt; message timestamp (Unix timestamp)
%name% -&gt; attachment filename
%username% -&gt; author name
%id% -&gt; attachment id (given by Discord)
%userid% -&gt; author id (given by discord)</value>
</data> </data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="info_icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\info_icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Serraniel_Logo4_NO_BG" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="Serraniel_Logo4_NO_BG" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Serraniel-Logo4-NO-BG.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\Serraniel-Logo4-NO-BG.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB