();
+ foreach (HtmlNode nd in nodes) {
+ items.Add(cTools.FormattaTesto(nd.InnerText.Replace("genere", "").Trim(), false));
+ }
+ //items.Sort();
+ items = items
+ .OrderBy(s => s) // ordina alfabeticamente
+ .Distinct() // elimina duplicati
+ .ToList();
+ Format_Insert_Tags(rac, items); // rac.Tags = items;
+ } catch (Exception ex) { Logger.Warning(string.Format("Fallita estrazione Tags dal file {0}\r\n{1}", FileName, ex.Message)); return null; }
+ #endregion
+
+ #region Trama: --> Testo del nodo a cui si levano i DIV interni.
+ try {
+ nodes = root.SelectNodes("//div[@class='testoracc']");
+ foreach (HtmlNode nd in nodes) {
+ foreach (HtmlNode n in nd.ChildNodes) {
+ if (n.Name.ToUpper() == "#TEXT") { rac.Trama += cTools.FormattaTesto(n.InnerText.Trim(), false); }
+ if (n.Name.ToUpper() == "BR") { rac.Trama += "\r"; }
+ if (n.Name.ToUpper() == "DIV") {; }
+ }
+ }
+ } catch (Exception ex) { Logger.Error(string.Format("Fallita estrazione Trama dal file {0}\r\n{1}", FileName, ex.Message)); return null; }
+ #endregion
+
+ #region Voto: --> Sempre "Non Letto"
+ rac.Voto = "Non Letto";
+ #endregion
+
+ #region Notes: --> SrcFile - Nome del file che si analizza
+ rac.Notes = new List();
+ rac.Notes.Add(new Data.cNota("SrcFile", System.IO.Path.GetFileName(filePathName)));
+ #endregion
+
+ // Formalizzo esito estrazione:
+ if (!rac.Validate()) {
+ rac = null;
+ }
+
+ } catch (Exception ex) {
+ Logger.Error($"A69 - Import Error - {FileFullPath}: {ex.Message}");
+ Console.WriteLine($"A69 - Import Error - {FileFullPath}: {ex.Message}");
+ return null;
+ }
+ return rac;
+ }
+
+
+ protected virtual void Format_Insert_Tags(Data.cRac rac, List items) {
+ // Per ora riporto tutti i tag rilevati, mentre in futuro dovrò:
+ // - parsare la lista e formattare correttamente i tag
+ // - ordinare la lista dei tag formattati ed eliminare i duplicati
+ // - se non sono rimasti tag, inserisco il tag generale per indicare che non vi sono tag
+ // - altrimenti inserisco tutti i tag rimasti.
+ rac.Tags = new List();
+ try {
+ items.Sort();
+ string tmp = "";
+ foreach (string item in items) {
+ string it = item.Trim().ToLower();
+ if (tmp != it) {
+ #region switch per formattare il testo
+ switch (it) {
+ //case "racconti 69":
+ // rac.Tags.Add("69");
+ // break;
+ //case "abusi":
+ // rac.Tags.Add("Abusi");
+ // break;
+ //case "camgirl":
+ //case "chat e siti di incontri…":
+ //case "fiche":
+ // rac.Tags.Add("Altro");
+ // break;
+ //case "amatoriali":
+ // rac.Tags.Add("Amatoriali");
+ // break;
+ //case "anale":
+ // rac.Tags.Add("Anale");
+ // break;
+ //case "audio libri erotici":
+ //case "audio racconti erotici":
+ // rac.Tags.Add("Audio");
+ // break;
+ //case "bdsm":
+ // rac.Tags.Add("BDMS");
+ // break;
+ //case "bisex":
+ //case "bisex ♀":
+ //case "bisex ♂":
+ // rac.Tags.Add("Bisex");
+ // break;
+ //case "bondage":
+ // rac.Tags.Add("Bondage");
+ // break;
+ //case "bondage e sadomaso":
+ // rac.Tags.Add("Bondage");
+ // rac.Tags.Add("Sadomaso");
+ // break;
+ //case "bukkake":
+ // rac.Tags.Add("Bukkake");
+ // break;
+ //case "comici":
+ //case "comunità":
+ // rac.Tags.Add("Comico");
+ // break;
+ //case "concorso estate 2019":
+ //case "concorso natale 2018":
+ //case "decameron 2020":
+ // rac.Tags.Add("Concorso");
+ // break;
+ //case "confessioni":
+ // rac.Tags.Add("Confessioni");
+ // break;
+ //case "coppie":
+ //case "scambio di coppia":
+ //case "scambio di coppie":
+ // rac.Tags.Add("Coppie");
+ // break;
+ //case "cuckold":
+ //case "racconti cuckold":
+ // rac.Tags.Add("Cuckold");
+ // break;
+ //case "curiosità":
+ //case "curiosità sul sesso":
+ // rac.Tags.Add("Curiosità");
+ // break;
+ //case "dominazione":
+ //case "racconti di dominazione":
+ //case "schiavi&padroni":
+ // rac.Tags.Add("Dominazione");
+ // break;
+ //case "doppia penetrazione":
+ // rac.Tags.Add("Doppia Penetrazione");
+ // break;
+ //case "esibizionismo":
+ // rac.Tags.Add("Esibizionismo");
+ // break;
+ //case "etero":
+ //case "lui & lei":
+ //case "racconti erotici etero":
+ // rac.Tags.Add("Etero");
+ // break;
+ //case "feticismo":
+ // rac.Tags.Add("Feticismo");
+ // break;
+ //case "fisting":
+ // rac.Tags.Add("Fisting");
+ // break;
+ //case "gang bang":
+ // rac.Tags.Add("Gang Bang");
+ // break;
+ //case "gay":
+ //case "racconti gay":
+ // rac.Tags.Add("Gay");
+ // break;
+ //case "gay & bisex":
+ //case "gay e bisex":
+ // rac.Tags.Add("Gay");
+ // rac.Tags.Add("Bisex");
+ // break;
+ //case "gay - travestiti":
+ // rac.Tags.Add("Gay");
+ // rac.Tags.Add("Trans");
+ // break;
+ //case "incesti":
+ //case "incesto":
+ //case "racconti erotici sull'incesto":
+ // rac.Tags.Add("Incesto");
+ // break;
+ //case "interviste":
+ //case "interviste erotiche":
+ // rac.Tags.Add("Intervista");
+ // break;
+ //case "lesbo":
+ //case "racconti erotici lesbo":
+ //case "saffico":
+ // rac.Tags.Add("Lesbo");
+ // break;
+ //case "autoerotismo":
+ //case "masturbazione":
+ //case "masturbazioni":
+ //case "racconti sull'autoerotismo":
+ // rac.Tags.Add("Masturbazione");
+ // break;
+ //case "milf":
+ // rac.Tags.Add("MILF");
+ // break;
+ //case "nudismo":
+ // rac.Tags.Add("Nudismo");
+ // break;
+ //case "orge":
+ //case "orgia":
+ //case "sesso di gruppo":
+ // rac.Tags.Add("Orge");
+ // break;
+ //case "pissing":
+ // rac.Tags.Add("Pissing");
+ // break;
+ //case "lirica erotica":
+ //case "poesia erotica":
+ //case "poesie":
+ //case "poesie erotiche":
+ // rac.Tags.Add("Poesia");
+ // break;
+ //case "pompini":
+ // rac.Tags.Add("Pompini");
+ // break;
+ //case "giochi erotici":
+ //case "prime esperienze":
+ //case "prime volte":
+ // rac.Tags.Add("Prime Esperienze");
+ // break;
+ //case "pulp":
+ // rac.Tags.Add("Pulp");
+ // break;
+ //case "sadomaso":
+ // rac.Tags.Add("Sadomaso");
+ // break;
+ //case "sensazioni":
+ //case "sentimentali":
+ // rac.Tags.Add("Sentimentali");
+ // break;
+ //case "cornuti":
+ //case "tradimenti":
+ //case "tradimento":
+ // rac.Tags.Add("Tradimento");
+ // break;
+ //case "racconti con trans":
+ //case "racconti trans":
+ //case "trans":
+ //case "trans e travestiti":
+ // rac.Tags.Add("Trans");
+ // break;
+ //case "trasgressivo":
+ // rac.Tags.Add("Trasgressivo");
+ // break;
+ //case "trio":
+ // rac.Tags.Add("Trio");
+ // break;
+ //case "uncategorized":
+ // rac.Tags.Add("Uncategorized");
+ // break;
+ //case "voyeur":
+ //case "voyeurismo":
+ // rac.Tags.Add("Voyeur");
+ // break;
+ //case "animali":
+ //case "zoofilia":
+ // rac.Tags.Add("Zoofilia");
+ // break;
+
+ //case "Gay":
+ // rac.Tags.Add("Gay");
+ // break;
+ //case "Racconti bisex":
+ // rac.Tags.Add("Bisex");
+ // break;
+ //case "Racconti etero":
+ // rac.Tags.Add("Etero");
+ // break;
+ //case "Racconti fetish":
+ // rac.Tags.Add("Feticismo");
+ // break;
+ //case "Racconti incesto":
+ // rac.Tags.Add("Incesto");
+ // break;
+ //case "Racconti lesbo":
+ // rac.Tags.Add("Lesbo");
+ // break;
+ //case "Racconti masturbazione":
+ // rac.Tags.Add("Masturbazione");
+ // break;
+ //case "Racconti mature":
+ // rac.Tags.Add("Mature");
+ // break;
+ //case "Racconti orge":
+ // rac.Tags.Add("Orge");
+ // break;
+ //case "Racconti prima volta":
+ // rac.Tags.Add("Prime Esperienze");
+ // break;
+ //case "Racconti ricatto":
+ // rac.Tags.Add("Ricatto");
+ // break;
+ //case "Racconti scambio di coppia":
+ // rac.Tags.Add("Coppie");
+ // break;
+ //case "Racconti sottomissione":
+ // rac.Tags.Add("Dominazione");
+ // break;
+ //case "Racconti tradimenti":
+ // rac.Tags.Add("Tradimento");
+ // break;
+ //case "Racconti trav":
+ //case "Trans":
+ // rac.Tags.Add("Trans");
+ // break;
+
+ default:
+ rac.Tags.Add(item);
+ break;
+ }
+ #endregion
+ tmp = it;
+
+ }//if
+
+ }//foreach
+
+ } catch (Exception ex) {
+ Logger.Error(string.Format("Error Code: {0} - Errore in {1}.{2}: {3}", "ER00040", System.Reflection.MethodInfo.GetCurrentMethod().DeclaringType.FullName, System.Reflection.MethodInfo.GetCurrentMethod().Name, ex.Message));
+ } finally {
+ if (rac.Tags.Count == 0) rac.Tags.Add("_None_");
+ }
+ }//function
+
+
+
}//class cLink_A69
}//namespace A69WD.Net
diff --git a/Src/A69WD/Service/Service_Importer.cs b/Src/A69WD/Service/Service_Importer.cs
new file mode 100644
index 0000000..d219fed
--- /dev/null
+++ b/Src/A69WD/Service/Service_Importer.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace A69WD.Service {
+
+
+ public class Service_Importer {
+
+ // Thread worker che consuma la coda
+ private Thread _workerThread;
+
+
+ }//class Service_Importer
+
+}//namespace A69WD.Service
diff --git a/Src/A69WD/UI/frmDownloader.Designer.cs b/Src/A69WD/UI/frmDownloader.Designer.cs
index b6a13a8..915fa03 100644
--- a/Src/A69WD/UI/frmDownloader.Designer.cs
+++ b/Src/A69WD/UI/frmDownloader.Designer.cs
@@ -30,11 +30,12 @@
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.btnShowLog = new System.Windows.Forms.Button();
this.pbST = new System.Windows.Forms.ProgressBar();
+ this.btnImport = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// btnClose
//
- this.btnClose.Location = new System.Drawing.Point(263, 12);
+ this.btnClose.Location = new System.Drawing.Point(348, 12);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(79, 33);
this.btnClose.TabIndex = 14;
@@ -58,7 +59,7 @@
this.lblST.Dock = System.Windows.Forms.DockStyle.Bottom;
this.lblST.Location = new System.Drawing.Point(0, 73);
this.lblST.Name = "lblST";
- this.lblST.Size = new System.Drawing.Size(352, 22);
+ this.lblST.Size = new System.Drawing.Size(433, 22);
this.lblST.TabIndex = 9;
this.lblST.Text = "Status";
this.lblST.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -81,7 +82,7 @@
//
// btnShowLog
//
- this.btnShowLog.Location = new System.Drawing.Point(178, 12);
+ this.btnShowLog.Location = new System.Drawing.Point(263, 12);
this.btnShowLog.Name = "btnShowLog";
this.btnShowLog.Size = new System.Drawing.Size(79, 33);
this.btnShowLog.TabIndex = 17;
@@ -94,14 +95,25 @@
this.pbST.Dock = System.Windows.Forms.DockStyle.Bottom;
this.pbST.Location = new System.Drawing.Point(0, 55);
this.pbST.Name = "pbST";
- this.pbST.Size = new System.Drawing.Size(352, 18);
+ this.pbST.Size = new System.Drawing.Size(433, 18);
this.pbST.TabIndex = 18;
//
+ // btnImport
+ //
+ this.btnImport.Location = new System.Drawing.Point(182, 12);
+ this.btnImport.Name = "btnImport";
+ this.btnImport.Size = new System.Drawing.Size(79, 33);
+ this.btnImport.TabIndex = 19;
+ this.btnImport.Text = "Import Rac";
+ this.btnImport.UseVisualStyleBackColor = true;
+ this.btnImport.Click += new System.EventHandler(this.btnImport_Click);
+ //
// frmDownloader
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(352, 95);
+ this.ClientSize = new System.Drawing.Size(433, 95);
+ this.Controls.Add(this.btnImport);
this.Controls.Add(this.pbST);
this.Controls.Add(this.btnShowLog);
this.Controls.Add(this.btnImportLinks);
@@ -123,5 +135,6 @@
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.Button btnShowLog;
private System.Windows.Forms.ProgressBar pbST;
+ private System.Windows.Forms.Button btnImport;
}
}
\ No newline at end of file
diff --git a/Src/A69WD/UI/frmDownloader.cs b/Src/A69WD/UI/frmDownloader.cs
index 1fc7f7b..7260fe3 100644
--- a/Src/A69WD/UI/frmDownloader.cs
+++ b/Src/A69WD/UI/frmDownloader.cs
@@ -17,6 +17,7 @@ using A69WD.Net;
using System.Collections.Concurrent;
using System.Xml.Linq;
using A69WD.Service;
+using A69WD.Data;
namespace A69WD {
@@ -53,9 +54,7 @@ namespace A69WD {
}
private async void btnDownloadAll_Click(object sender, EventArgs e) {
- ////engine.Start(true);
- ////engine.Start(!cbSoloFileIndice.Checked);
- //engine.StartParallel(!cbSoloFileIndice.Checked, int.Parse(tbNumThred.Text));
+ btnDownloadAll.Enabled = false;
// - Creo istanza del client per il sito con autenticazione:
lblST.Text = DateTime.Now.ToString() + " - Login";
@@ -132,6 +131,8 @@ namespace A69WD {
this.Close();
}
+
+
#region Gestione eventi dal engine
//
// private void Engine_Updating(object sender, EngineEventArgs e) { EngineUpdatingStatus(e.Message, e.NTot, e.NtoDown, e.NDown); }
@@ -156,6 +157,21 @@ namespace A69WD {
//
#endregion
+ private async void btnImport_Click(object sender, EventArgs e) {
+ string fp = "C:\\Commesse\\_zPrivate\\A69WD\\Test\\Down\\__A69_altro_Collarini-e-fantasie_166756.html";
+ cLink_A69 lk = new cLink_A69("Tmp", "tmp");
+ cRac rac = await lk.EstraiRac(fp);
+ if (rac != null) {
+ //foreach (string tag in rac.Tags) {
+ for (int i = 0; i