Skip to content

Commit a923ae4

Browse files
Merge pull request #92 from Cloud9Developer/10.9.0
10.9.0
2 parents fd4a786 + 68b1b20 commit a923ae4

File tree

12 files changed

+54
-19
lines changed

12 files changed

+54
-19
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
*/.DS_Store
22
Jellyfin.Plugin.Newsletters/bin/*
3-
Jellyfin.Plugin.Newsletters/obj/*
3+
Jellyfin.Plugin.Newsletters/obj/*
4+
zip

BuildScripts/build.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#!/bin/bash
2-
if ! docker images -a | grep mcr.microsoft.com/dotnet/sdk; then
3-
echo "Pulling dotnet:6.0 image"
4-
docker pull mcr.microsoft.com/dotnet/sdk:6.0
2+
TAG=${1}
3+
if ! docker images -a | grep mcr.microsoft.com/dotnet/sdk${TAG}.0; then
4+
echo "Pulling dotnet:${TAG}.0 image"
5+
docker pull mcr.microsoft.com/dotnet/sdk:${TAG}.0
56
else
67
echo "Image already exists!"
78
fi
89

9-
docker run --name dotnet -it -v .:/Development mcr.microsoft.com/dotnet/sdk:6.0 /Development/BuildScripts/dotnetbuild.sh
10+
docker run --name dotnet -it -v .:/Development mcr.microsoft.com/dotnet/sdk:${TAG}.0 /Development/BuildScripts/dotnetbuild.sh
1011
docker rm dotnet

BuildScripts/dotnetbuild.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/sh
22
cd /Development
33
dotnet build
4+
dotnet publish
45
exit

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 0.6.2.0
2+
- Updated support for the latest Jellyfin Server release (10.9.0)
3+
- Fixed Scheduled Scan task completion meter. Now accurately gives percentage of completion.
4+
- Added {Date} to allow for autogenerated dates to be added to HTML body
5+
- ***More updates on the way, finally have a little down time. Thank you for all the support!***
6+
17
# 0.6.0
28
- Added ability to use custom HTML for newsletter emails
39
- Added buildscript (using dotnet docker) for easier development

Directory.Build.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>0.6.0</Version>
4-
<AssemblyVersion>0.6.0</AssemblyVersion>
5-
<FileVersion>0.6.0</FileVersion>
3+
<Version>0.6.2.0</Version>
4+
<AssemblyVersion>0.6.2.0</AssemblyVersion>
5+
<FileVersion>0.6.2.0</FileVersion>
66
</PropertyGroup>
77
</Project>

Jellyfin.Plugin.Newsletters/Configuration/configPage.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
<label class="inputLabel inputLabelUnfocused" for="Body">Body Html:</label>
6767
<div class="fieldDescription">
6868
See below for Field Names to use in your custom HTML:<br>
69+
{Date} - The date of Newsletter generation. <br>
6970
{EntryData} - This is the insert of the custom HTML from the field EntryData below. If not used, email will have no data. <br>
7071
</div>
7172
<textarea id="Body" name="Body" dataname="Body" style="width: 100%; height: 400px"></textarea>

Jellyfin.Plugin.Newsletters/Emails/HTMLBuilder.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,14 @@ public string GetDefaultHTMLBody()
7979
return emailBody;
8080
}
8181

82+
// public string TemplateReplace(String htmlObj)
83+
// {
84+
// return htmlObj.Replace("{ImageURL}", item.ImageURL, StringComparison.Ordinal)
85+
// .Replace("{Title}", item.Title, StringComparison.Ordinal)
86+
// .Replace("{SeasonEpsInfo}", seaEpsHtml, StringComparison.Ordinal)
87+
// .Replace("{SeriesOverview}", item.SeriesOverview, StringComparison.Ordinal);
88+
// }
89+
8290
public string BuildDataHtmlStringFromNewsletterData()
8391
{
8492
List<string> completed = new List<string>();

Jellyfin.Plugin.Newsletters/Emails/smtp.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,15 @@ public void SendEmail()
9898
string password = config.SMTPPass;
9999
string emailToAddress = config.ToAddr;
100100
string subject = config.Subject;
101-
string body;
101+
// string body;
102102

103103
HtmlBuilder hb = new HtmlBuilder();
104104

105-
body = hb.GetDefaultHTMLBody();
105+
string body = hb.GetDefaultHTMLBody();
106106
string builtString = hb.BuildDataHtmlStringFromNewsletterData();
107107
string finalBody = hb.ReplaceBodyWithBuiltString(body, builtString);
108+
string currDate = DateTime.Today.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture);
109+
finalBody = finalBody.Replace("{Date}", currDate, StringComparison.Ordinal);
108110

109111
mail.From = new MailAddress(emailFromAddress, emailFromAddress);
110112
mail.To.Clear();

Jellyfin.Plugin.Newsletters/Jellyfin.Plugin.Newsletters.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<RootNamespace>Jellyfin.Plugin.Newsletters</RootNamespace>
66
<GenerateDocumentationFile>true</GenerateDocumentationFile>
77
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
@@ -11,8 +11,8 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Jellyfin.Controller" Version="10.8.0" />
15-
<PackageReference Include="Jellyfin.Model" Version="10.8.0" />
14+
<PackageReference Include="Jellyfin.Controller" Version="10.*-*" />
15+
<PackageReference Include="Jellyfin.Model" Version="10.*-*" />
1616
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
1717
<PackageReference Include="SQLitePCL.pretty.netstandard" Version="3.1.0" />
1818
<FrameworkReference Include="Microsoft.AspNetCore.App" />

Jellyfin.Plugin.Newsletters/Scanner/Scraper.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,15 @@ public void BuildObjs(List<BaseItem> items, string type)
128128
{
129129
logger.Info($"Parsing {type}..");
130130
BaseItem episode, season, series;
131-
logger.Info($"{type} Scan Size: {items.Count}");
131+
totalLibCount = items.Count;
132+
logger.Info($"Scan Size: {totalLibCount}");
133+
logger.Info($"Scanning '{type}'");
132134
foreach (BaseItem item in items)
133135
{
136+
currCount++;
137+
// logger.Info("PROGRESS: " + currCount + " " + totalLibCount);
138+
// double percentage = (double)currCount / (double)totalLibCount * 100;
139+
progress.Report((double)currCount / (double)totalLibCount * 100);
134140
if (item is not null)
135141
{
136142
try
@@ -269,7 +275,7 @@ public void BuildObjs(List<BaseItem> items, string type)
269275
}
270276
}
271277

272-
currCount++;
278+
// currCount++;
273279
}
274280
}
275281

0 commit comments

Comments
 (0)