Skip to content

Commit

Permalink
Parse HTML out of custom filenames using text and rawText
Browse files Browse the repository at this point in the history
  • Loading branch information
sim0n00ps committed Oct 6, 2024
1 parent b3b3f97 commit 339d544
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion OF DL/Helpers/FileNameHelper.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using HtmlAgilityPack;
using OF_DL.Entities;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -130,7 +131,9 @@ public async Task<Dictionary<string, string>> GetFilename(object obj1, object ob
object propertyValue = property.GetValue(obj1);
if (propertyValue != null)
{
var str = propertyValue.ToString();
var pageDoc = new HtmlDocument();
pageDoc.LoadHtml(propertyValue.ToString());
var str = pageDoc.DocumentNode.InnerText;
if (str.Length > 100) // todo: add length limit to config
str = str.Substring(0, 100);
values.Add(propertyName, str);
Expand Down

0 comments on commit 339d544

Please sign in to comment.